diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-06-01 18:33:08 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-08-02 23:36:39 +0200 |
| commit | 37a1f2fbb6e05053098a5f1af5eff16ac523dd35 (patch) | |
| tree | 537022bb34cb3c92d2ae2d6c131f12d46190fdf5 /lib/libfrr.c | |
| parent | 154b9e8f9f08f5be2d3d84f7565e3ce7921b8b35 (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 'lib/libfrr.c')
| -rw-r--r-- | lib/libfrr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c index d168d83053..e0bba297e0 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -347,6 +347,8 @@ struct thread_master *frr_init(void) snprintf(frr_protonameinst, sizeof(frr_protonameinst), "%s[%u]", di->logname, di->instance); + zprivs_preinit(di->privs); + openzlog(di->progname, di->logname, di->instance, LOG_CONS | LOG_NDELAY | LOG_PID, LOG_DAEMON); #if defined(HAVE_CUMULUS) |
