diff options
author | Andreas Schneider <asn@samba.org> | 2012-11-23 15:05:51 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2012-12-03 14:35:09 +0100 |
commit | 0d5f5424b4b86c16d51a5793fa93c3bfe3cdb11a (patch) | |
tree | 2d8af220d47b3f60edccba97eb4d63595c038902 /source3/utils | |
parent | bed60120d49f3285070db130974fa385b9b57b37 (diff) | |
download | samba-0d5f5424b4b86c16d51a5793fa93c3bfe3cdb11a.tar.gz samba-0d5f5424b4b86c16d51a5793fa93c3bfe3cdb11a.tar.bz2 samba-0d5f5424b4b86c16d51a5793fa93c3bfe3cdb11a.zip |
net: Use new samba_getpass() function for 'net rpc'.
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 60000242e0..57d619e28b 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -886,13 +886,20 @@ static int rpc_user_password(struct net_context *c, int argc, const char **argv) if (argv[1]) { u1003.usri1003_password = argv[1]; } else { + char pwd[256] = {0}; ret = asprintf(&prompt, _("Enter new password for %s:"), argv[0]); if (ret == -1) { return -1; } - u1003.usri1003_password = talloc_strdup(c, getpass(prompt)); + + ret = samba_getpass(prompt, pwd, sizeof(pwd), false, false); SAFE_FREE(prompt); + if (ret < 0) { + return -1; + } + + u1003.usri1003_password = talloc_strdup(c, pwd); if (u1003.usri1003_password == NULL) { return -1; } |