changeset 4947:5d4046aa9571 draft

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.
author Roy Marples <roy@marples.name>
date Wed, 08 Jan 2020 16:57:46 +0000
parents c80386966f1f
children b664b38faf10
files src/privsep-linux.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/privsep-linux.c	Wed Jan 08 16:07:58 2020 +0000
+++ b/src/privsep-linux.c	Wed Jan 08 16:57:46 2020 +0000
@@ -137,5 +137,8 @@
 	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);
 }