aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/start-stop-daemon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index 4daa93b5..a3b763d0 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -1072,9 +1072,9 @@ int start_stop_daemon(int argc, char **argv)
eerrorx("%s: unable to set groupid to %d", applet, gid);
if (changeuser && initgroups(changeuser, gid))
eerrorx("%s: initgroups (%s, %d)", applet, changeuser, gid);
- if (uid && setuid(uid))
- eerrorx ("%s: unable to set userid to %d", applet, uid);
- else {
+ if (uid) {
+ if (setuid(uid))
+ eerrorx ("%s: unable to set userid to %d", applet, uid);
pw = getpwuid(uid);
if (pw) {
if (!sethome) {