[PATCH 12/16] util: Use new samba_getpass() function for passwd util.
Andreas Schneider
asn at samba.org
Tue Nov 27 04:23:52 MST 2012
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/utils/passwd_util.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/source3/utils/passwd_util.c b/source3/utils/passwd_util.c
index 293f163..5716c17 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);
}
--
1.8.0
More information about the samba-technical
mailing list