Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 98175 - udev-061 creates nodes with wrong owner
Summary: udev-061 creates nodes with wrong owner
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Greg Kroah-Hartman (RETIRED)
URL:
Whiteboard:
Keywords:
: 98256 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-06 20:58 UTC by Georgi Georgiev
Modified: 2005-07-07 16:07 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georgi Georgiev 2005-07-06 20:58:08 UTC
udev is assigning the GROUP value from a rule to the uid of a node. The fix is easier to understand than the long explanation of the bug:

--- udev-061/udev_rules_parse.c.old     2005-07-07 12:51:27.000000000 +0900
+++ udev-061/udev_rules_parse.c 2005-07-07 12:51:37.000000000 +0900
@@ -391,21 +391,21 @@
                if (strcasecmp(key, "GROUP") == 0) {
                        valid = 1;
                        if (rules->resolve_names && (!strchr(value, '$') && !strchr(value, '%'))) {
                                char *endptr;
                                strtoul(value, &endptr, 10);
                                if (endptr[0] != '\0') {
                                        char group[32];
                                        gid_t gid = lookup_group(value);
                                        dbg("replacing groupname='%s' by id=%i", value, gid);
                                        sprintf(group, "%li", gid);
-                                       add_rule_key(rule, &rule->owner, operation, group);
+                                       add_rule_key(rule, &rule->group, operation, group);
                                        continue;
                                }
                        }
 
                        add_rule_key(rule, &rule->group, operation, value);
                        continue;
                }
 
                if (strcasecmp(key, "MODE") == 0) {
                        rule->mode = strtol(value, NULL, 8);
Comment 1 Duncan 2005-07-07 10:46:08 UTC
Problem confirmed, here. Audio devices are assigned to UID 18 (no passwd 
entry), group root, instead of user root, group audio (GID 18).  Disks are set 
to shutdown(UID 6)/root, instead of root/disk(GID 6).  Etc. 
 
I'll be trying the patch. 
 
Duncan 
 
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2005-07-07 11:01:36 UTC
Masked 061 for now .. Greg, just do a 061-r1 with patch if that is fine, else
062 if you guys are going that route.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-07-07 11:45:45 UTC
*** Bug 98256 has been marked as a duplicate of this bug. ***
Comment 4 Duncan 2005-07-07 11:49:28 UTC
(In reply to comment #1) 
Patch also confirmed to work. 
 
Duncan 
 
Comment 5 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-07-07 13:31:00 UTC
Thanks for the patch, it looks good.  Will add it to mainline and roll another
version.
Comment 6 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-07-07 16:07:32 UTC
Fixed on 062 release.