Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 303465 - udev-141 (stable on x86) does not use cdrom group
Summary: udev-141 (stable on x86) does not use cdrom group
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-04 17:30 UTC by MageSlayer
Modified: 2010-02-06 08:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MageSlayer 2010-02-04 17:30:03 UTC
Hi

Seems like a bug, imho.
My cdrom is only accessible by root.
My /etc/udev/rules.d/70-persistent-cd.rules does not have GROUP="cdrom" clause.



Reproducible: Always
Comment 1 MageSlayer 2010-02-04 17:31:32 UTC
Small patch does the trick.

--- /lib/udev/write_cd_rules.bak	2010-02-04 19:22:37.000000000 +0200
+++ /lib/udev/write_cd_rules	2010-02-04 19:23:01.000000000 +0200
@@ -43,7 +43,7 @@
 	fi
 
 	[ "$comment" ] && echo "# $comment"
-	echo "$match, SYMLINK+=\"$link\", ENV{GENERATED}=\"1\""
+	echo "$match, SYMLINK+=\"$link\", GROUP=\"cdrom\", ENV{GENERATED}=\"1\""
 	} >> $RULES_FILE
 	SYMLINKS="$SYMLINKS $link"
 }
Comment 2 Rafał Mużyło 2010-02-04 17:43:52 UTC
IIRC, permissions on the symlink shouldn't matter in such case,
just the ones on the real device.
Comment 3 Rafał Mużyło 2010-02-04 17:48:15 UTC
My mistake, seems they do.
Comment 4 Matthias Schwarzott gentoo-dev 2010-02-04 19:19:45 UTC
As only permissions of the device matter, this is just fine.

$ ls -l /dev/cdrom /dev/dvd /dev/sr0
lrwxrwxrwx  1 root root      3 30. Jan 15:15 /dev/cdrom -> sr0
lrwxrwxrwx  1 root root      3 30. Jan 15:15 /dev/dvd -> sr0
brw-rw----+ 1 root cdrom 11, 0 30. Jan 15:15 /dev/sr0

$ grep cdrom /lib/udev/rules.d/*
[...]
/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="cdrom"
/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="block", KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom"
/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="pktcdvd", GROUP="cdrom"
[...]

So all relevant devices get GROUP=cdrom assigned
Comment 5 MageSlayer 2010-02-05 06:56:40 UTC
Hm. I see your point.
You are right.
I have these rules. But sr0 still does not get cdrom group without some hack like mine.
I'll try to investigate.
Comment 6 MageSlayer 2010-02-06 08:33:19 UTC
Investigation (udevadm test /sys/block/sr0 2>&1 | grep apply) showed that I had old file /etc/udev/rules.d/50-udev-default.rules hanging around. It had a rule for cdrom and lacked cdrom group setting.
After removing it, more recent /lib/udev/rules.d/50-udev-default.rules came into play. 
So it works now without any problems.

Sorry for noise.