Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 66730

Summary: udev & permissions for cdroms
Product: Gentoo Linux Reporter: Spider (RETIRED) <spider>
Component: [OLD] Core systemAssignee: Greg Kroah-Hartman (RETIRED) <gregkh>
Status: RESOLVED CANTFIX    
Severity: normal CC: confabulate, dberkholz, genstef
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Spider (RETIRED) gentoo-dev 2004-10-08 00:14:25 UTC
it appears that udev's default permissions for cdroms on IDE is to assign them to root:disk rather than root:cdrom

PAM restores this, but thats not always a sufficient behaviour.
ls -l /dev/hdc
brw-------  1 spider cdrom 22, 0 Oct 16  2003 /dev/hdc

Darkmere ~ # udevstart
Darkmere ~ # ls -al /dev/hdc
brw-rw----  1 root disk 22, 0 Oct 16  2003 /dev/hdc


(discovered this while testing out new udev rules for an usb-stick)

Reproducible: Always
Steps to Reproduce:
1.run udevstart
2.
3.
Comment 1 MickKi 2004-10-10 04:44:06 UTC
I assume that http://forums.gentoo.org/viewtopic.php?p=1632264 is also caused by this bug?
Comment 2 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-10-12 11:51:11 UTC
Rumor has it that the latest versions of udev fix this.

Can you verify it?
Comment 3 Spider (RETIRED) gentoo-dev 2004-10-12 17:51:41 UTC
unable to boot my system with the latest version of udev, appears the device tarball got corrupted for some reason.  Will try again as soon as my system is solid and stable.
Comment 4 Spider (RETIRED) gentoo-dev 2004-10-13 02:52:07 UTC
Nop, same results with last udev version.

As far as I can see its theese rules that somehow conflict:

cdrom*:root:cdrom:0660
dvd:root:cdrom:0660
rdvd:root:cdrom:0660
cdroms/*:root:cdrom:0660

hd*:root:disk:660
ide/*/*/*/*/*:root:disk:660



are permissions.d/ parsed in order? in such a case , its first set to cdrom, then set to disk.. (becuase yes, its a hd? ...)
Comment 5 Rafal Peisert 2004-10-14 03:36:58 UTC
the same thing happens with /dev/sound/* devices. I'm using the latest stable udev. I don't see any rules in permissions.d/ that could conflict.
Comment 6 Stefan Schweizer (RETIRED) gentoo-dev 2004-10-24 15:09:26 UTC
Same here:


crw-------  1 stefan tty     5,  1 24. Okt 23:31 /dev/console
srwx------  1 stefan root        0 24. Okt 23:31 /dev/gpmctl
brw-------  1 stefan cdrom  22,  0 24. Okt 23:30 /dev/hdc
crw-------  1 stefan root   29,   0 24. Okt 23:30 /dev/fb/0
lrwx------  1 stefan users       64 25. Okt 00:05 /dev/fd/0 -> /dev/pts/2
l-wx------  1 stefan users       64 25. Okt 00:05 /dev/fd/1 -> pipe:[30478]
lrwx------  1 stefan users       64 25. Okt 00:05 /dev/fd/2 -> /dev/pts/2
crw--w----  1 stefan tty   136,   0 25. Okt 00:05 /dev/pts/0
crw--w----  1 stefan tty   136,   1 25. Okt 00:05 /dev/pts/1
crw--w----  1 stefan tty   136,   2 25. Okt 00:05 /dev/pts/2
crw-------  1 stefan audio 116,   0 24. Okt 23:31 /dev/snd/controlC0
crw-------  1 stefan audio 116,  24 24. Okt 23:31 /dev/snd/pcmC0D0c
crw-------  1 stefan audio 116,  16 24. Okt 23:31 /dev/snd/pcmC0D0p
crw-------  1 stefan audio 116,  25 24. Okt 23:31 /dev/snd/pcmC0D1c
crw-------  1 stefan audio 116,  33 24. Okt 23:31 /dev/snd/timer

latest ~x86 , udev-042
Comment 7 Daniel Drake (RETIRED) gentoo-dev 2004-10-24 15:32:44 UTC
Try running "udevstart" after logging in, does that help? If so, its probably pam interfering (/etc/security/console.perms)
Comment 8 Stefan Schweizer (RETIRED) gentoo-dev 2004-11-08 06:47:58 UTC
> Try running "udevstart" after logging in, does that help? 
> If so, its probably pam interfering (/etc/security/console.perms)

yes, it helps:


/home/stefan # ls /dev/hdc -la
brw-------  1 stefan root 22, 0  8. Nov 13:34 /dev/hdc
/home/stefan # udevstart
/home/stefan # ls /dev/hdc -la
brw-rw----  1 root disk 22, 0  8. Nov 13:34 /dev/hdc

how do I get the right permissions on bootup now?
Comment 9 Daniel Drake (RETIRED) gentoo-dev 2004-11-08 10:02:10 UTC
udev does set them correct on bootup. but when you login, pam steps in (see /etc/security/console.perms).
Comment 10 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-11-10 11:15:03 UTC
should be fixed with latest pam releases.
Comment 11 Stefan Schweizer (RETIRED) gentoo-dev 2004-11-10 11:42:43 UTC
Maybe the pam problem is fixed, but the most important problem of the bug is not fixed. It is still present:

  lrwxrwxrwx  1 root root     3 10. Nov 20:38 /dev/cdrom -> hdc
  lrwxrwxrwx  1 root root     3 10. Nov 20:38 /dev/cdrw -> hdc
  lrwxrwxrwx  1 root root     3 10. Nov 20:38 /dev/dvd -> hdc
  brw-rw----  1 root disk 22, 0 10. Nov 14:47 /dev/hdc

  /dev/cdroms:
  insgesamt 0
  lrwxrwxrwx   1 root root     6 10. Nov 20:38 cdrom0 -> ../hdc

This is exactly the result that we configured in permissions.d:

  cdrom*:root:cdrom:0660
  dvd:root:cdrom:0660
  rdvd:root:cdrom:0660
  cdroms/*:root:cdrom:0660

  hd*:root:disk:660
  ide/*/*/*/*/*:root:disk:660

I do not know udev that good to get the ide-devfs.sh programm to decide whether to give cdrom permissions to hdc or not, but what I know for sure is, that it makes no sense to apply permissions to symlinks.
Comment 12 Daniel Drake (RETIRED) gentoo-dev 2004-11-10 12:01:11 UTC
Reopening
Comment 13 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-11-10 13:44:58 UTC
I agree you can't apply permissions to symlinks.

But how in the world are you supposed to determine the proper permission
to give to hda, based on the fact that it's a cdrom or a disk?

This is up to the user to configure on their own, udev can not currently
handle this.

If you have further questions about this, please bring them up on the
linux-hotplug-devel mailing list, which is where the udev developers are.