diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2021-02-15 15:20:18 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-15 15:20:18 -0500 |
| commit | a6d1b6a04311bb2f49b9e05cd678ca48bf99ef8c (patch) | |
| tree | 7a11daffe0704c337da265c90d2070534afee201 /lib/privs.c | |
| parent | 54c7adbf49e7466e46c91a749fdf0aa31882d937 (diff) | |
| parent | e0a5979d58c39b6a173052867f4f44e9b85bd1c3 (diff) | |
Merge pull request #8075 from opensourcerouting/assorted-20210212
lib: bunch of random small fixes
Diffstat (limited to 'lib/privs.c')
| -rw-r--r-- | lib/privs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/privs.c b/lib/privs.c index 1bb5d059c8..5ca3c0d886 100644 --- a/lib/privs.c +++ b/lib/privs.c @@ -587,6 +587,8 @@ void zprivs_preinit(struct zebra_privs_t *zprivs) } } +struct zebra_privs_t *lib_privs; + void zprivs_init(struct zebra_privs_t *zprivs) { gid_t groups[NGROUPS_MAX] = {}; @@ -598,6 +600,8 @@ void zprivs_init(struct zebra_privs_t *zprivs) || zprivs->cap_num_i)) return; + lib_privs = zprivs; + if (zprivs->user) { ngroups = array_size(groups); if (getgrouplist(zprivs->user, zprivs_state.zgid, groups, @@ -701,6 +705,8 @@ void zprivs_terminate(struct zebra_privs_t *zprivs) { struct zebra_privs_refs_t *refs; + lib_privs = NULL; + if (!zprivs) { fprintf(stderr, "%s: no privs struct given, terminating", __func__); |
