From: Roy Marples Date: Wed, 8 Jan 2020 16:57:46 +0000 (+0000) Subject: Linux: privsep write uint to path needs to read the resultant error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c55279517dc3df6743100c5e525d464010f563c6;p=thirdparty%2Fdhcpcd.git Linux: privsep write uint to path needs to read the resultant error Otherwise it hangs around and provides bogus errors to the next caller of root processes. --- diff --git a/src/privsep-linux.c b/src/privsep-linux.c index 0bcd9275..375d4d4a 100644 --- a/src/privsep-linux.c +++ b/src/privsep-linux.c @@ -137,5 +137,8 @@ ps_root_writepathuint(struct dhcpcd_ctx *ctx, const char *path, p += plen; memcpy(p, &val, sizeof(val)); - return ps_sendcmd(ctx, ctx->ps_root_fd, PS_WRITEPATHUINT, 0, buf, len); + if (ps_sendcmd(ctx, ctx->ps_root_fd, PS_WRITEPATHUINT, + 0, buf, len) == -1) + return -1; + return ps_root_readerror(ctx); }