]> git.proxmox.com Git - mirror_frr.git/commit - lib/privs.c
lib: Fix privs when using HAVE_CAPABILITIES
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 21 Jun 2018 15:22:51 +0000 (11:22 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 21 Jun 2018 15:22:51 +0000 (11:22 -0400)
commit8e04538cae48d44ab6c917d4428303de44e7f0b2
tree44bf2524c39a38c15c278f5f7315467c0843fee4
parentaa7413195772bdd847fd7d5e6c9a9eb473de83ac
lib: Fix privs when using HAVE_CAPABILITIES

If your daemon does not need any special privileges
and you are compiling with HAVE_CAPABILIES, the
zprivs->change pointer will end up NULL due
to the way zprivs_caps_init.  So as a check
let's add a NULL check for zprivs->change
and set it to a function that will do nothing.

This change prevents a crash if you raise privileges
when your daemon needs no special privileges.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/privs.c