mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 11:01:48 +00:00
lib: don't try to change/reset capabilities if process has none
A couple of daemons take/use no capabilities/privs; allow cleanup of the privs/capabilities library module even if a daemon has no caps. Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
c8296ab8af
commit
5812b45fb3
@ -406,9 +406,11 @@ static void zprivs_caps_init(struct zebra_privs_t *zprivs)
|
||||
|
||||
static void zprivs_caps_terminate(void)
|
||||
{
|
||||
/* clear all capabilities */
|
||||
/* Clear all capabilities, if we have any. */
|
||||
if (zprivs_state.caps)
|
||||
cap_clear(zprivs_state.caps);
|
||||
else
|
||||
return;
|
||||
|
||||
/* and boom, capabilities are gone forever */
|
||||
if (cap_set_proc(zprivs_state.caps)) {
|
||||
|
Loading…
Reference in New Issue
Block a user