From a506e6298cffed4576f9cea8df15b2f8945fc731 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 29 Aug 2007 22:19:28 +0200 Subject: print warning for invalid TEST operations --- udev_rules_parse.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'udev_rules_parse.c') diff --git a/udev_rules_parse.c b/udev_rules_parse.c index 3afc31a0fa..9e435819f0 100644 --- a/udev_rules_parse.c +++ b/udev_rules_parse.c @@ -469,6 +469,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena } if (strncasecmp(key, "TEST", sizeof("TEST")-1) == 0) { + if (operation != KEY_OP_MATCH && + operation != KEY_OP_NOMATCH) { + err("invalid TEST operation"); + goto invalid; + } attr = get_key_attribute(key + sizeof("TEST")-1); if (attr != NULL) rule->test_mode_mask = strtol(attr, NULL, 8); -- cgit v1.2.3-54-g00ecf