Sulogin: if zero is read at reading the passwd guess it's done.

This commit is contained in:
Werner Fink 2011-07-26 12:03:13 +00:00
parent eddea371ca
commit 09aa81cdbb
2 changed files with 5 additions and 1 deletions

View File

@ -30,6 +30,7 @@ sysvinit (2.89dsf) UNRELEASED; urgency=low
* Make quotes visible in example of the manual page of fstab-decode
* Sulogin: enforce reconnection of stdin/stdout/stderr if a device
was specified.
* Sulogin: if zero is read at reading the passwd guess it's done.
[ Petter Reinholdtsen ]
* Next release will be 2.89dsf.

View File

@ -636,7 +636,7 @@ char *getpasswd(struct console *con)
cp->eol = *ptr = '\0';
eightbit = ((con->flags & CON_SERIAL) == 0 || (tty.c_cflag & (PARODD|PARENB)) == 0);
while (cp->eol == 0) {
while (cp->eol == '\0') {
if (read(fd, &c, 1) < 1) {
if (errno == EINTR || errno == EAGAIN) {
usleep(1000);
@ -669,6 +669,9 @@ char *getpasswd(struct console *con)
}
switch (ascval) {
case 0:
*ptr = '\0';
goto quit;
case CR:
case NL:
*ptr = '\0';