Don't call cap_set_proc() unless we were started with elevated
privileges. Otherwise, we might print dumpcap: cap_set_proc() fail return: Operation not permitted to stderr. svn path=/trunk/; revision=24704
This commit is contained in:
parent
d4ba88b677
commit
c288c1ae05
13
dumpcap.c
13
dumpcap.c
|
@ -508,12 +508,15 @@ relinquish_privs_except_capture(void)
|
||||||
|
|
||||||
relinquish_special_privs_perm();
|
relinquish_special_privs_perm();
|
||||||
|
|
||||||
print_caps("Post drop, pre set");
|
if (started_with_special_privs()) {
|
||||||
cap_set_flag(caps, CAP_EFFECTIVE, cl_len, cap_list, CAP_SET);
|
print_caps("Post drop, pre set");
|
||||||
if (cap_set_proc(caps)) {
|
cap_set_flag(caps, CAP_EFFECTIVE, cl_len, cap_list, CAP_SET);
|
||||||
cmdarg_err("cap_set_proc() fail return: %s", strerror(errno));
|
if (cap_set_proc(caps)) {
|
||||||
|
cmdarg_err("cap_set_proc() fail return: %s", strerror(errno));
|
||||||
|
}
|
||||||
|
print_caps("Post drop, post set");
|
||||||
}
|
}
|
||||||
print_caps("Post drop, post set");
|
|
||||||
cap_free(caps);
|
cap_free(caps);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_LIBCAP */
|
#endif /* HAVE_LIBCAP */
|
||||||
|
|
Loading…
Reference in New Issue