X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udev_rules_parse.c;h=bfbad367e9d41e4dfda8f806e5b737c08099bb3c;hp=00b53285faf7796bce19e14d1b792a376955046b;hb=c19870519d0a23bbf7f5cf206cefab6418a9f4be;hpb=273bebdba66cd5543dc1b076447e3275c81c221c diff --git a/udev_rules_parse.c b/udev_rules_parse.c index 00b53285f..bfbad367e 100644 --- a/udev_rules_parse.c +++ b/udev_rules_parse.c @@ -104,12 +104,9 @@ static int get_key(char **line, char **key, enum key_operation *operation, char break; if (linepos[0] == '=') break; - if (linepos[0] == '+') - break; - if (linepos[0] == '!') - break; - if (linepos[0] == ':') - break; + if ((linepos[0] == '+') || (linepos[0] == '!') || (linepos[0] == ':')) + if (linepos[1] == '=') + break; } /* remember end of key */ @@ -307,6 +304,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena } if (strcasecmp(key, "DRIVER") == 0) { + if (operation != KEY_OP_MATCH && + operation != KEY_OP_NOMATCH) { + err("invalid DRIVER operation"); + goto invalid; + } add_rule_key(rule, &rule->driver, operation, value); valid = 1; continue; @@ -553,6 +555,8 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena } if (strcasecmp(key, "OPTIONS") == 0) { + const char *pos; + if (strstr(value, "last_rule") != NULL) { dbg("last rule to be applied"); rule->last_rule = 1; @@ -565,6 +569,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena dbg("remove event should be ignored"); rule->ignore_remove = 1; } + pos = strstr(value, "link_priority="); + if (pos != NULL) { + rule->link_priority = atoi(&pos[strlen("link_priority=")]); + info("link priority=%i", rule->link_priority); + } if (strstr(value, "all_partitions") != NULL) { dbg("creation of partition nodes requested"); rule->partitions = DEFAULT_PARTITIONS_COUNT;