* prompter.c (krb5_prompter_posix): Kill echo before printing
authorTom Yu <tlyu@mit.edu>
Sat, 8 Feb 2003 09:51:01 +0000 (09:51 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 8 Feb 2003 09:51:01 +0000 (09:51 +0000)
prompt to avoid possible race conditions in test suite.

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

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

index 53c7a3881612e39d8b06d9be9dd13370718cf011..68026ccb97211efdf13e8403b071eea4ee12a8fc 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-08  Tom Yu  <tlyu@mit.edu>
+
+       * prompter.c (krb5_prompter_posix): Kill echo before printing
+       prompt to avoid possible race conditions in test suite.
+
 2003-02-06  Tom Yu  <tlyu@mit.edu>
 
        * prompter.c (krb5_prompter_posix, setup_tty, restore_tty): Fix to
index 81e0b78f0e31f212d70bdc839423c33f2b4badc0..3d5e7637406be85de8973726ec77f4e8887194a9 100644 (file)
@@ -69,18 +69,17 @@ krb5_prompter_posix(
        /* fgets() takes int, but krb5_data.length is unsigned. */
        if (prompts[i].reply->length > INT_MAX)
            goto cleanup;
+
+       errcode = setup_tty(fp, prompts[i].hidden);
+       if (errcode)
+           break;
+
        /* put out the prompt */
        (void)fputs(prompts[i].prompt, stdout);
        (void)fputs(": ", stdout);
        (void)fflush(stdout);
        (void)memset(prompts[i].reply->data, 0, prompts[i].reply->length);
 
-       errcode = setup_tty(fp, prompts[i].hidden);
-       if (errcode) {
-           if (prompts[i].hidden)
-               putchar('\n');
-           break;
-       }
        got_int = 0;
        retp = fgets(prompts[i].reply->data, (int)prompts[i].reply->length,
                     fp);