rlishtaba / rubyripper

Automatically exported from code.google.com/p/rubyripper
0 stars 0 forks source link

Is write access (in PermissionDrive) required? #488

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, PermissionDrive.checkDevice() checks for both read AND write access 
to the CD-ROM device.  I am not certain that write-access is required (at 
least, for ripping).  Why do we check for write access?

If it is not needed, we should probably remove the File.writable? tests from 
both isReadAndWritable? and genericDeviceChecks.

Original issue reported on code.google.com by comradec...@gmail.com on 31 Oct 2011 at 3:11

GoogleCodeExporter commented 8 years ago
That is because cdparanoia needs writing rights somehow, don't ask me why. I've 
just retested this behaviour.

After chmod 440 /dev/sr0 it stops working and complaints about rights to access 
the drive, though it strangely refert to /dev/sg0: Error trying to open 
/dev/sg0 exclusively (No such file or directory). retrying in 1 second.

When doing a chmod 660 /dev/sr0 it works again. It might be a Linux thing, let 
me know if FreeBSD behaves differently.

Original comment by boukewou...@gmail.com on 31 Oct 2011 at 6:03

GoogleCodeExporter commented 8 years ago
My access to /dev/cd0 on FreeBSD is read-only (via group) which is why I raised 
the issue when I was only able to run rubyripper as root.

For me (as my non-root user), 'cdparanoia -vsQ' returns successfully and 
'cdparanoia -B -- "-1"' seems to rip successfully.  Perhaps requiring write 
access is a limitation of the Linux SCSI APIs?

Original comment by comradec...@gmail.com on 1 Nov 2011 at 1:17

GoogleCodeExporter commented 8 years ago
Eh, wouldn't call it a limitation my dear BSD friend, just different behaviour 
:P

Anyway, this is now fixed in current master branch. I did choose another 
solution than your proposal:

  def checkDevice
    getRealDevice()
    isBlockDevice? if @deps.platform =~ /linux/
    isDriveReadable?
    isDriveWritable? if @deps.platform =~ /linux/
  end

Original comment by boukewou...@gmail.com on 5 Nov 2011 at 9:46

GoogleCodeExporter commented 8 years ago
Ah, I favored matching against FreeBSD because I was not sure that block 
devices were specific to Linux.  In fact, I had the vague impression that it 
was the opposite: character devices were specific to FreeBSD (See: 
http://www.freebsd.org/doc/en/books/arch-handbook/driverbasics-block.html)

Original comment by comradec...@gmail.com on 6 Nov 2011 at 5:39

GoogleCodeExporter commented 8 years ago
I see. Well, it's only a warning mechanism. And it might well be possible other 
OS'es are doing the same thing. I leave it this way until someone pops up with 
a permission problem and another strange OS (to me, that is)...

Original comment by boukewou...@gmail.com on 9 Nov 2011 at 9:06