diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-10-23 15:15:23 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-10-23 15:15:23 +0000 |
commit | 427b3e34a2cf05064f11372bc41ba1d72687f291 (patch) | |
tree | 86ada348bf0d50b0e88908a5b345ef092b148dd6 /usr.sbin/cron/atrun.c | |
parent | 8dfafb1a51ce47117fce58dfa86068454c0dd324 (diff) |
Close the socket (and dfd) in at(1) child processes
Fixes a failure at restart if a child process still has the socket
opened. Spotted by millert@, ok friehm@ millert@
Diffstat (limited to 'usr.sbin/cron/atrun.c')
-rw-r--r-- | usr.sbin/cron/atrun.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/cron/atrun.c b/usr.sbin/cron/atrun.c index 6f08809a341..bc2e3098bad 100644 --- a/usr.sbin/cron/atrun.c +++ b/usr.sbin/cron/atrun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atrun.c,v 1.46 2017/06/08 16:23:39 millert Exp $ */ +/* $OpenBSD: atrun.c,v 1.47 2017/10/23 15:15:22 jca Exp $ */ /* * Copyright (c) 2002-2003 Todd C. Miller <Todd.Miller@courtesan.com> @@ -283,6 +283,10 @@ run_job(const atjob *job, int dfd, const char *atfile) return; } + /* Close fds opened by the parent. */ + close(cronSock); + close(dfd); + /* * We don't want the main cron daemon to wait for our children-- * we will do it ourselves via waitpid(). |