diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2011-03-03 15:08:15 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2011-03-03 15:08:15 +0000 |
commit | 355a7273007253dcbdb3a176d169e597ca5e43e6 (patch) | |
tree | d5db7a16b806e4172be46882bdf222684c7c7e82 /usr.sbin | |
parent | bebcfdfbe36b040bac029d81372fc92e34bdaf6c (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')
-rw-r--r-- | usr.sbin/cron/atrun.c | 4 | ||||
-rw-r--r-- | usr.sbin/cron/do_command.c | 4 |
2 files changed, 6 insertions, 2 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. 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. */ |