On Fri, Aug 29, 2014 at 11:25:52PM +0200, Alexander Bluhm wrote:
> try to pull parts of the diff into separate changes to make review
> easier.

Also in debug mode, close nullfd when it is not needed anymore.

ok?

bluhm

Index: usr.sbin/syslogd/privsep.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/privsep.c,v
retrieving revision 1.45
diff -u -p -u -p -r1.45 privsep.c
--- usr.sbin/syslogd/privsep.c  10 Sep 2014 13:16:20 -0000      1.45
+++ usr.sbin/syslogd/privsep.c  25 Sep 2014 14:43:40 -0000
@@ -153,7 +153,6 @@ priv_init(char *conf, int numeric, int l
                dup2(nullfd, STDOUT_FILENO);
                dup2(nullfd, STDERR_FILENO);
        }
-
        if (nullfd > 2)
                close(nullfd);
 
Index: usr.sbin/syslogd/syslogd.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.124
diff -u -p -u -p -r1.124 syslogd.c
--- usr.sbin/syslogd/syslogd.c  10 Sep 2014 13:16:20 -0000      1.124
+++ usr.sbin/syslogd/syslogd.c  25 Sep 2014 14:43:40 -0000
@@ -539,10 +539,10 @@ main(int argc, char *argv[])
                dup2(nullfd, STDIN_FILENO);
                dup2(nullfd, STDOUT_FILENO);
                dup2(nullfd, STDERR_FILENO);
-               if (nullfd > 2)
-                       close(nullfd);
                close(lockpipe[1]);
        }
+       if (nullfd > 2)
+               close(nullfd);
 
        /*
         * Signal to the priv process that the initial config parsing is done

Reply via email to