Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Leap:42.2:Ports
mtr
mtr-0.82-capabilities.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mtr-0.82-capabilities.patch of Package mtr
Common subdirectories: mtr-0.85_p20140126.old/autom4te.cache and mtr-0.85_p20140126/autom4te.cache diff -u mtr-0.85_p20140126.old/configure.ac mtr-0.85_p20140126/configure.ac --- mtr-0.85_p20140126.old/configure.ac 2014-09-02 16:58:46.951616922 +0200 +++ mtr-0.85_p20140126/configure.ac 2014-09-02 17:06:50.288651060 +0200 @@ -26,6 +26,10 @@ AC_CHECK_LIB(termcap, tgetent) AC_CHECK_LIB(tinfo, tgetent) +AC_CHECK_LIB(cap, cap_init, + AC_DEFINE(HAVE_CAPABILITIES, 1, capability support) + LIBS="$LIBS -lcap", AC_MSG_WARN(No capability support available.)) + AC_CHECK_FUNC(initscr, , AC_CHECK_LIB(ncurses, initscr, , AC_CHECK_LIB(curses, initscr, , Common subdirectories: mtr-0.85_p20140126.old/.git and mtr-0.85_p20140126/.git Common subdirectories: mtr-0.85_p20140126.old/img and mtr-0.85_p20140126/img diff -u mtr-0.85_p20140126.old/mtr.c mtr-0.85_p20140126/mtr.c --- mtr-0.85_p20140126.old/mtr.c 2014-09-02 16:58:46.951616922 +0200 +++ mtr-0.85_p20140126/mtr.c 2014-09-02 17:06:50.288651060 +0200 @@ -46,6 +46,9 @@ #include "asn.h" #include "version.h" +#ifdef HAVE_CAPABILITIES +#include <sys/capability.h> +#endif #ifdef ENABLE_IPV6 #define DEFAULT_AF AF_UNSPEC @@ -555,6 +558,18 @@ exit( EXIT_FAILURE ); } + /* ported from ping */ +#ifdef HAVE_CAPABILITIES + { + cap_t caps = cap_init(); + if (cap_set_proc(caps) < 0) { + fprintf (stderr, "mtr: Unable to drop capabilities.\n"); + exit(1); + } + cap_free(caps); + } +#endif + /* Now drop to user permissions */ if (setgid(getgid()) || setuid(getuid())) { fprintf (stderr, "mtr: Unable to drop permissions.\n");
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor