X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fudev%2Fudev-rules.c;h=e4facd7bd2a435fd249d03b546f29fd43637a322;hb=e736cf3582c03273f95bc6f97245b04783fd626b;hp=fe4965feb9f38ee1301a6c3facf3773c7b25a2f4;hpb=490f0087627f441d5fece276ec86b64b5a9d6495;p=elogind.git diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index fe4965feb..e4facd7bd 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1066,8 +1066,15 @@ static int add_rule(struct udev_rules *rules, char *line, char *value; enum operation_type op; - if (get_key(rules->udev, &linepos, &key, &op, &value) != 0) + if (get_key(rules->udev, &linepos, &key, &op, &value) != 0) { + /* If we aren't at the end of the line, this is a parsing error. + * Make a best effort to describe where the problem is. */ + if (*linepos != '\n') + log_error("invalid key/value pair in file %s on line %u," + "starting at character %lu\n", + filename, lineno, linepos - line + 1); break; + } if (streq(key, "ACTION")) { if (op > OP_MATCH_MAX) { @@ -2586,6 +2593,10 @@ int udev_rules_apply_static_dev_perms(struct udev_rules *rules) } } + /* don't touch the permissions if only the tags were set */ + if (mode == 0 && uid == 0 && gid == 0) + goto next; + if (mode == 0) { if (gid > 0) mode = 0660;