From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schweizer Date: Thu, 11 Nov 2004 18:52:51 +0000 Subject: Re: udev and cdrom permissions Message-Id: MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_Part_638_17143269.1100199171713" List-Id: References: In-Reply-To: To: linux-hotplug@vger.kernel.org ------=_Part_638_17143269.1100199171713 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I have attached a rolled-up-patch that contains all necessarry changes to make it work. Please check the C-part again because I am not quite sure with it, but it works :) Stefan ------=_Part_638_17143269.1100199171713 Content-Type: text/x-patch; name="add_cdrom_group_to_cd_devs_for_udev.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="add_cdrom_group_to_cd_devs_for_udev.patch" diff -pur --show-c-function udev-044.orig/etc/udev/udev.rules.gentoo udev-0= 44/etc/udev/udev.rules.gentoo --- udev-044.orig/etc/udev/udev.rules.gentoo=092004-11-11 17:07:35.83872057= 6 +0100 +++ udev-044/etc/udev/udev.rules.gentoo=092004-11-11 17:08:54.495762888 +01= 00 @@ -19,7 +19,7 @@ BUS=3D"scsi", KERNEL=3D"scd[a-z]", PROGRAM=3D" =20 # devfs-names for ide-devices (uncomment only one) # /dev/ide/.../{disc,cd} and /dev/{cdroms,discs}/* type names -BUS=3D"ide", KERNEL=3D"hd*", PROGRAM=3D"/etc/udev/scripts/ide-devfs.sh %k = %b %n", NAME=3D"%k", SYMLINK=3D"%c{1} %c{2}" +BUS=3D"ide", KERNEL=3D"hd*", PROGRAM=3D"/etc/udev/scripts/ide-devfs.sh %k = %b %n", NAME=3D"%k", SYMLINK=3D"%c{1} %c{2}", GROUP=3D"%c{3}" =20 # DRI devices KERNEL=3D"card*", NAME=3D"dri/card%n" diff -pur --show-c-function udev-044.orig/extras/ide-devfs.sh udev-044/extr= as/ide-devfs.sh --- udev-044.orig/extras/ide-devfs.sh=092004-11-11 17:07:35.970700512 +0100 +++ udev-044/extras/ide-devfs.sh=092004-11-11 17:15:53.656040840 +0100 @@ -36,11 +36,11 @@ get_dev_number() { if [ -z "$3" ] && [ -f /proc/ide/${1}/media ]; then =09MEDIA=3D`cat /proc/ide/${1}/media` =09if [ "${MEDIA}" =3D "cdrom" ]; then -=09=09echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`= get_dev_number $1 cdrom` +=09=09echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`= get_dev_number $1 cdrom` ${MEDIA} =09elif [ "${MEDIA}" =3D "floppy" ]; then -=09=09echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/fl= oppy`get_dev_number $1 floppy`/disc +=09=09echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/fl= oppy`get_dev_number $1 floppy`/disc ${MEDIA} =09elif [ "${MEDIA}" =3D "disk" ]; then -=09=09echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`= get_dev_number $1 disk`/disc +=09=09echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`= get_dev_number $1 disk`/disc ${MEDIA} =09fi else =09echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 discs/disc`g= et_dev_number $1 disk`/part$3 diff -pur --show-c-function udev-044.orig/namedev.c udev-044/namedev.c --- udev-044.orig/namedev.c=092004-11-11 17:07:35.978699296 +0100 +++ udev-044/namedev.c=092004-11-11 17:13:25.654540488 +0100 @@ -786,6 +786,11 @@ found: =20 =09udev->partitions =3D dev->partitions; =20 +=09if (dev->group[0] !=3D '\0') { +=09=09strfieldcpy(udev->group, dev->group); +=09=09apply_format(udev, udev->group, sizeof(udev->group), class_dev, sysf= s_device);=09 +=09} + =09/* get permissions given in rule */ =09set_empty_perms(udev, dev->mode, =09=09=09 dev->owner, ------=_Part_638_17143269.1100199171713-- ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel