chiark / gitweb /
find programs in /lib/udev for IMPORT if {program} is not given
authorKay Sievers <kay.sievers@suse.de>
Thu, 26 Jan 2006 02:59:13 +0000 (03:59 +0100)
committerKay Sievers <kay.sievers@suse.de>
Thu, 26 Jan 2006 02:59:13 +0000 (03:59 +0100)
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
udev_rules_parse.c

index 4fcd6db..376006c 100644 (file)
@@ -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)");