linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harald Hoyer <harald@redhat.com>
To: linux-hotplug@vger.kernel.org
Subject: Patch to call dev.d scripts also with $SYMLINK
Date: Mon, 20 Sep 2004 13:27:29 +0000	[thread overview]
Message-ID: <414EDAC1.5050903@redhat.com> (raw)

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

             reply	other threads:[~2004-09-20 13:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 13:27 Harald Hoyer [this message]
2004-10-05 21:18 ` Patch to call dev.d scripts also with $SYMLINK Greg KH
2004-10-05 21:39 ` Kay Sievers
2004-10-05 21:52 ` 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=414EDAC1.5050903@redhat.com \
    --to=harald@redhat.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).