summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/atrun.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2011-03-03 15:08:15 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2011-03-03 15:08:15 +0000
commit355a7273007253dcbdb3a176d169e597ca5e43e6 (patch)
treed5db7a16b806e4172be46882bdf222684c7c7e82 /usr.sbin/cron/atrun.c
parentbebcfdfbe36b040bac029d81372fc92e34bdaf6c (diff)
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/atrun.c')
-rw-r--r--usr.sbin/cron/atrun.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/cron/atrun.c b/usr.sbin/cron/atrun.c
index bace65599f2..dca90304217 100644
--- a/usr.sbin/cron/atrun.c
+++ b/usr.sbin/cron/atrun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atrun.c,v 1.16 2009/10/27 23:59:51 deraadt Exp $ */
+/* $OpenBSD: atrun.c,v 1.17 2011/03/03 15:08:14 millert Exp $ */
/*
* Copyright (c) 2002-2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -489,6 +489,8 @@ run_job(atjob *job, char *atfile)
}
#endif /*DEBUGGING*/
+ (void) signal(SIGPIPE, SIG_DFL);
+
/*
* Exec /bin/sh with stdin connected to the at job file
* and stdout/stderr hooked up to our parent.