]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: If the privsep user does not exist, reset errno
authorRoy Marples <roy@marples.name>
Wed, 8 Jan 2020 20:32:15 +0000 (20:32 +0000)
committerRoy Marples <roy@marples.name>
Wed, 8 Jan 2020 20:32:15 +0000 (20:32 +0000)
Incase logerrx sets it....
Now we work on musl!

src/privsep.c

index 3eee0f48a2c3b1e263fa5ab5e396fccf74e741d8..e0df47dbc26addbb1bf6336bd396078dfbfc4dbc 100644 (file)
@@ -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;