chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
optimize SELinux path match
[elogind.git]
/
udev_utils_run.c
diff --git
a/udev_utils_run.c
b/udev_utils_run.c
index 20aaa4ab05e386951a8d445d592553c5786f725e..e1e775ebe6f2a5f03964aba8d5db86375a24d4bd 100644
(file)
--- 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];
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;
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:
pid = fork();
switch(pid) {
case 0: