- truncate the echoed string at the newline, not at the first non-cr/lf

This commit is contained in:
Nalin Dahyabhai 2007-07-17 21:02:32 +00:00
parent 147635188d
commit 56d1413f95

View File

@ -441,7 +441,7 @@ When enabled, ftpd, krshd, and login.krb5 gain dependence on libpam.
+ if (message->msg_style == PAM_PROMPT_ECHO_ON) {
+ if (fgets(pwbuf, sizeof(pwbuf),
+ stdin) != NULL) {
+ pwbuf[strspn(pwbuf, "\r\n")] = '\0';
+ pwbuf[strcspn(pwbuf, "\r\n")] = '\0';
+ pwstring = pwbuf;
+ }
+ } else {