mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 17:13:46 +00:00
Merge pull request #2520 from donaldsharp/privs_smivs
lib: Fix privs when using HAVE_CAPABILITIES
This commit is contained in:
commit
3a743cb7ec
13
lib/privs.c
13
lib/privs.c
@ -824,6 +824,19 @@ void zprivs_init(struct zebra_privs_t *zprivs)
|
|||||||
|
|
||||||
#ifdef HAVE_CAPABILITIES
|
#ifdef HAVE_CAPABILITIES
|
||||||
zprivs_caps_init(zprivs);
|
zprivs_caps_init(zprivs);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we have initialized the system with no requested
|
||||||
|
* capabilities, change will not have been set
|
||||||
|
* to anything by zprivs_caps_init, As such
|
||||||
|
* we should make sure that when we attempt
|
||||||
|
* to raize privileges that we actually have
|
||||||
|
* a do nothing function to call instead of a
|
||||||
|
* crash :).
|
||||||
|
*/
|
||||||
|
if (!zprivs->change)
|
||||||
|
zprivs->change = zprivs_change_null;
|
||||||
|
|
||||||
#else /* !HAVE_CAPABILITIES */
|
#else /* !HAVE_CAPABILITIES */
|
||||||
/* we dont have caps. we'll need to maintain rid and saved uid
|
/* we dont have caps. we'll need to maintain rid and saved uid
|
||||||
* and change euid back to saved uid (who we presume has all neccessary
|
* and change euid back to saved uid (who we presume has all neccessary
|
||||||
|
@ -51,7 +51,6 @@ uint32_t installed_routes = 0;
|
|||||||
uint32_t removed_routes = 0;
|
uint32_t removed_routes = 0;
|
||||||
|
|
||||||
zebra_capabilities_t _caps_p[] = {
|
zebra_capabilities_t _caps_p[] = {
|
||||||
ZCAP_NET_RAW, ZCAP_BIND, ZCAP_NET_ADMIN,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct zebra_privs_t sharp_privs = {
|
struct zebra_privs_t sharp_privs = {
|
||||||
|
Loading…
Reference in New Issue
Block a user