diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-12-03 18:55:51 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-12-03 18:55:51 +0100 |
commit | aab4c0eebef44c5b67d4c9537f1c5149de3ca9c2 (patch) | |
tree | 345d38c4194c2d3dc6114bc1364ec07b40fdb2f3 /udev_utils_run.c | |
parent | 6acd81c8981a5f0ea80e3cdef2a10e5d595bbae3 (diff) |
allow programs in /lib/udev called without the path
RUN="firmware.sh" should work like RUN="/lib/udev/firmware.sh"
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_utils_run.c')
-rw-r--r-- | udev_utils_run.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/udev_utils_run.c b/udev_utils_run.c index 20aaa4ab05..e1e775ebe6 100644 --- a/udev_utils_run.c +++ b/udev_utils_run.c @@ -82,6 +82,7 @@ int run_program(const char *command, const char *subsystem, int errpipe[2] = {-1, -1}; pid_t pid; char arg[PATH_SIZE]; + char program[PATH_SIZE]; char *argv[(sizeof(arg) / 2) + 1]; int devnull; int i; @@ -126,6 +127,13 @@ int run_program(const char *command, const char *subsystem, } } + /* allow programs in /lib/udev called without the path */ + if (strchr(argv[0], '/') == NULL) { + strlcpy(program, "/lib/udev/", sizeof(program)); + strlcat(program, argv[0], sizeof(program)); + argv[0] = program; + } + pid = fork(); switch(pid) { case 0: |