chiark / gitweb /
encode db-file names, instead of just replacing '/'
[elogind.git] / udev_rules_parse.c
index 3f7e43f83943f9807dab969e9277fd981814e121..5ce91df383dfdb5c924b7008549b6d7b8679d70c 100644 (file)
@@ -104,12 +104,9 @@ static int get_key(char **line, char **key, enum key_operation *operation, char
                        break;
                if (linepos[0] == '=')
                        break;
-               if (linepos[0] == '+')
-                       break;
-               if (linepos[0] == '!')
-                       break;
-               if (linepos[0] == ':')
-                       break;
+               if ((linepos[0] == '+') || (linepos[0] == '!') || (linepos[0] == ':'))
+                       if (linepos[1] == '=')
+                               break;
        }
 
        /* remember end of key */
@@ -312,10 +309,7 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                                err("invalid DRIVER operation");
                                goto invalid;
                        }
-                       err("DRIVER== will change in a future relase, "
-                           "please use DRIVERS== in %s:%u", filename, lineno);
-                       /* FIXME: this should be rule->driver to match only the event device */
-                       add_rule_key(rule, &rule->drivers, operation, value);
+                       add_rule_key(rule, &rule->driver, operation, value);
                        valid = 1;
                        continue;
                }
@@ -369,6 +363,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
 
                if (strncasecmp(key, "ATTRS{", sizeof("ATTRS{")-1) == 0 ||
                    strncasecmp(key, "SYSFS{", sizeof("SYSFS{")-1) == 0) {
+                       if (operation != KEY_OP_MATCH &&
+                           operation != KEY_OP_NOMATCH) {
+                               err("invalid ATTRS operation");
+                               goto invalid;
+                       }
                        attr = get_key_attribute(key + sizeof("ATTRS")-1);
                        if (attr == NULL) {
                                err("error parsing ATTRS attribute");