summaryrefslogtreecommitdiff
path: root/ldpd/ldpe.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-06-01 18:33:08 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-08-02 23:36:39 +0200
commit37a1f2fbb6e05053098a5f1af5eff16ac523dd35 (patch)
tree537022bb34cb3c92d2ae2d6c131f12d46190fdf5 /ldpd/ldpe.c
parent154b9e8f9f08f5be2d3d84f7565e3ce7921b8b35 (diff)
lib: privs: make uid/gid accessible before setuid
This splits off privs_preinit(), which does the lookups for user and group IDs. This is so the init code can create state directories while still running as root. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ldpd/ldpe.c')
-rw-r--r--ldpd/ldpe.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c
index b2f9fdce55..1c0a8bdc84 100644
--- a/ldpd/ldpe.c
+++ b/ldpd/ldpe.c
@@ -142,6 +142,7 @@ ldpe_init(struct ldpd_init *init)
/* drop privileges */
ldpe_privs.user = init->user;
ldpe_privs.group = init->group;
+ zprivs_preinit(&ldpe_privs);
zprivs_init(&ldpe_privs);
/* listen on ldpd control socket */