[Pkg-shadow-commits] r2825 - in upstream/trunk: . src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Mon Apr 27 20:25:24 UTC 2009


Author: nekral-guest
Date: 2009-04-27 20:25:23 +0000 (Mon, 27 Apr 2009)
New Revision: 2825

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/login.c
Log:
	* src/login.c: Move update_utmp() after the PID or session ID
	changed in order to get more accurate data in UTMP. This also
	fixes "exec login" when login in installed setuid.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-27 20:21:48 UTC (rev 2824)
+++ upstream/trunk/ChangeLog	2009-04-27 20:25:23 UTC (rev 2825)
@@ -1,5 +1,11 @@
 2009-04-27  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/login.c: Move update_utmp() after the PID or session ID
+	changed in order to get more accurate data in UTMP. This also
+	fixes "exec login" when login in installed setuid.
+
+2009-04-27  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/login.c: Reuse a string and avoid an untranslated message
 	"Login incorrect".
 

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2009-04-27 20:21:48 UTC (rev 2824)
+++ upstream/trunk/src/login.c	2009-04-27 20:25:23 UTC (rev 2825)
@@ -1109,8 +1109,6 @@
 		addenv ("IFS= \t\n", NULL);	/* ... instead, set a safe IFS */
 	}
 
-	update_utmp (username, tty, hostname, utent);
-
 	if (pwd->pw_shell[0] == '*') {	/* subsystem root */
 		pwd->pw_shell++;	/* skip the '*' */
 		subsystem (pwd);	/* figure out what to execute */
@@ -1198,6 +1196,7 @@
 	}
 	/* child */
 #endif
+
 	/* If we were init, we need to start a new session */
 	if (getppid() == 1) {
 		setsid();
@@ -1206,6 +1205,11 @@
 		}
 	}
 
+	/*
+	 * The utmp entry needs to be updated to indicate the new status
+	 * of the session, the new PID and SID.
+	 */
+	update_utmp (username, tty, hostname, utent);
 
 	/* The pwd and spwd entries for the user have been copied.
 	 *




More information about the Pkg-shadow-commits mailing list