summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron
diff options
context:
space:
mode:
authorfriehm <friehm@openbsd.org>2017-10-23 08:39:26 +0000
committerfriehm <friehm@openbsd.org>2017-10-23 08:39:26 +0000
commitd2c574e2f1522b4b6f9398a98a9f1a63b9702e5c (patch)
treee3c852b191f769362151a5eadc31bece457e2449 /usr.sbin/cron
parentRemove bcmmuart since it has already replaced with com(4). (diff)
downloadwireguard-openbsd-d2c574e2f1522b4b6f9398a98a9f1a63b9702e5c.tar.xz
wireguard-openbsd-d2c574e2f1522b4b6f9398a98a9f1a63b9702e5c.zip
Close cron sockets in child processes.
ok jca@
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r--usr.sbin/cron/do_command.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/cron/do_command.c b/usr.sbin/cron/do_command.c
index be9050b7c5a..6a4022fcc9a 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.56 2015/11/17 22:31:44 millert Exp $ */
+/* $OpenBSD: do_command.c,v 1.57 2017/10/23 08:39:26 friehm Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -86,6 +86,9 @@ child_process(entry *e, user *u)
/* mark ourselves as different to PS command watchers */
setproctitle("running job");
+ /* close sockets from parent (i.e. cronSock) */
+ closefrom(3);
+
/* discover some useful and important environment settings
*/
usernm = e->pwd->pw_name;