summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-11-23 14:34:39 +0100
committerAndreas Schneider <asn@samba.org>2012-12-03 14:35:10 +0100
commit353e83e4ee21e5d7955b79e3d1da046f3d1c96e1 (patch)
tree6616a21751b7d5e8d400b660e76cd24014228bf5 /source3/utils
parent7f4af3d1fb0827714c8637ecc780ef9d88604bc4 (diff)
downloadsamba-353e83e4ee21e5d7955b79e3d1da046f3d1c96e1.tar.gz
samba-353e83e4ee21e5d7955b79e3d1da046f3d1c96e1.tar.bz2
samba-353e83e4ee21e5d7955b79e3d1da046f3d1c96e1.zip
util: Use new samba_getpass() function for passwd util.
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/passwd_util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/utils/passwd_util.c b/source3/utils/passwd_util.c
index 293f16364e..5716c17a3a 100644
--- a/source3/utils/passwd_util.c
+++ b/source3/utils/passwd_util.c
@@ -58,11 +58,18 @@ char *stdin_new_passwd( void)
*************************************************************/
char *get_pass( const char *prompt, bool stdin_get)
{
+ char pwd[256] = {0};
char *p;
+ int rc;
+
if (stdin_get) {
p = stdin_new_passwd();
} else {
- p = getpass( prompt);
+ rc = samba_getpass(prompt, pwd, sizeof(pwd), false, false);
+ if (rc < 0) {
+ return NULL;
+ }
+ p = pwd;
}
return smb_xstrdup( p);
}