[PATCH 11/16] ntlm_auth: Use new samba_getpass() function.

Andreas Schneider asn at samba.org
Fri Nov 23 08:41:15 MST 2012


Signed-off-by: Andreas Schneider <asn at samba.org>
---
 source3/utils/ntlm_auth.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index 2bf9747..6b45354 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -2899,7 +2899,13 @@ enum {
 	} 
 
 	if (!opt_password) {
-		opt_password = getpass("password: ");
+		char pwd[256] = {0};
+		int rc;
+
+		rc = samba_getpass("Password: ", pwd, sizeof(pwd), false, false);
+		if (rc == 0) {
+			opt_password = SMB_STRDUP(pwd);
+		}
 	}
 
 	if (diagnostics) {
-- 
1.8.0




More information about the samba-technical mailing list