Re: close cron sockets in child processes

2017-10-23 Thread Jeremie Courreges-Anglas
On Mon, Oct 23 2017, "Todd C. Miller" wrote: > On Mon, 23 Oct 2017 17:27:15 +0200, Jeremie Courreges-Anglas wrote: > >> Here it is. Liberal use of O_CLOEXEC except for poke_daemon() which is >> more obvious (but I can add it there too if you prefer). cronSock >> already uses SOCK_CLOEXEC. > > Yo

Re: close cron sockets in child processes

2017-10-23 Thread Jeremie Courreges-Anglas
On Mon, Oct 23 2017, Jeremie Courreges-Anglas wrote: > On Mon, Oct 23 2017, "Todd C. Miller" wrote: >> On Mon, 23 Oct 2017 09:05:48 +0200, Jeremie Courreges-Anglas wrote: >> >>> That doesn't work. When here, we hold cronSock and dfd (should be 3 and >>> 4). We need dfd to get fd (should be 5),

Re: close cron sockets in child processes

2017-10-23 Thread Todd C. Miller
On Mon, 23 Oct 2017 17:27:15 +0200, Jeremie Courreges-Anglas wrote: > Here it is. Liberal use of O_CLOEXEC except for poke_daemon() which is > more obvious (but I can add it there too if you prefer). cronSock > already uses SOCK_CLOEXEC. You can't set O_CLOEXEC for the fd in atrun.c as that wil

Re: close cron sockets in child processes

2017-10-23 Thread Jeremie Courreges-Anglas
On Mon, Oct 23 2017, "Todd C. Miller" wrote: > On Mon, 23 Oct 2017 09:05:48 +0200, Jeremie Courreges-Anglas wrote: > >> That doesn't work. When here, we hold cronSock and dfd (should be 3 and >> 4). We need dfd to get fd (should be 5), thus we can't just use >> "closefrom(3)". The straightest w

Re: close cron sockets in child processes

2017-10-23 Thread Todd C. Miller
On Mon, 23 Oct 2017 09:05:48 +0200, Jeremie Courreges-Anglas wrote: > That doesn't work. When here, we hold cronSock and dfd (should be 3 and > 4). We need dfd to get fd (should be 5), thus we can't just use > "closefrom(3)". The straightest way IMO is to close what we should > close (including

Re: close cron sockets in child processes

2017-10-23 Thread Florian Riehm
On 10/23/17 09:05, Jeremie Courreges-Anglas wrote: On Fri, Oct 20 2017, "Todd C. Miller" wrote: On Fri, 20 Oct 2017 16:25:32 +0200, Florian Riehm wrote: cron(8) opens /var/run/cron.sock for communication with crontab(1). The forked cronjobs have the socked still open. This prevents restarting

Re: close cron sockets in child processes

2017-10-23 Thread Jeremie Courreges-Anglas
On Fri, Oct 20 2017, "Todd C. Miller" wrote: > On Fri, 20 Oct 2017 16:25:32 +0200, Florian Riehm wrote: > >> cron(8) opens /var/run/cron.sock for communication with crontab(1). >> The forked cronjobs have the socked still open. >> This prevents restarting cron while a job is running: >> (CRON) DEA

Re: close cron sockets in child processes

2017-10-20 Thread Todd C. Miller
On Fri, 20 Oct 2017 16:25:32 +0200, Florian Riehm wrote: > cron(8) opens /var/run/cron.sock for communication with crontab(1). > The forked cronjobs have the socked still open. > This prevents restarting cron while a job is running: > (CRON) DEATH (already running) > > I think cron's children sho

Re: close cron sockets in child processes

2017-10-20 Thread Jeremie Courreges-Anglas
On Fri, Oct 20 2017, Florian Riehm wrote: > Hi, > > cron(8) opens /var/run/cron.sock for communication with crontab(1). > The forked cronjobs have the socked still open. > This prevents restarting cron while a job is running: > (CRON) DEATH (already running) Hah. > I think cron's children should

close cron sockets in child processes

2017-10-20 Thread Florian Riehm
Hi, cron(8) opens /var/run/cron.sock for communication with crontab(1). The forked cronjobs have the socked still open. This prevents restarting cron while a job is running: (CRON) DEATH (already running) I think cron's children should not inherit sockets. ok? friehm Index: usr.sbin/cron/do_c