summaryrefslogtreecommitdiffstats
path: root/src/privsep.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-09-05 16:12:30 +0100
committerRoy Marples <roy@marples.name>2020-09-05 16:12:30 +0100
commit08d8151c559851a6e805e6e6341875f40e892a48 (patch)
tree9d449557fcd0178a0c144f59b32674799fcadecf /src/privsep.c
parentf377b643a9f4fdea14c381f462f9d80650fcccc7 (diff)
downloaddhcpcd-08d8151c559851a6e805e6e6341875f40e892a48.tar.xz
privsep: Use xsocketpair
Diffstat (limited to 'src/privsep.c')
-rw-r--r--src/privsep.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/privsep.c b/src/privsep.c
index aa5cd9ab..14760e6e 100644
--- a/src/privsep.c
+++ b/src/privsep.c
@@ -284,12 +284,10 @@ ps_dostart(struct dhcpcd_ctx *ctx,
void *recv_ctx, int (*callback)(void *), void (*signal_cb)(int, void *),
unsigned int flags)
{
- int stype;
int fd[2];
pid_t pid;
- stype = SOCK_CLOEXEC | SOCK_NONBLOCK;
- if (socketpair(AF_UNIX, SOCK_DGRAM | stype, 0, fd) == -1) {
+ if (xsocketpair(AF_UNIX, SOCK_DGRAM | SOCK_CXNB, 0, fd) == -1) {
logerr("%s: socketpair", __func__);
return -1;
}
@@ -297,12 +295,6 @@ ps_dostart(struct dhcpcd_ctx *ctx,
logerr("%s: ps_setbuf_fdpair", __func__);
return -1;
}
-#ifdef PRIVSEP_RIGHTS
- if (ps_rights_limit_fdpair(fd) == -1) {
- logerr("%s: ps_rights_limit_fdpair", __func__);
- return -1;
- }
-#endif
switch (pid = fork()) {
case -1: