util: Use new samba_getpass() function for passwd util.
authorAndreas Schneider <asn@samba.org>
Fri, 23 Nov 2012 13:34:39 +0000 (14:34 +0100)
committerAndreas Schneider <asn@samba.org>
Mon, 3 Dec 2012 13:35:10 +0000 (14:35 +0100)
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
source3/utils/passwd_util.c

index 293f16364eec6b559cfdb2a436b667a1e5440b8e..5716c17a3aaecc0f5052bfe6d873b1a5703cf3d5 100644 (file)
@@ -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);
 }