From 8b4f07692e41efcba03bc4c3ccd13e0b20f0d7cc Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Fri, 19 Nov 2010 21:54:41 +0000 Subject: [PATCH] * 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 --- ChangeLog | 6 ++++++ NEWS | 4 ++++ libmisc/console.c | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69acbf19..f546d91b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-19 Nicolas François + + * 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 Integrate review comments from Julien Cristau diff --git a/NEWS b/NEWS index 1c36e0e5..72a350c8 100644 --- 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 diff --git a/libmisc/console.c b/libmisc/console.c index b9268b71..70d13903 100644 --- a/libmisc/console.c +++ b/libmisc/console.c @@ -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; }