superg / redumper

Low level CD dumper utility
GNU General Public License v3.0
200 stars 18 forks source link

Reading lead-in on Plextor needs root privileges? #27

Closed Tatsh closed 1 year ago

Tatsh commented 1 year ago

I find this odd. It happens even if the drive is set to 0666 permissions. From strace:

ioctl(4</dev/sr1>, SG_IO,
{interface_id='S', dxfer_direction=SG_DXFER_FROM_DEV, cmd_len=12, cmdp="\xd8\x00\xff\xff\xb1\x4b\x00\x00\x00\x01\x02\x00", mx_sb_len=18,
iovec_count=0, dxfer_len=2742, timeout=50000, flags=0, dxferp= ..., 
status=0, masked_status=0, msg_status=0, sb_len_wr=0, sbp="", host_status=0, 
driver_status=0, resid=0, duration=0, info=0}) = -1 EPERM (Operation not permitted)

Am I missing a permission somewhere else?

As root this works fine. Reading an early lead-in on the LG drive works fine as a normal user.

superg commented 1 year ago

Permissions in general is not redumper problem, there is nothing that can be done within process scope to elevate permissions. This is something that I told you before on a discord, you need to understand which devices file of your distribution provide RW access to SCSI and how to do that. Here's more information: https://bbs.archlinux.org/viewtopic.php?id=260586 I need IOCTL read and write access, there is no way around that.

superg commented 1 year ago

Just to clarify, the problem is unrelated to cd writing, but it is illustrated that some SCSI commands are not allowed because they are treated as "write" to the device. The topic is quite old but illustrates the problem quite well.