Don't set user info unless stated.

This commit is contained in:
Roy Marples 2008-11-11 19:47:30 +00:00
parent eafbed0366
commit 937b1b2abf

View File

@ -1072,9 +1072,9 @@ int start_stop_daemon(int argc, char **argv)
eerrorx("%s: unable to set groupid to %d", applet, gid); eerrorx("%s: unable to set groupid to %d", applet, gid);
if (changeuser && initgroups(changeuser, gid)) if (changeuser && initgroups(changeuser, gid))
eerrorx("%s: initgroups (%s, %d)", applet, changeuser, gid); eerrorx("%s: initgroups (%s, %d)", applet, changeuser, gid);
if (uid && setuid(uid)) if (uid) {
eerrorx ("%s: unable to set userid to %d", applet, uid); if (setuid(uid))
else { eerrorx ("%s: unable to set userid to %d", applet, uid);
pw = getpwuid(uid); pw = getpwuid(uid);
if (pw) { if (pw) {
if (!sethome) { if (!sethome) {