diff options
| author | Christian Franke <nobody@nowhere.ws> | 2015-05-13 13:59:17 +0200 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-04-08 20:32:02 -0400 |
| commit | 0b16a517f41acef8477c9526f799a2c18a433a82 (patch) | |
| tree | e5f7d7da7a68f6e0f3bae40c6a30eeb5dd103918 /lib/privs.c | |
| parent | 01070b9e2ea34c485a9958b89af0d7e17fb310d3 (diff) | |
lib/privs: display more info if cap_set_proc fails.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/privs.c')
| -rw-r--r-- | lib/privs.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/privs.c b/lib/privs.c index f7269f4acc..3355f24a73 100644 --- a/lib/privs.c +++ b/lib/privs.c @@ -299,7 +299,21 @@ zprivs_caps_init (struct zebra_privs_t *zprivs) */ 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); } |
