From 50a749404bb1d86f0881fab06414469fda307c26 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Oct 2007 14:00:42 +0200 Subject: r25680: Volker's fix for bug #668. Change the \n after the password prompt to go to tty instead of stdout. (cherry picked from commit 0cd1ed0424ce87f60070d43caffda41be6706d59) (This used to be commit 249d69fd85b67657a4523ffc9244a8b4ab01270a) --- source4/lib/replace/getpass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/lib/replace/getpass.c b/source4/lib/replace/getpass.c index 1cabf0bd87..96f508ead2 100644 --- a/source4/lib/replace/getpass.c +++ b/source4/lib/replace/getpass.c @@ -213,14 +213,15 @@ char *getsmbpass(const char *prompt) tcsetattr (fileno (in), TCSANOW, &t); } + fprintf(out, "\n"); + fflush(out); + if (in != stdin) /* We opened the terminal; now close it. */ fclose(in); /* Catch problematic signals */ catch_signal(SIGINT, SIGNAL_CAST SIG_DFL); - printf("\n"); - if (gotintr) { printf("Interupted by signal.\n"); fflush(stdout); -- cgit