]> err.no Git - systemd/commitdiff
events for "bus" and "class" registration must be matched as "subsystem"
authorKay Sievers <kay.sievers@vrfy.org>
Sat, 2 Jun 2007 08:02:32 +0000 (10:02 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Sat, 2 Jun 2007 08:02:32 +0000 (10:02 +0200)
udev_rules_parse.c

index 02bddbd0a89c6fc9b041d608bcd6a6c7cc032cf6..9166980488fa0362fe8316753dd11fb0d278f35f 100644 (file)
@@ -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;
                }