From 4621625e006e1006e8aca3bae52bbb5bdc72efbe Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 8 Feb 2003 09:51:01 +0000 Subject: [PATCH] * prompter.c (krb5_prompter_posix): Kill echo before printing 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 | 5 +++++ src/lib/krb5/os/prompter.c | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 53c7a3881..68026ccb9 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,8 @@ +2003-02-08 Tom Yu + + * prompter.c (krb5_prompter_posix): Kill echo before printing + prompt to avoid possible race conditions in test suite. + 2003-02-06 Tom Yu * prompter.c (krb5_prompter_posix, setup_tty, restore_tty): Fix to diff --git a/src/lib/krb5/os/prompter.c b/src/lib/krb5/os/prompter.c index 81e0b78f0..3d5e76374 100644 --- a/src/lib/krb5/os/prompter.c +++ b/src/lib/krb5/os/prompter.c @@ -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); -- 2.26.2