chiark / gitweb /
fix spelling error in debug string
[elogind.git] / udev_rules_parse.c
index 7fa21afa8c17264fc14f5cac7d773b06a4d77bdd..6bb83ae12b9366a0837f649c4042f884500287e7 100644 (file)
 #include <sys/stat.h>
 #include <errno.h>
 
-#include "udev_libc_wrapper.h"
 #include "udev.h"
-#include "udev_utils.h"
-#include "logging.h"
 #include "udev_rules.h"
 
 
@@ -369,6 +366,16 @@ static int add_to_rules(struct udev_rules *rules, char *line)
                                pos = strchr(file, ' ');
                                if (pos)
                                        pos[0] = '\0';
+
+                               /* allow programs in /lib/udev called without the path */
+                               if (strchr(file, '/') == NULL) {
+                                       strlcpy(file, "/lib/udev/", sizeof(file));
+                                       strlcat(file, value, sizeof(file));
+                                       pos = strchr(file, ' ');
+                                       if (pos)
+                                               pos[0] = '\0';
+                               }
+
                                dbg("IMPORT auto mode for '%s'", file);
                                if (!lstat(file, &stats) && (stats.st_mode & S_IXUSR)) {
                                        dbg("IMPORT is executable, will be executed (autotype)");
@@ -414,7 +421,7 @@ static int add_to_rules(struct udev_rules *rules, char *line)
                                }
                        }
                        if (value[0] == '\0')
-                               dbg("name empty, not creation supressed");
+                               dbg("name empty, node creation supressed");
                        add_rule_key(rule, &rule->name, operation, value);
                        continue;
                }
@@ -626,7 +633,7 @@ int udev_rules_init(struct udev_rules *rules, int resolve_names)
        return retval;
 }
 
-void udev_rules_close(struct udev_rules *rules)
+void udev_rules_cleanup(struct udev_rules *rules)
 {
        if (rules->buf) {
                free(rules->buf);