summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/do_command.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2011-03-03 15:08:14 +0000
committermillert <millert@openbsd.org>2011-03-03 15:08:14 +0000
commit8b18fb302830cfe8d7e516c4610252b8a97d368f (patch)
treee35a700887f36bbb96273881cb0d63ef672843a1 /usr.sbin/cron/do_command.c
parentUse dirfd() instead of peeking into struct dirent for dd_fd, which is (diff)
downloadwireguard-openbsd-8b18fb302830cfe8d7e516c4610252b8a97d368f.tar.xz
wireguard-openbsd-8b18fb302830cfe8d7e516c4610252b8a97d368f.zip
Reset the SIGPIPE signal handler immediately before executing a command.
We ignore it by default so cron doesn't die if sendmail is missing or exits prematurely but the actual command being run should have the default handler installed.
Diffstat (limited to 'usr.sbin/cron/do_command.c')
-rw-r--r--usr.sbin/cron/do_command.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/cron/do_command.c b/usr.sbin/cron/do_command.c
index f6f3e97c3da..b272e5ccc6b 100644
--- a/usr.sbin/cron/do_command.c
+++ b/usr.sbin/cron/do_command.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: do_command.c,v 1.34 2010/12/14 23:32:06 millert Exp $ */
+/* $OpenBSD: do_command.c,v 1.35 2011/03/03 15:08:14 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
@@ -247,6 +247,8 @@ child_process(entry *e, user *u) {
#endif /* LOGIN_CAP */
chdir(env_get("HOME", e->envp));
+ (void) signal(SIGPIPE, SIG_DFL);
+
/*
* Exec the command.
*/