diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-08-12 21:35:48 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-08-12 21:35:48 +0200 |
commit | 9f53aa5546e7bf9246546c6dda5637d50679483c (patch) | |
tree | 653277d832bc071d7bcc2325a69fad1ec62d6d36 /src/daemon | |
parent | facae1f27504983d7eff7c7c3ffa864f7e002272 (diff) |
daemon: unconditionally clean up priviliges
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/caps.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/daemon/caps.c b/src/daemon/caps.c index 294be494..69e58cc0 100644 --- a/src/daemon/caps.c +++ b/src/daemon/caps.c @@ -58,11 +58,8 @@ void pa_drop_root(void) { #ifdef HAVE_GETUID uid_t uid; + pa_log_debug(_("Cleaning up privileges.")); uid = getuid(); - if (uid == 0 || geteuid() != 0) - return; - - pa_log_info(_("Dropping root privileges.")); #if defined(HAVE_SETRESUID) pa_assert_se(setresuid(uid, uid, uid) >= 0); @@ -82,7 +79,7 @@ void pa_drop_root(void) { #endif #ifdef HAVE_SYS_CAPABILITY_H - { + if (uid != 0) { cap_t caps; pa_assert_se(caps = cap_init()); pa_assert_se(cap_clear(caps) == 0); |