diff options
author | Christian Franke <nobody@nowhere.ws> | 2015-05-13 13:59:17 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-05-27 20:39:04 +0200 |
commit | 3065777ece6d14c6acd04f8b2b693a15c9f2f37c (patch) | |
tree | 5e8d9c5880ea7540a3e4dd6a7228b45330e5a0e8 | |
parent | 19ed526eab33728723e25f2727f60f41d3533503 (diff) | |
download | quagga-3065777ece6d14c6acd04f8b2b693a15c9f2f37c.tar.bz2 quagga-3065777ece6d14c6acd04f8b2b693a15c9f2f37c.tar.xz |
lib/privs: display more info if cap_set_proc fails.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-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 f7269f4a..3355f24a 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); } |