* prompter.c (krb5_prompter_posix): Fix up terminal modes if we're
authorTom Yu <tlyu@mit.edu>
Mon, 5 Feb 2001 22:01:23 +0000 (22:01 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 5 Feb 2001 22:01:23 +0000 (22:01 +0000)
interrupted. [reported by Booker Bense]

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12993 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/prompter.c

index d041fb64e0e9434cef72065d10c9a7270136875e..92b42a6b2e5c07ead6811da5a7007db5c3f38ed8 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-05  Tom Yu  <tlyu@mit.edu>
+
+       * prompter.c (krb5_prompter_posix): Fix up terminal modes if we're
+       interrupted. [reported by Booker Bense]
+
 2000-12-18  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in (LCLINT, LCLINTOPTS): New variables.
index d61c0b582b74c7c43241ed065e104afc9a450d46..2078d1e634c02511ae72956438a528ccada01c5f 100644 (file)
@@ -117,6 +117,18 @@ krb5_prompter_posix(krb5_context context,
 
 cleanup:
     (void) signal(SIGINT, ointrfunc);
+#ifndef ECHO_PASSWORD
+    if (i < num_prompts) {
+       if (prompts[i].hidden) {
+           (void)putchar('\n');
+           if (isatty(fd) == 1) {
+               if ((tcsetattr(fd, TCSANOW, &save_control) == -1
+                    && errcode == 0))
+                   return errno;
+           }
+       }
+    }
+#endif
     return(errcode);
 }
 #else /* MSDOS */