diff options
author | Günther Deschner <gd@samba.org> | 2010-05-08 02:16:37 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-01-13 17:58:47 +0100 |
commit | 3fc63a6ce53e3fce0f1df6f20365b099067b1867 (patch) | |
tree | aac61932032be50283478c327a624024fec24041 | |
parent | bfe7b2cbeda80570320f357337918b5d66ff8b77 (diff) | |
download | samba-3fc63a6ce53e3fce0f1df6f20365b099067b1867.tar.gz samba-3fc63a6ce53e3fce0f1df6f20365b099067b1867.tar.xz samba-3fc63a6ce53e3fce0f1df6f20365b099067b1867.zip |
s3-net: Fix Bug #7417. 'net rpc user password' can set the wrong password.
Guenther
(cherry picked from commit 7887d99a60387e93ce5ce4a3bfe9117939d1e4c8)
(cherry picked from commit fb4d896217183b0ea2b97016aa84c2d83f7f1323)
-rw-r--r-- | source3/utils/net_rpc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 75726b0d617..aa041720b1c 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -758,8 +758,11 @@ static int rpc_user_password(struct net_context *c, int argc, const char **argv) if (asprintf(&prompt, "Enter new password for %s:", argv[0]) == -1) { return -1; } - u1003.usri1003_password = getpass(prompt); + u1003.usri1003_password = talloc_strdup(c, getpass(prompt)); SAFE_FREE(prompt); + if (u1003.usri1003_password == NULL) { + return -1; + } } status = NetUserSetInfo(c->opt_host, argv[0], 1003, (uint8_t *)&u1003, &parm_err); |