* 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
This commit is contained in:
nekral-guest 2010-11-19 21:54:41 +00:00
parent dffc624b37
commit 8b4f07692e
3 changed files with 14 additions and 2 deletions

View File

@ -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> 2010-09-05 Nicolas François <nicolas.francois@centraliens.net>
Integrate review comments from Julien Cristau Integrate review comments from Julien Cristau

4
NEWS
View File

@ -25,12 +25,16 @@ shadow-4.1.4.2 -> shadow-4.1.5 UNRELEASED
* Fixed limits support (non PAM enabled versions only) * Fixed limits support (non PAM enabled versions only)
* Added support for infinite limits and group based limits (non PAM * Added support for infinite limits and group based limits (non PAM
enabled versions only) enabled versions only)
* Fixed infinite loop when CONSOLE is configured with a colon-separated
list of TTYs.
- su - su
* Document the su exit values. * Document the su exit values.
* When su receives a signal, wait for the child to terminate (after * 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. sending a SIGTERM), and kill it only if it did not terminate by itself.
No delay will be enforced if the child cooperates. No delay will be enforced if the child cooperates.
* Default ENV_SUPATH is /sbin:/bin:/usr/sbin:/usr/bin * 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 - newgrp, sg, groupmems
* Fix parsing of gshadow entries. * Fix parsing of gshadow entries.
- useradd - useradd

View File

@ -69,13 +69,15 @@ static bool is_listed (const char *cfgin, const char *tty, bool def)
*/ */
if (*cons != '/') { if (*cons != '/') {
char *pbuf;
strcpy (buf, cons); strcpy (buf, cons);
while ((s = strtok (buf, ":")) != NULL) { pbuf = &buf[0];
while ((s = strtok (pbuf, ":")) != NULL) {
if (strcmp (s, tty) == 0) { if (strcmp (s, tty) == 0) {
return true; return true;
} }
cons = NULL; pbuf = NULL;
} }
return false; return false;
} }