diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2013-01-25 10:47:52 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-01-28 17:42:47 -0500 |
commit | ab779c81460ce48e6b270977ef339b32d87c1f41 (patch) | |
tree | 06d1c74756194d17dbfd3eaa2a171a735230aa23 /src/udev | |
parent | cc9cf4c078702fcb8e88fe6f00303d821aabffce (diff) |
Honor DEVUID, DEVGID in addition to DEVMODE
New behaviour in udev-197
systemd commit 1edefa4f1d7bae6cc19aa4a97238400c5a04f7a4
Author: Kay Sievers <kay@vrfy.org>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udev-event.c | 6 | ||||
-rw-r--r-- | src/udev/udev-rules.c | 4 | ||||
-rw-r--r-- | src/udev/udev.h | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index cbcb3f5ab2..9beb46574e 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -849,6 +849,12 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, if (event->dev_db != NULL) udev_node_update_old_links(dev, event->dev_db); + if (!event->owner_set) + event->uid = udev_device_get_devnode_uid(dev); + + if (!event->group_set) + event->gid = udev_device_get_devnode_gid(dev); + if (!event->mode_set) { if (udev_device_get_devnode_mode(dev) > 0) { /* kernel supplied value */ diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 55d9ba9a8a..ab755210ba 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -2244,6 +2244,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event if (cur->key.op == OP_ASSIGN_FINAL) event->owner_final = true; udev_event_apply_format(event, rules_str(rules, cur->key.value_off), owner, sizeof(owner)); + event->owner_set = true; event->uid = util_lookup_user(event->udev, owner); log_debug("OWNER %u %s:%u\n", event->uid, @@ -2259,6 +2260,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event if (cur->key.op == OP_ASSIGN_FINAL) event->group_final = true; udev_event_apply_format(event, rules_str(rules, cur->key.value_off), group, sizeof(group)); + event->group_set = true; event->gid = util_lookup_group(event->udev, group); log_debug("GROUP %u %s:%u\n", event->gid, @@ -2294,6 +2296,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event break; if (cur->key.op == OP_ASSIGN_FINAL) event->owner_final = true; + event->owner_set = true; event->uid = cur->key.uid; log_debug("OWNER %u %s:%u\n", event->uid, @@ -2305,6 +2308,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event break; if (cur->key.op == OP_ASSIGN_FINAL) event->group_final = true; + event->group_set = true; event->gid = cur->key.gid; log_debug("GROUP %u %s:%u\n", event->gid, diff --git a/src/udev/udev.h b/src/udev/udev.h index 2093af16bf..c8ee2feede 100644 --- a/src/udev/udev.h +++ b/src/udev/udev.h @@ -49,7 +49,9 @@ struct udev_event { bool sigterm; bool inotify_watch; bool inotify_watch_final; + bool group_set; bool group_final; + bool owner_set; bool owner_final; bool mode_set; bool mode_final; |