summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-06-02 10:02:32 +0200
committerKay Sievers <kay.sievers@vrfy.org>2007-06-02 10:02:32 +0200
commitf7e34eb3e7e8c84cb7ce55ad64e4813e7985936a (patch)
treefd67f6b1d9f4fbc25d4dd745fa0e6f071b8c87f1
parent4722274ca048e245fe017b8ca6f776b45cfc4ead (diff)
events for "bus" and "class" registration must be matched as "subsystem"
-rw-r--r--udev_rules_parse.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/udev_rules_parse.c b/udev_rules_parse.c
index 02bddbd0a8..9166980488 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;
}