X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udev_rules_parse.c;h=6bb83ae12b9366a0837f649c4042f884500287e7;hp=4fcd6db08ee362bec4233683df6143956baa1364;hb=bf289c06bff4e7780b044673fd66a17e510de43e;hpb=1aa1e24848903d11780db1ade355be73ad61a937 diff --git a/udev_rules_parse.c b/udev_rules_parse.c index 4fcd6db08..6bb83ae12 100644 --- a/udev_rules_parse.c +++ b/udev_rules_parse.c @@ -366,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)"); @@ -411,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; }