mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-31 07:51:08 +03:00
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>
This commit is contained in:
parent
6acd81c898
commit
aab4c0eebe
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user