Bug#522859: block devices must be opened with O_RDONLY

2009-04-18 Thread Frank Lichtenheld
On Sat, Apr 11, 2009 at 01:34:59PM +0200, Marco d'Itri wrote:
 On Apr 11, Frank Lichtenheld dj...@debian.org wrote:
 
  IIRC the O_RDWR was added for the benefit of the SCSI ioctl which might
  not work otherwise. With some code reordering it should possible to limit
  to that.
 I recommend that you verify if this is still true, because I think
 that having side effects only in some cases could be quite confusing...

With my USB stick I see the following behaviour:

As normal user (with write access to the device file):
 CDROM eject RDONLY works
 CDROM eject RDWR works
 SCSI eject RDONLY doesn't work
 SCSI eject RDWR works

As root:
 same but SCSI eject RDONLY also works

So I guess at least for the SCSI eject we still need RDWR in some cases
(I suspect the normal user is missing some capability there)

Gruesse,
-- 
Frank Lichtenheld dj...@debian.org
www: http://www.djpig.de/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#522859: block devices must be opened with O_RDONLY

2009-04-18 Thread Marco d'Itri
On Apr 18, Frank Lichtenheld dj...@debian.org wrote:

 So I guess at least for the SCSI eject we still need RDWR in some cases
 (I suspect the normal user is missing some capability there)
SCSI eject actually is the case which interests me.
Looks like RDWR should be restricted to unpriviledged users until the
kernel can be fixed.

-- 
ciao,
Marco


signature.asc
Description: Digital signature


Bug#522859: block devices must be opened with O_RDONLY

2009-04-11 Thread Frank Lichtenheld
On Tue, Apr 07, 2009 at 02:51:33AM +0200, Marco d'Itri wrote:
 Package: eject
 Version: 2.1.5+deb1+cvs20081104-5
 Severity: normal
 
 Otherwise modern kernels will generate a change uevent which will make
 udev access the device again and maybe even remount it.
 
 I do not know about the other functions, but the CDROMEJECT ioctl works
 fine with a read only fd.

IIRC the O_RDWR was added for the benefit of the SCSI ioctl which might
not work otherwise. With some code reordering it should possible to limit
to that.

Gruesse,
-- 
Frank Lichtenheld dj...@debian.org
www: http://www.djpig.de/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#522859: block devices must be opened with O_RDONLY

2009-04-11 Thread Marco d'Itri
On Apr 11, Frank Lichtenheld dj...@debian.org wrote:

 IIRC the O_RDWR was added for the benefit of the SCSI ioctl which might
 not work otherwise. With some code reordering it should possible to limit
 to that.
I recommend that you verify if this is still true, because I think
that having side effects only in some cases could be quite confusing...

-- 
ciao,
Marco


signature.asc
Description: Digital signature


Bug#522859: block devices must be opened with O_RDONLY

2009-04-06 Thread Marco d'Itri
Package: eject
Version: 2.1.5+deb1+cvs20081104-5
Severity: normal

Otherwise modern kernels will generate a change uevent which will make
udev access the device again and maybe even remount it.

I do not know about the other functions, but the CDROMEJECT ioctl works
fine with a read only fd.

-- 
ciao,
Marco


signature.asc
Description: Digital signature