changeset 4949:a8410b82249b draft

privsep: If the privsep user does not exist, reset errno Incase logerrx sets it.... Now we work on musl!
author Roy Marples <roy@marples.name>
date Wed, 08 Jan 2020 20:32:15 +0000
parents b664b38faf10
children ba9558e22e1c
files src/privsep.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/privsep.c	Wed Jan 08 20:13:20 2020 +0000
+++ b/src/privsep.c	Wed Jan 08 20:32:15 2020 +0000
@@ -86,8 +86,11 @@
 	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;