chiark / gitweb /
IMPORT allow to import program returned keys into the env
[elogind.git] / udev_rules_parse.c
index 36bf97177db4172be9f648f18d1c36195a0a6d5e..4979feddc1da4d264fad75c70cf3cf8c708d0a7b 100644 (file)
@@ -375,6 +375,18 @@ static int rules_parse(const char *filename)
                                continue;
                        }
 
+                       if (strncasecmp(key, KEY_IMPORT, sizeof(KEY_IMPORT)-1) == 0) {
+                               attr = get_key_attribute(key + sizeof(KEY_IMPORT)-1);
+                               if (attr && strstr(attr, "exec")) {
+                                       dbg(KEY_IMPORT" will be executed");
+                                       rule.import_exec = 1;
+                               }
+                               strlcpy(rule.import, value, sizeof(rule.import));
+                               rule.import_operation = operation;
+                               valid = 1;
+                               continue;
+                       }
+
                        if (strcasecmp(key, KEY_DRIVER) == 0) {
                                strlcpy(rule.driver, value, sizeof(rule.driver));
                                rule.driver_operation = operation;
@@ -404,7 +416,6 @@ static int rules_parse(const char *filename)
                                                dbg("creation of partition nodes requested");
                                                rule.partitions = DEFAULT_PARTITIONS_COUNT;
                                        }
-                                       /* FIXME: remove old style option and make OPTIONS= mandatory */
                                        if (strstr(attr, OPTION_IGNORE_REMOVE) != NULL) {
                                                dbg("remove event should be ignored");
                                                rule.ignore_remove = 1;