From e1f17d96a0a058d5bb777cc05975ae39f9461174 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Fri, 8 Apr 2005 15:08:16 +0000 Subject: Relevant BUGIDs: Red Hat bz #150537 Purpose of commit: bugfix Commit summary: --------------- misc_conv: flush input first then print the prompt - fixes problem with expect scripts --- libpam_misc/misc_conv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libpam_misc/misc_conv.c') diff --git a/libpam_misc/misc_conv.c b/libpam_misc/misc_conv.c index 56c65c0f..9bee5884 100644 --- a/libpam_misc/misc_conv.c +++ b/libpam_misc/misc_conv.c @@ -170,12 +170,12 @@ static int read_string(int echo, const char *prompt, char **retstr) /* reading the line */ while (delay >= 0) { - - fprintf(stderr, "%s", prompt); /* this may, or may not set echo off -- drop pending input */ if (have_term) (void) tcsetattr(STDIN_FILENO, TCSAFLUSH, &term_tmp); + fprintf(stderr, "%s", prompt); + if ( delay > 0 && set_alarm(delay, &old_sig) ) { D(("")); break; -- cgit v1.2.3