]> granicus.if.org Git - shadow/commitdiff
* NEWS, libmisc/console.c: Fix CONSOLE parser. This caused login
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 19 Nov 2010 21:54:41 +0000 (21:54 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 19 Nov 2010 21:54:41 +0000 (21:54 +0000)
to hang when CONSOLE was configured with a colon separated list of
TTYs.  See http://bugs.gentoo.org/show_bug.cgi?id=324419

ChangeLog
NEWS
libmisc/console.c

index 69acbf195e0dba07ce15bab4b6068e3d4ac9cdd4..f546d91b3db95c363f732055ea67b6df5c444491 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-19  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, libmisc/console.c: Fix CONSOLE parser. This caused login
+       to hang when CONSOLE was configured with a colon separated list of
+       TTYs.  See http://bugs.gentoo.org/show_bug.cgi?id=324419
+
 2010-09-05  Nicolas François  <nicolas.francois@centraliens.net>
 
        Integrate review comments from Julien Cristau
diff --git a/NEWS b/NEWS
index 1c36e0e5ae58c0668d0ae021e58e09463b30e6c2..72a350c83c840a933421c9dd0bad5ad8e9d55be7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,12 +25,16 @@ shadow-4.1.4.2 -> shadow-4.1.5                                      UNRELEASED
   * Fixed limits support (non PAM enabled versions only)
   * Added support for infinite limits and group based limits (non PAM
     enabled versions only)
+  * Fixed infinite loop when CONSOLE is configured with a colon-separated
+    list of TTYs.
 - su
   * Document the su exit values.
   * When su receives a signal, wait for the child to terminate (after
     sending a SIGTERM), and kill it only if it did not terminate by itself.
     No delay will be enforced if the child cooperates.
   * Default ENV_SUPATH is /sbin:/bin:/usr/sbin:/usr/bin
+  * Fixed infinite loop when CONSOLE is configured with a colon-separated
+    list of TTYs.
 - newgrp, sg, groupmems
   * Fix parsing of gshadow entries.
 - useradd
index b9268b71481c5c3a754833358a6e87ff5953536a..70d13903ec6768021e1eb5953daba5a2c62a417e 100644 (file)
@@ -69,13 +69,15 @@ static bool is_listed (const char *cfgin, const char *tty, bool def)
         */
 
        if (*cons != '/') {
+               char *pbuf;
                strcpy (buf, cons);
-               while ((s = strtok (buf, ":")) != NULL) {
+               pbuf = &buf[0];
+               while ((s = strtok (pbuf, ":")) != NULL) {
                        if (strcmp (s, tty) == 0) {
                                return true;
                        }
 
-                       cons = NULL;
+                       pbuf = NULL;
                }
                return false;
        }