]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Linux: privsep write uint to path needs to read the resultant error
authorRoy Marples <roy@marples.name>
Wed, 8 Jan 2020 16:57:46 +0000 (16:57 +0000)
committerRoy Marples <roy@marples.name>
Wed, 8 Jan 2020 16:57:46 +0000 (16:57 +0000)
Otherwise it hangs around and provides bogus errors to the next
caller of root processes.

src/privsep-linux.c

index 0bcd927535ddc3eb679cf1a75df3acf834e8a7fd..375d4d4af2a5ce11a0da3d4d4163869c35f754d9 100644 (file)
@@ -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);
 }