Forráskód Böngészése

* utils/start-stop-daemon.c: call initgroups() prior to seteuid()

Ben Collins 27 éve
szülő
commit
68cdb92922
3 módosított fájl, 8 hozzáadás és 3 törlés
  1. 4 0
      ChangeLog
  2. 2 1
      debian/changelog
  3. 2 2
      utils/start-stop-daemon.c

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+Sat Nov 27 09:46:26 EST 1999 Ben Collins <bcollins@debian.org>
+
+  * utils/start-stop-daemon.c: call initgroups() prior to seteuid()
+
 Fri Nov 26 18:36:22 EST 1999 Ben Collins <bcollins@debian.org>
 
   * dselect/main.cc: fixed three cases where gettext usage was not

+ 2 - 1
debian/changelog

@@ -2,7 +2,8 @@ dpkg (1.6.1) unstable; urgency=low
 
   * dselect/main.cc: fixed three cases where gettext usage was not
     possible die to macros inlined in the strings
-      
+  * utils/start-stop-daemon.c: call initgroups() prior to seteuid()
+
  -- Wichert Akkerman <bcollins@debian.org>  UNRELEASED
 
 dpkg (1.6) unstable; urgency=low

+ 2 - 2
utils/start-stop-daemon.c

@@ -654,10 +654,10 @@ main(int argc, char **argv)
 		printf("Starting %s...\n", startas);
 	*--argv = startas;
 	if (changeuser != NULL) {
-		if (seteuid(runas_uid))
-			fatal("Unable to set effective uid to %s", changeuser);
 		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 (background) { /* ok, we need to detach this process */