From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Fri, 16 Jan 2004 22:51:00 +0000 Subject: Re: [PATCH] set default owner/group in db. Message-Id: <20040116225100.GB3263@kroah.com> List-Id: References: <32230000.1074291692@w-hlinder> In-Reply-To: <32230000.1074291692@w-hlinder> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Fri, Jan 16, 2004 at 02:21:32PM -0800, Hanna Linder wrote: > > 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. Hm, in thinking about this some more, how about just adding support for a default owner and default group to the main udev.config file? Then your patch here would turn into something like: > 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,8 @@ > } else { > /* no matching perms found :( */ > udev->mode = get_default_mode(class_dev); > - udev->owner[0] = 0x00; > - udev->group[0] = 0x00; > + udev->owner[0] = get_default_owner(class_dev); > + udev->group[0] = get_default_group(class_dev); > } > dbg("name, '%s' is going to have owner='%s', group='%s', mode = %#o", > udev->name, udev->owner, udev->group, udev->mode); That way the owner and group would end up in the database properly. thanks, greg k-h ------------------------------------------------------- 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