aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-11-11 19:47:30 +0000
committerRoy Marples <roy@marples.name>2008-11-11 19:47:30 +0000
commit937b1b2abf173a75788a88a0d9357958917f4a76 (patch)
treec2e236f531314d826f7b32a27c4f29c315579b26
parenteafbed0366c9cda0c7c2597541b44f3f99b43ec1 (diff)
Don't set user info unless stated.
-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) {