linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] set default owner/group in db.
@ 2004-01-16 22:21 Hanna Linder
  2004-01-16 22:51 ` Greg KH
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Hanna Linder @ 2004-01-16 22:21 UTC (permalink / raw)
  To: linux-hotplug


This patch fixes a bug where the udev database stored empty strings
for Owner and Group if they were default. This patch stores the default 
value into the database if not set otherwise. See example output:


crw-------    1 root     root       4,  65 Jan 16 11:13 ttyS1

P: /class/tty/ttyS1
N: ttyS1
S:
O: root
G: root

This is a bit of a hack. However, until udev supports setting the 
o/g values they will be root/root anyway so the database might as 
well reflect the truth instead of empty strings.

Hanna


----


# This is a BitKeeper generated diff -Nru style patch.
# 
# ChangeSet
#   2004/01/16 15:17:20-08:00 hlinder@w-hlinder2.(none) 
#   set o/g defaults until udev supports setting them.
# 
# namedev.c
#   2004/01/16 15:17:19-08:00 hlinder@w-hlinder2.(none) +3 -2
#   Set o/g defaults.
# 
diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c	Fri Jan 16 15:18:18 2004
+++ b/namedev.c	Fri Jan 16 15:18:18 2004
@@ -720,8 +720,9 @@
 	} else {
 		/* no matching perms found :( */
 		udev->mode = get_default_mode(class_dev);
-		udev->owner[0] = 0x00;
-		udev->group[0] = 0x00;
+		/* HACK until udev sets the owner and group */
+		strncpy(udev->owner, "root", sizeof(udev->owner));
+		strncpy(udev->group, "root", sizeof(udev->group));
 	}
 	dbg("name, '%s' is going to have owner='%s', group='%s', mode = %#o",
 	    udev->name, udev->owner, udev->group, udev->mode);





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

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

end of thread, other threads:[~2004-01-19 19:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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