linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch to call dev.d scripts also with $SYMLINK
@ 2004-09-20 13:27 Harald Hoyer
  2004-10-05 21:18 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Harald Hoyer @ 2004-09-20 13:27 UTC (permalink / raw)
  To: linux-hotplug

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

especially useful to set pam_console ownerships for e.g. /dev/cdrom, which is a symlink to the $DEVNAME.

[-- Attachment #2: udev-030-symlink.patch --]
[-- Type: text/plain, Size: 921 bytes --]

--- 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) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-05 21:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-20 13:27 Patch to call dev.d scripts also with $SYMLINK Harald Hoyer
2004-10-05 21:18 ` Greg KH
2004-10-05 21:39 ` Kay Sievers
2004-10-05 21:52 ` Greg KH

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).