diff options
author | Scott James Remnant <scott@ubuntu.com> | 2009-01-20 21:33:02 +0000 |
---|---|---|
committer | Scott James Remnant <scott@netsplit.com> | 2009-01-20 21:33:02 +0000 |
commit | 5f03ed8a56d308af72db8a48ab66ed68667af2c6 (patch) | |
tree | 0677da5f63eeb76c8da17da2162e555ef1a80a10 /udev/udev-rules.c | |
parent | fc7d16f993df6cef0e6038c63942d17994fde672 (diff) |
Allow user and group lookup to be disabled.
In certain cut-down situations such as an installer or inside the
initramfs, we simply don't have any kind of name service. While we
could use rules without OWNER or GROUP, it's better to have the same
rules as a full system and have udevd ignore those parts of the rules.
Adds a --resolve-names=never switch to udevd that has this effect.
Diffstat (limited to 'udev/udev-rules.c')
-rw-r--r-- | udev/udev-rules.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c index 2d120dd927..ccf1eaaf8f 100644 --- a/udev/udev-rules.c +++ b/udev/udev-rules.c @@ -1454,10 +1454,10 @@ static int add_rule(struct udev_rules *rules, char *line, uid = strtoul(value, &endptr, 10); if (endptr[0] == '\0') { rule_add_key(&rule_tmp, TK_A_OWNER_ID, op, NULL, &uid); - } else if (rules->resolve_names && strchr("$%", value[0]) == NULL) { + } else if ((rules->resolve_names > 0) && strchr("$%", value[0]) == NULL) { uid = add_uid(rules, value); rule_add_key(&rule_tmp, TK_A_OWNER_ID, op, NULL, &uid); - } else { + } else if (rules->resolve_names == 0) { rule_add_key(&rule_tmp, TK_A_OWNER, op, value, NULL); } rule_tmp.rule.rule.flags = 1; @@ -1472,10 +1472,10 @@ static int add_rule(struct udev_rules *rules, char *line, gid = strtoul(value, &endptr, 10); if (endptr[0] == '\0') { rule_add_key(&rule_tmp, TK_A_GROUP_ID, op, NULL, &gid); - } else if (rules->resolve_names && strchr("$%", value[0]) == NULL) { + } else if ((rules->resolve_names > 0) && strchr("$%", value[0]) == NULL) { gid = add_gid(rules, value); rule_add_key(&rule_tmp, TK_A_GROUP_ID, op, NULL, &gid); - } else { + } else if (rules->resolve_names == 0) { rule_add_key(&rule_tmp, TK_A_GROUP, op, value, NULL); } rule_tmp.rule.rule.flags = 1; |