util: Use new samba_getpass() function for passwd util.
[kai/samba.git] / 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);
 }