summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-05-08 02:16:37 +0200
committerGünther Deschner <gd@samba.org>2010-05-10 10:36:39 +0200
commit7887d99a60387e93ce5ce4a3bfe9117939d1e4c8 (patch)
tree2f48e6e16d92fd3b7bbbd57266362e39bbda993e /source3/utils
parent3addebee349d0122781410eea8166f964f885568 (diff)
downloadsamba-7887d99a60387e93ce5ce4a3bfe9117939d1e4c8.tar.gz
samba-7887d99a60387e93ce5ce4a3bfe9117939d1e4c8.tar.bz2
samba-7887d99a60387e93ce5ce4a3bfe9117939d1e4c8.zip
s3-net: Fix Bug #7417. 'net rpc user password' can set the wrong password.
Guenther
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 0fd693e582..253e9771c2 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -845,8 +845,11 @@ static int rpc_user_password(struct net_context *c, int argc, const char **argv)
if (ret == -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);