summaryrefslogtreecommitdiff
path: root/udev/udev-rules.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-09-05 17:48:23 +1000
committerKay Sievers <kay.sievers@vrfy.org>2009-09-07 12:13:50 +0200
commitd412a685736e3b3350b555f4d7d8ebfc80aa54c9 (patch)
tree6e49304c9c86a1db4711f1df8fcc4d6d4ca0344a /udev/udev-rules.c
parent9e6273c713c5a4b4317decca33d2fba830562ff2 (diff)
util_run_program: restore signal mask before executing event RUN commands
External programs triggered by events (via RUN=) will inherit udev's signal mask, which is set to block all but SIGALRM. For most utilities, this is OK, but if we start daemons from RUN=, we run into trouble (especially as SIGCHLD is blocked). This change saves the original sigmask when udev starts, and restores it just before we exec() the external command. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'udev/udev-rules.c')
-rw-r--r--udev/udev-rules.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index a92446403f..20ec2706bd 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -749,7 +749,7 @@ static int import_program_into_properties(struct udev_device *dev, const char *p
char *line;
envp = udev_device_get_properties_envp(dev);
- if (util_run_program(udev, program, envp, result, sizeof(result), &reslen) != 0)
+ if (util_run_program(udev, program, envp, result, sizeof(result), &reslen, NULL) != 0)
return -1;
line = result;
@@ -2206,7 +2206,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
program,
&rules->buf[rule->rule.filename_off],
rule->rule.filename_line);
- if (util_run_program(event->udev, program, envp, result, sizeof(result), NULL) != 0) {
+ if (util_run_program(event->udev, program, envp, result, sizeof(result), NULL, NULL) != 0) {
if (cur->key.op != OP_NOMATCH)
goto nomatch;
} else {