summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-05-08 02:16:37 +0200
committerKarolin Seeger <kseeger@samba.org>2010-05-17 09:50:18 +0200
commitb2fe935f1bed08706820cecd3876ec9ec4946916 (patch)
tree49677adfe1c8d97d6819723d4a459949a459d729
parenta9c442ebaeb6c84da4b12c1d98c68bf5ae74fd16 (diff)
downloadsamba-b2fe935f1bed08706820cecd3876ec9ec4946916.tar.gz
s3-net: Fix Bug #7417. 'net rpc user password' can set the wrong password.
Guenther (cherry picked from commit 7887d99a60387e93ce5ce4a3bfe9117939d1e4c8) (cherry picked from commit b4b36e1a486296d049c96ea66e201d9c01e7165d)
-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 120f634a7a7..749b0c2f2a4 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -794,8 +794,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);