mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 15:17:15 +00:00
lib/privs: display more info if cap_set_proc fails.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
01070b9e2e
commit
0b16a517f4
16
lib/privs.c
16
lib/privs.c
@ -299,7 +299,21 @@ zprivs_caps_init (struct zebra_privs_t *zprivs)
|
|||||||
*/
|
*/
|
||||||
if ( cap_set_proc (zprivs_state.caps) )
|
if ( cap_set_proc (zprivs_state.caps) )
|
||||||
{
|
{
|
||||||
fprintf (stderr, "privs_init: initial cap_set_proc failed\n");
|
cap_t current_caps;
|
||||||
|
char *current_caps_text = NULL;
|
||||||
|
char *wanted_caps_text = NULL;
|
||||||
|
|
||||||
|
fprintf(stderr, "privs_init: initial cap_set_proc failed: %s\n",
|
||||||
|
safe_strerror(errno));
|
||||||
|
|
||||||
|
current_caps = cap_get_proc();
|
||||||
|
if (current_caps)
|
||||||
|
current_caps_text = cap_to_text(current_caps, NULL);
|
||||||
|
|
||||||
|
wanted_caps_text = cap_to_text(zprivs_state.caps, NULL);
|
||||||
|
fprintf(stderr, "Wanted caps: %s\n", wanted_caps_text ? wanted_caps_text : "???");
|
||||||
|
fprintf(stderr, "Have caps: %s\n", current_caps_text ? current_caps_text : "???");
|
||||||
|
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user