The -s option needs to open the device O_RDWR for non-root users
Bug #27380 reported by
Ben Collins
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eject (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
If a user has read/write access to a device, they should be able to send SG_IO
commands to it. However, since eject only opens the device O_RDONLY, the kernel
returns EIO when using "eject -s" as a normal user.
The patch opens the device O_RDWR, since that's what you'll need in order to
send these commands (kernel ignores this requirement for root).
To post a comment you must log in.
Created an attachment (id=5415)
Patch to open device RDWR for -s option