summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-11-22 15:34:06 +0100
committerAndreas Schneider <asn@samba.org>2012-12-03 14:35:08 +0100
commit3c79f85b6ec8e99bd58e615b692bbef1284fef03 (patch)
tree721899ce6755eecd18fd1c7006b9319896473cb0 /source3/lib
parent85b1b840cbed92a5657e20407fe22dc9e8591af5 (diff)
downloadsamba-3c79f85b6ec8e99bd58e615b692bbef1284fef03.tar.gz
samba-3c79f85b6ec8e99bd58e615b692bbef1284fef03.tar.bz2
samba-3c79f85b6ec8e99bd58e615b692bbef1284fef03.zip
util: Use new samba_getpass() function.
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_cmdline.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/lib/util_cmdline.c b/source3/lib/util_cmdline.c
index 440384608b..d15f32535b 100644
--- a/source3/lib/util_cmdline.c
+++ b/source3/lib/util_cmdline.c
@@ -246,7 +246,8 @@ bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_inf
void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info)
{
char *label = NULL;
- char *pass;
+ char pwd[256] = {0};
+ int rc;
TALLOC_CTX *frame;
if (get_cmdline_auth_info_got_pass(auth_info) ||
@@ -258,9 +259,9 @@ void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info)
frame = talloc_stackframe();
label = talloc_asprintf(frame, "Enter %s's password: ",
get_cmdline_auth_info_username(auth_info));
- pass = getpass(label);
- if (pass) {
- set_cmdline_auth_info_password(auth_info, pass);
+ rc = samba_getpass(label, pwd, sizeof(pwd), false, false);
+ if (rc == 0) {
+ set_cmdline_auth_info_password(auth_info, pwd);
}
TALLOC_FREE(frame);
}