From: Kay Sievers Date: Sat, 2 Jun 2007 08:02:32 +0000 (+0200) Subject: events for "bus" and "class" registration must be matched as "subsystem" X-Git-Tag: 174~1921 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7e34eb3e7e8c84cb7ce55ad64e4813e7985936a;p=systemd events for "bus" and "class" registration must be matched as "subsystem" --- diff --git a/udev_rules_parse.c b/udev_rules_parse.c index 02bddbd0..91669804 100644 --- a/udev_rules_parse.c +++ b/udev_rules_parse.c @@ -298,7 +298,16 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena err("invalid SUBSYSTEM operation"); goto invalid; } - add_rule_key(rule, &rule->subsystem, operation, value); + /* bus, class, subsystem events should all be the same */ + if (strcmp(value, "subsystem") == 0 || + strcmp(value, "bus") == 0 || + strcmp(value, "class") == 0) { + if (strcmp(value, "bus") == 0 || strcmp(value, "class") == 0) + err("'%s' must be specified as 'subsystem' " + "please fix it in %s:%u", value, filename, lineno); + add_rule_key(rule, &rule->subsystem, operation, "subsystem|class|bus"); + } else + add_rule_key(rule, &rule->subsystem, operation, value); valid = 1; continue; }