diff options
Diffstat (limited to 'src/murmur/UnixMurmur.cpp')
-rw-r--r-- | src/murmur/UnixMurmur.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/murmur/UnixMurmur.cpp b/src/murmur/UnixMurmur.cpp index d6fd5d6df..393b103c6 100644 --- a/src/murmur/UnixMurmur.cpp +++ b/src/murmur/UnixMurmur.cpp @@ -227,12 +227,15 @@ void UnixMurmur::setuid() { void UnixMurmur::initialcap() { #ifdef Q_OS_LINUX - cap_value_t caps[] = {CAP_DAC_OVERRIDE, CAP_SYS_NICE, CAP_SYS_RESOURCE, CAP_NET_ADMIN, CAP_SETUID, CAP_SETGID }; + cap_value_t caps[] = {CAP_SYS_NICE, CAP_SYS_RESOURCE, CAP_NET_ADMIN, CAP_SETUID, CAP_SETGID, CAP_DAC_OVERRIDE }; if (! bRoot) return; int ncap = sizeof(caps)/sizeof(cap_value_t); + + if (geteuid() != 0) + ncap--; cap_t c = cap_init(); cap_clear(c); @@ -250,7 +253,7 @@ void UnixMurmur::initialcap() { void UnixMurmur::finalcap() { #ifdef Q_OS_LINUX - cap_value_t caps[] = {CAP_DAC_OVERRIDE, CAP_SYS_NICE, CAP_NET_ADMIN }; + cap_value_t caps[] = {CAP_SYS_NICE, CAP_NET_ADMIN }; if (! bRoot) return; |