]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: Set buffer sizes before setting rights.
authorRoy Marples <roy@marples.name>
Thu, 4 Jun 2020 11:22:40 +0000 (12:22 +0100)
committerRoy Marples <roy@marples.name>
Thu, 4 Jun 2020 11:22:40 +0000 (12:22 +0100)
src/privsep.c

index e2f3f3cde3ab20991eebbd4d0e7449fa4c78105d..21c280472fa3016832687d06200adac267408513 100644 (file)
@@ -201,6 +201,7 @@ ps_dostart(struct dhcpcd_ctx *ctx,
                *priv_pid = pid;
                *priv_fd = fd[0];
                close(fd[1]);
+               ps_setbuf(*priv_fd);
                if (recv_unpriv_msg == NULL)
                        ;
 #ifdef HAVE_CAPSICUM
@@ -217,7 +218,6 @@ ps_dostart(struct dhcpcd_ctx *ctx,
                        logerr("%s: eloop_event_add", __func__);
                        return -1;
                }
-               ps_setbuf(*priv_fd);
                return pid;
        }