diff options
-rw-r--r-- | source3/utils/passwd_util.c | 9 |
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); } |