linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Linder <hannal@us.ibm.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] set default owner/group in db.
Date: Sat, 17 Jan 2004 01:33:23 +0000	[thread overview]
Message-ID: <8250000.1074303203@w-hlinder> (raw)
In-Reply-To: <32230000.1074291692@w-hlinder>

--On Friday, January 16, 2004 05:10:15 PM -0800 Hanna Linder <hannal@us.ibm.com> wrote:

> Good idea. This patch will now allow the admin to either set the default 
> owner and group in /etc/udev/udev.conf or it will default to root/root.
> Greg, you can change udev.conf to set default_owner and default_group now.
> 
> Hanna

Oops. Here is a patch that will apply cleanly. Updated Documentation patch
will do on Monday.

Hanna

diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c	Fri Jan 16 18:48:55 2004
+++ b/namedev.c	Fri Jan 16 18:48:55 2004
@@ -151,6 +151,22 @@
 	return mode;
 }
 
+static char * get_default_owner(void)
+{
+	if (strlen(default_owner_str) = 0) {
+		strncpy(default_owner_str, "root", OWNER_SIZE);
+	}
+	return default_owner_str;
+}
+
+static char * get_default_group(void)
+{
+	if (strlen(default_group_str) = 0) {
+		strncpy(default_group_str, "root", GROUP_SIZE);
+	}
+	return default_group_str;
+}
+
 static void apply_format(struct udevice *udev, unsigned char *string)
 {
 	char temp[NAME_SIZE];
@@ -720,8 +736,8 @@
 	} else {
 		/* no matching perms found :( */
 		udev->mode = get_default_mode(class_dev);
-		udev->owner[0] = 0x00;
-		udev->group[0] = 0x00;
+		strncpy(udev->owner, get_default_owner(), OWNER_SIZE);
+		strncpy(udev->group, get_default_group(), GROUP_SIZE);
 	}
 	dbg("name, '%s' is going to have owner='%s', group='%s', mode = %#o",
 	    udev->name, udev->owner, udev->group, udev->mode);
diff -Nru a/udev.h b/udev.h
--- a/udev.h	Fri Jan 16 18:48:55 2004
+++ b/udev.h	Fri Jan 16 18:48:55 2004
@@ -68,5 +68,7 @@
 extern char udev_config_filename[PATH_MAX+NAME_MAX];
 extern char udev_rules_filename[PATH_MAX+NAME_MAX];
 extern char default_mode_str[NAME_MAX];
+extern char default_owner_str[OWNER_SIZE];
+extern char default_group_str[GROUP_SIZE];
 
 #endif
diff -Nru a/udev_config.c b/udev_config.c
--- a/udev_config.c	Fri Jan 16 18:48:55 2004
+++ b/udev_config.c	Fri Jan 16 18:48:55 2004
@@ -46,6 +46,8 @@
 char udev_rules_filename[PATH_MAX+NAME_MAX];
 char udev_config_filename[PATH_MAX+NAME_MAX];
 char default_mode_str[NAME_MAX];
+char default_owner_str[OWNER_SIZE];
+char default_group_str[GROUP_SIZE];
 
 
 static void init_variables(void)
@@ -117,6 +119,8 @@
 		set_var("udev_rules", udev_rules_filename);
 		set_var("udev_permissions", udev_permissions_filename);
 		set_var("default_mode", default_mode_str);
+		set_var("default_owner", default_owner_str);
+		set_var("default_group", default_group_str);
 	}
 	dbg_parse("%s:%d:%Zd: error parsing '%s'", udev_config_filename,
 		  lineno, temp - line, temp);




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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

  parent reply	other threads:[~2004-01-17  1:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-16 22:21 [PATCH] set default owner/group in db Hanna Linder
2004-01-16 22:51 ` Greg KH
2004-01-17  1:10 ` Hanna Linder
2004-01-17  1:33 ` Hanna Linder [this message]
2004-01-17 15:12 ` Kay Sievers
2004-01-19 18:41 ` Hanna Linder
2004-01-19 19:44 ` Greg KH
2004-01-19 19:45 ` 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=8250000.1074303203@w-hlinder \
    --to=hannal@us.ibm.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).