From: Wichert Akkerman Date: Mon, 6 Dec 1999 00:26:20 +0000 (+0000) Subject: Fix uid/gid changing in start-stop-daemon X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5be99fd83822ad9b0c920ec385b0eae6b4fa78a;p=dpkg Fix uid/gid changing in start-stop-daemon --- diff --git a/ChangeLog b/ChangeLog index 324030ad..417ff6a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Dec 6 01:37:08 CET 1999 Wichert Akkerman + + * Correct uid/gid-changes in start-stop-daemon, patch from + Topi Miettinen + Sun Dec 5 18:09:36 CET 1999 Wichert Akkerman * Add manpages from Josip Rodin for diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index b84eda22..b07f97d4 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -654,10 +654,12 @@ main(int argc, char **argv) printf("Starting %s...\n", startas); *--argv = startas; if (changeuser != NULL) { + if (setgid(runas_gid)) + fatal("Unable to set gid to %d", runas_gid); if (initgroups(changeuser, runas_gid)) fatal("Unable to set initgroups() with gid %d", runas_gid); - if (seteuid(runas_uid)) - fatal("Unable to set effective uid to %s", changeuser); + if (setuid(runas_uid)) + fatal("Unable to set uid to %s", changeuser); } if (background) { /* ok, we need to detach this process */