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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sat May 16 18:19:24 UTC 2009


Author: nekral-guest
Date: 2009-05-16 18:19:24 +0000 (Sat, 16 May 2009)
New Revision: 2929

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/libmisc/console.c
   upstream/trunk/src/su.c
Log:
	* libmisc/console.c (console): Remove the leading /dev/ from the
	tty before comparing with the lines specified by CONSOLE.
	* src/su.c: Do not remove the /dev/ prefix since it is done by
	console().


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-05-16 17:08:44 UTC (rev 2928)
+++ upstream/trunk/ChangeLog	2009-05-16 18:19:24 UTC (rev 2929)
@@ -1,5 +1,12 @@
 2009-05-16  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* libmisc/console.c (console): Remove the leading /dev/ from the
+	tty before comparing with the lines specified by CONSOLE.
+	* src/su.c: Do not remove the /dev/ prefix since it is done by
+	console().
+
+2009-05-16  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* man/login.defs.d/CONSOLE.xml: Document the format of the CONSOLE
 	file.
 

Modified: upstream/trunk/libmisc/console.c
===================================================================
--- upstream/trunk/libmisc/console.c	2009-05-16 17:08:44 UTC (rev 2928)
+++ upstream/trunk/libmisc/console.c	2009-05-16 18:19:24 UTC (rev 2929)
@@ -121,6 +121,10 @@
 
 bool console (const char *tty)
 {
+	if (strncmp (tty, "/dev/", 5) == 0) {
+		tty += 5;
+	}
+
 	return is_listed ("CONSOLE", tty, true);
 }
 

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2009-05-16 17:08:44 UTC (rev 2928)
+++ upstream/trunk/src/su.c	2009-05-16 18:19:24 UTC (rev 2929)
@@ -425,13 +425,8 @@
 	 * Get the tty name. Entries will be logged indicating that the user
 	 * tried to change to the named new user from the current terminal.
 	 */
-	cp = ttyname (0);
-	if ((isatty (0) != 0) && (NULL != cp)) {
-		if (strncmp (cp, "/dev/", 5) == 0) {
-			tty = cp + 5;
-		} else {
-			tty = cp;
-		}
+	tty = ttyname (0);
+	if ((isatty (0) != 0) && (NULL != tty)) {
 #ifndef USE_PAM
 		is_console = console (tty);
 #endif




More information about the Pkg-shadow-commits mailing list