From: Roy Marples Date: Wed, 8 Jan 2020 20:32:15 +0000 (+0000) Subject: privsep: If the privsep user does not exist, reset errno X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=632d60f6593a98cb2beefd56d5b1bbf290b194f0;p=thirdparty%2Fdhcpcd.git privsep: If the privsep user does not exist, reset errno Incase logerrx sets it.... Now we work on musl! --- diff --git a/src/privsep.c b/src/privsep.c index 3eee0f48..e0df47db 100644 --- a/src/privsep.c +++ b/src/privsep.c @@ -86,8 +86,11 @@ ps_dostart(struct dhcpcd_ctx *ctx, if ((pw = getpwnam(PRIVSEP_USER)) == NULL) { ctx->options &= ~DHCPCD_PRIVSEP; if (errno == 0) { - if (ctx == recv_ctx) /* Only log the once. */ + if (ctx == recv_ctx) { /* Only log the once. */ logerrx("no such user %s", PRIVSEP_USER); + /* Just incase logerrx caused an error... */ + errno = 0; + } } else logerr("getpwnam"); return -1;