freebsd-dev/cmd/zed
Chris Dunlap 048bb5bd49 Ensure zed _finish_daemonize() leaves fds 0-2 open
In zed's _finish_daemonize(), /dev/null is open()d onto a temporary
file descriptor which is then dup()d onto stdin, stdout, and stderr.
But if file descriptors 0, 1, or 2 are not already open at the start
of this function, then the temporary file descriptor will fall within
this range and be inadvertently closed when the function cleans up.

This commit adds a check to prevent inadvertently closing this
(presumably temporary) file descriptor when it shouldn't.

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4384
2016-03-08 17:46:41 -08:00
..
zed.d Rework zed_notify_email for configurable PROG/OPTS 2015-07-30 11:52:56 -07:00
.gitignore
Makefile.am Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
zed_conf.c Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_conf.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_event.c Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_event.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_exec.c Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_exec.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_file.c Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_file.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_log.c Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_log.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_strings.c Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_strings.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed.c Ensure zed _finish_daemonize() leaves fds 0-2 open 2016-03-08 17:46:41 -08:00
zed.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00