From d0eafd7f41bbcfb1f03c8076a185da3f24407866 Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Sun, 12 Dec 2010 03:19:17 +0000
Subject: [PATCH] ITS#6702

---
 CHANGES                      | 1 +
 libraries/liblutil/getpass.c | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/CHANGES b/CHANGES
index 9f28924096..4be3525e07 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@ OpenLDAP 2.4.24 Engineering
 	Fixed libldap GnuTLS hang on socket close (ITS#6673)
 	Fixed libldap sasl partial write handling (ITS#6639)
 	Fixed libldap url parsing with NULL host (ITS#6653)
+	Fixed liblutil getpass prompts (ITS#6702)
 	Fixed ldapsearch segfault with deref (ITS#6638)
 	Fixed slapd acl parsing overflow (ITS#6611)
 	Fixed slapd modify to return actual error (ITS#6581)
diff --git a/libraries/liblutil/getpass.c b/libraries/liblutil/getpass.c
index 22359f56e0..a41dd90d8d 100644
--- a/libraries/liblutil/getpass.c
+++ b/libraries/liblutil/getpass.c
@@ -102,8 +102,8 @@ lutil_getpass( const char *prompt )
 #else
 	fi = stdin;
 #endif
-	fprintf(stdout, "%s", prompt); 
-	fflush(stdout);
+	fprintf(stderr, "%s", prompt); 
+	fflush(stderr);
 	i = 0;
 	while ( (c = getc(fi)) != EOF && c != '\n' && c != '\r' )
 		if ( i < (sizeof(pbuf)-1) )
@@ -111,8 +111,8 @@ lutil_getpass( const char *prompt )
 #if defined(HAVE_TERMIOS_H) || defined(HAVE_SGTTY_H)
 	/* tidy up */
 	if (fi != stdin) {
-		fprintf(stdout, "\n"); 
-		fflush(stdout);
+		fprintf(stderr, "\n"); 
+		fflush(stderr);
 		SETFLAGS( ttyb, flags );
 		if (SETATTR(fileno(fi), &ttyb) < 0)
 			perror("SETATTR");
-- 
GitLab