From f7e34eb3e7e8c84cb7ce55ad64e4813e7985936a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 2 Jun 2007 10:02:32 +0200 Subject: [PATCH] events for "bus" and "class" registration must be matched as "subsystem" --- udev_rules_parse.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; } -- 2.39.5