Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/external/bsd/dhcpcd/dist/src/privsep.c,v rcsdiff: /ftp/cvs/cvsroot/src/external/bsd/dhcpcd/dist/src/privsep.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.1.1.6 retrieving revision 1.1.1.7 diff -u -p -r1.1.1.6 -r1.1.1.7 --- src/external/bsd/dhcpcd/dist/src/privsep.c 2020/06/15 16:58:02 1.1.1.6 +++ src/external/bsd/dhcpcd/dist/src/privsep.c 2020/07/02 13:57:41 1.1.1.7 @@ -160,8 +160,9 @@ ps_dropprivs(struct dhcpcd_ctx *ctx) } /* Prohibit writing to files. - * Obviously this won't work if we are using a logfile. */ - if (ctx->logfile == NULL) { + * Obviously this won't work if we are using a logfile + * or redirecting stderr to a file. */ + if (ctx->logfile == NULL && isatty(loggeterrfd())) { if (setrlimit(RLIMIT_FSIZE, &rzero) == -1) logerr("setrlimit RLIMIT_FSIZE"); } @@ -365,13 +366,6 @@ ps_dostart(struct dhcpcd_ctx *ctx, if (callback(recv_ctx) == -1) goto errexit; - if (!(ctx->options & DHCPCD_DEBUG) && - (!(ctx->options & DHCPCD_TEST) || loggetopts() & LOGERR_QUIET)) - { - (void)freopen(_PATH_DEVNULL, "w", stdout); - (void)freopen(_PATH_DEVNULL, "w", stderr); - } - if (flags & PSF_DROPPRIVS) ps_dropprivs(ctx);