git.samba.org
/
amitay
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f4af3d
)
util: Use new samba_getpass() function for passwd util.
author
Andreas Schneider
<asn@samba.org>
Fri, 23 Nov 2012 13:34:39 +0000
(14:34 +0100)
committer
Andreas 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
patch
|
blob
|
history
diff --git
a/source3/utils/passwd_util.c
b/source3/utils/passwd_util.c
index 293f16364eec6b559cfdb2a436b667a1e5440b8e..5716c17a3aaecc0f5052bfe6d873b1a5703cf3d5 100644
(file)
--- 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);
}