From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harald Hoyer Date: Mon, 20 Sep 2004 13:27:29 +0000 Subject: Patch to call dev.d scripts also with $SYMLINK Message-Id: <414EDAC1.5050903@redhat.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------090703090006000405030307" List-Id: To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------090703090006000405030307 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit especially useful to set pam_console ownerships for e.g. /dev/cdrom, which is a symlink to the $DEVNAME. --------------090703090006000405030307 Content-Type: text/plain; name="udev-030-symlink.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="udev-030-symlink.patch" --- udev-030/dev_d.c.symlink 2004-09-20 15:12:08.511594704 +0200 +++ udev-030/dev_d.c 2004-09-20 15:16:27.944154960 +0200 @@ -65,22 +84,31 @@ { char dirname[256]; char env_devname[NAME_SIZE]; + char env_symlink[NAME_SIZE]; char *devname; char *temp; if (udev_dev_d == 0) return; + env_devname[0] = 0; + env_symlink[0] = 0; + if (dev->type == 'b' || dev->type == 'c') { strfieldcpy(env_devname, udev_root); strfieldcat(env_devname, dev->name); + if (dev->symlink[0]) { + strfieldcpy(env_symlink, udev_root); + strfieldcat(env_symlink, dev->symlink); + } } else if (dev->type == 'n') { strfieldcpy(env_devname, dev->name); setenv("DEVPATH", devpath, 1); } - else env_devname[0] = 0; setenv("DEVNAME", env_devname, 1); dbg("DEVNAME='%s'", env_devname); + setenv("SYMLINK", env_symlink, 1); + dbg("SYMLINK='%s'", env_symlink); devname = strdup(dev->name); if (!devname) { --------------090703090006000405030307-- ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ 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