Re: cron: don't close crontab_fd twice

2018-02-04 Thread Theo Buehler
On Sun, Feb 04, 2018 at 07:19:57PM -0700, Todd C. Miller wrote: > On Mon, 05 Feb 2018 09:21:32 +1300, Theo Buehler wrote: > > > The load_user() function gets a file descriptor from process_crontab(). > > It fdopen()s it directly and fclose()s the resulting stream. Then > > process_crontab()

Re: cron: don't close crontab_fd twice

2018-02-04 Thread Todd C. Miller
On Mon, 05 Feb 2018 09:21:32 +1300, Theo Buehler wrote: > The load_user() function gets a file descriptor from process_crontab(). > It fdopen()s it directly and fclose()s the resulting stream. Then > process_crontab() closes the stream a second time before exiting. > > Since crontab_fd is not

cron: don't close crontab_fd twice

2018-02-04 Thread Theo Buehler
The load_user() function gets a file descriptor from process_crontab(). It fdopen()s it directly and fclose()s the resulting stream. Then process_crontab() closes the stream a second time before exiting. Since crontab_fd is not load_user()'s descriptor, let's dup it before opening the stream.