# HG changeset patch # User Roy Marples # Date 1602338858 -3600 # Node ID 93df3880bcaa5c02d6d21ee57c870f8b164363b8 # Parent adb3ad34082ffa132ce8aa9330d847f1191a777a privsep: Fix stderr redirection again diff -r adb3ad34082f -r 93df3880bcaa src/privsep.c --- a/src/privsep.c Sat Oct 10 15:06:59 2020 +0100 +++ b/src/privsep.c Sat Oct 10 15:07:38 2020 +0100 @@ -166,7 +166,9 @@ /* Prohibit writing to files. * Obviously this won't work if we are using a logfile * or redirecting stderr to a file. */ - if (ctx->logfile == NULL) { + if (ctx->logfile == NULL && + (ctx->options & DHCPCD_STARTED || isatty(STDERR_FILENO) == 1)) + { if (setrlimit(RLIMIT_FSIZE, &rzero) == -1) logerr("setrlimit RLIMIT_FSIZE"); }