From 937b1b2abf173a75788a88a0d9357958917f4a76 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 11 Nov 2008 19:47:30 +0000 Subject: Don't set user info unless stated. --- src/rc/start-stop-daemon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3