linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Schweizer <sschweizer@gmail.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev and cdrom permissions
Date: Thu, 11 Nov 2004 18:52:51 +0000	[thread overview]
Message-ID: <e79639220411111052283089b0@mail.gmail.com> (raw)
In-Reply-To: <e796392204111014024814f58@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: add_cdrom_group_to_cd_devs_for_udev.patch --]
[-- Type: text/x-patch; name="add_cdrom_group_to_cd_devs_for_udev.patch", Size: 2511 bytes --]

diff -pur --show-c-function udev-044.orig/etc/udev/udev.rules.gentoo udev-044/etc/udev/udev.rules.gentoo
--- udev-044.orig/etc/udev/udev.rules.gentoo	2004-11-11 17:07:35.838720576 +0100
+++ udev-044/etc/udev/udev.rules.gentoo	2004-11-11 17:08:54.495762888 +0100
@@ -19,7 +19,7 @@ BUS="scsi", KERNEL="scd[a-z]", PROGRAM="
 
 # devfs-names for ide-devices (uncomment only one)
 #  /dev/ide/.../{disc,cd} and /dev/{cdroms,discs}/* type names
-BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}"
+BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}", GROUP="%c{3}"
 
 # DRI devices
 KERNEL="card*", NAME="dri/card%n"
diff -pur --show-c-function udev-044.orig/extras/ide-devfs.sh udev-044/extras/ide-devfs.sh
--- udev-044.orig/extras/ide-devfs.sh	2004-11-11 17:07:35.970700512 +0100
+++ udev-044/extras/ide-devfs.sh	2004-11-11 17:15:53.656040840 +0100
@@ -36,11 +36,11 @@ get_dev_number() {
 if [ -z "$3" ] && [ -f /proc/ide/${1}/media ]; then
 	MEDIA=`cat /proc/ide/${1}/media`
 	if [ "${MEDIA}" = "cdrom" ]; then
-		echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom`
+		echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` ${MEDIA}
 	elif [ "${MEDIA}" = "floppy" ]; then
-		echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/floppy`get_dev_number $1 floppy`/disc
+		echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/floppy`get_dev_number $1 floppy`/disc ${MEDIA}
 	elif [ "${MEDIA}" = "disk" ]; then
-		echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`get_dev_number $1 disk`/disc
+		echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`get_dev_number $1 disk`/disc ${MEDIA}
 	fi
 else
 	echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 discs/disc`get_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	2004-11-11 17:07:35.978699296 +0100
+++ udev-044/namedev.c	2004-11-11 17:13:25.654540488 +0100
@@ -786,6 +786,11 @@ found:
 
 	udev->partitions = dev->partitions;
 
+	if (dev->group[0] != '\0') {
+		strfieldcpy(udev->group, dev->group);
+		apply_format(udev, udev->group, sizeof(udev->group), class_dev, sysfs_device);	
+	}
+
 	/* get permissions given in rule */
 	set_empty_perms(udev, dev->mode,
 			      dev->owner,

  parent reply	other threads:[~2004-11-11 18:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-10 22:02 udev and cdrom permissions Stefan Schweizer
2004-11-10 22:10 ` Marco d'Itri
2004-11-10 23:25 ` Stefan Schweizer
2004-11-11 18:52 ` Stefan Schweizer [this message]
2004-11-17 21:26 ` Stefan Schweizer
2004-12-02 22:26 ` Greg KH
2004-12-05 21:59 ` Stefan Schweizer
2004-12-06 23:03 ` Greg KH
2004-12-07 14:34 ` Kay Sievers
2004-12-07 17:51 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e79639220411111052283089b0@mail.gmail.com \
    --to=sschweizer@gmail.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).