diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2010-05-12 08:46:56 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2010-05-12 08:46:56 +0200 |
commit | e85f5ec15f1c0a820cc81b422c2fa157d9805896 (patch) | |
tree | 50b5135d077fb8b02377a955acfd91aad5497154 /libudev | |
parent | 1ecfdba0ddfb09a7e5c463466a2c0b1e9176c458 (diff) |
reset process priority before executing RUN+=
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581235
Diffstat (limited to 'libudev')
-rw-r--r-- | libudev/libudev-private.h | 2 | ||||
-rw-r--r-- | libudev/libudev-util-private.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h index 7132357ac2..3758c5b1b4 100644 --- a/libudev/libudev-private.h +++ b/libudev/libudev-private.h @@ -217,7 +217,7 @@ uid_t util_lookup_user(struct udev *udev, const char *user); gid_t util_lookup_group(struct udev *udev, const char *group); int util_run_program(struct udev *udev, const char *command, char **envp, char *result, size_t ressize, size_t *reslen, - const sigset_t *sigmask); + const sigset_t *sigmask, bool reset_prio); int util_resolve_subsys_kernel(struct udev *udev, const char *string, char *result, size_t maxsize, int read_value); diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c index c05c157575..8c535125a8 100644 --- a/libudev/libudev-util-private.c +++ b/libudev/libudev-util-private.c @@ -254,7 +254,7 @@ int util_resolve_subsys_kernel(struct udev *udev, const char *string, int util_run_program(struct udev *udev, const char *command, char **envp, char *result, size_t ressize, size_t *reslen, - const sigset_t *sigmask) + const sigset_t *sigmask, bool reset_prio) { int status; int outpipe[2] = {-1, -1}; @@ -349,6 +349,8 @@ int util_run_program(struct udev *udev, const char *command, char **envp, if (sigmask) sigprocmask(SIG_SETMASK, sigmask, NULL); + if (reset_prio) + setpriority(PRIO_PROCESS, 0, 0); execve(argv[0], argv, envp); if (errno == ENOENT || errno == ENOTDIR) { |