On Sun, May 19, 2002 at 11:58:53PM +0100, Piercarlo Grandi wrote:
> >>> On Sun, 19 May 2002 15:04:50 -0700, A Guy Called Tyketto
> >>> <tyketto@xxxxxxxxxx> said:
>
> tyketto> I'll make it short. Has anyone had a problem with a
> tyketto> non-root user trying to access /dev/cdrom? [ ... ]
>
> The first line in my '/etc/devsfd.conf' is 'INCLUDE /etc/devfsd.local',
> and then I have a file '/etc/devfs.local' in which I put local
> configuration, including permissions, such as:
>
> ------------------------------------------------------------------------
> REGISTER ^ide/host0/bus1/target0/lun0/cd$ COPY $devpath cdrom
> UNREGISTER ^ide/host0/bus1/target0/lun0/cd$ EXECUTE rm cdrom
> REGISTER ^scsi/host0/bus0/target3/lun0/generic$ COPY $devpath cdr
> UNREGISTER ^scsi/host0/bus0/target3/lun0/generic$ EXECUTE rm cdr
>
> REGISTER ^cdrom[0-9]*$ PERMISSIONS root.disk 0444
> REGISTER ^cdr[0-9]*$ PERMISSIONS root.root 0660
> ------------------------------------------------------------------------
Aye, but the location of the entry and permissions in either file
really have nothing to do with why the device is not usable by a non-root
user, when given permissions 0666, or even 0660:
#REGISTER ^ide/host0/bus1/target0/lun0/cd$ CFUNCTION GLOBAL mksymlink
$devname cdrom
REGISTER ^ide/host0/bus1/target0/lun0/cd$ COPY $devpath cdrom
REGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL mksymlink $devname cdrom
UNREGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL unlink cdrom
REGISTER ^cdrom[0-9]*$ PERMISSIONS root.root 0644
REGISTER ^cdrom[0-9]*$ PERMISSIONS root.root 0644
root@bellicha:/dev/ide/host1/bus1/target0/lun0# ls -al
total 0
drwxr-xr-x 1 root root 0 Dec 31 1969 ./
drwxr-xr-x 1 root root 0 Dec 31 1969 ../
brw-rw-rw- 1 root root 22, 0 Dec 31 1969 cd
root@bellicha:/dev/ide/host1/bus1/target0/lun0#
open("/dev/cdrom", O_RDONLY) = 3
ioctl(3, CDROMSUBCHNL, 0xbfffe814) = -1 EACCES (Permission denied)
rt_sigaction(SIGINT, {SIG_IGN}, {SIG_DFL}, 8) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_START, {B38400 opost isig -icanon -echo ...}) = 0
ioctl(0, TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
write(1, "\n", 1
) = 1
ioctl(0, SNDCTL_TMR_START, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
rt_sigaction(SIGINT, {SIG_DFL}, {SIG_IGN}, 8) = 0
munmap(0x40017000, 4096) = 0
_exit(0) = ?
> ^D
Script done on Sun May 19 16:56:39 2002
BL.
|