Unbreak traceroute on system built without CAPSICUM

This commit is contained in:
Michal Meloun 2017-03-16 13:01:23 +00:00
parent b8a8ed7c96
commit 3c63fe7aa2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315411

View File

@ -1023,8 +1023,13 @@ main(int argc, char **argv)
* We must connect(2) our socket before this point.
*/
if (cansandbox && cap_enter() < 0) {
Fprintf(stderr, "%s: cap_enter: %s\n", prog, strerror(errno));
exit(1);
if (errno != ENOSYS) {
Fprintf(stderr, "%s: cap_enter: %s\n", prog,
strerror(errno));
exit(1);
} else {
cansandbox = false;
}
}
cap_rights_init(&rights, CAP_SEND, CAP_SETSOCKOPT);