chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
find programs in /lib/udev for IMPORT if {program} is not given
[elogind.git]
/
udev_rules_parse.c
diff --git
a/udev_rules_parse.c
b/udev_rules_parse.c
index 4fcd6db08ee362bec4233683df6143956baa1364..376006c7c4d4a6210d7047277dc45ef681dd8fc5 100644
(file)
--- 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';
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)");
dbg("IMPORT auto mode for '%s'", file);
if (!lstat(file, &stats) && (stats.st_mode & S_IXUSR)) {
dbg("IMPORT is executable, will be executed (autotype)");