[479] in Kerberos
bug in lib/des/read_password.c
daemon@TELECOM.MIT.EDU (jb%cs.brown.edu@RELAY.CS.NET)
Sat Aug 6 08:10:51 1988
From: jb%cs.brown.edu@RELAY.CS.NET
To: kerberos@ATHENA.MIT.EDU
When trying to read in passwords, if an EOF is provided at the beginning
of a line, read_password goes into an infinite loop asking for input, not
reading from the terminal and complaining about a bad password. I fixed
this by clearing the EOF flag whenever an error occurs reading a password.
This doesn't change the looping structure, i.e. it will continue to ask
for passwords, but it lets the user input something.
Jim
*** read_password.c.orig Mon May 23 16:00:37 1988
--- read_password.c Sat Jul 30 17:59:57 1988
***************
*** 115,122 ****
if (!strlen(s))
continue;
#else
! if (!gets(s))
continue;
#endif
if (verify) {
printf("\nVerifying, please re-enter %s",prompt);
--- 115,124 ----
if (!strlen(s))
continue;
#else
! if (!gets(s)) {
! clearerr(stdin);
continue;
+ }
#endif
if (verify) {
printf("\nVerifying, please re-enter %s",prompt);
***************
*** 126,133 ****
if (!strlen(key_string))
continue;
#else
! if (!gets(key_string))
continue;
#endif
if (strcmp(s,key_string)) {
printf("\n\07\07Mismatch - try again");
--- 128,137 ----
if (!strlen(key_string))
continue;
#else
! if (!gets(key_string)) {
! clearerr(stdin);
continue;
+ }
#endif
if (strcmp(s,key_string)) {
printf("\n\07\07Mismatch - try again");