summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_samr.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-03-12 16:35:41 +0100
committerGünther Deschner <gd@samba.org>2008-03-12 16:35:41 +0100
commitfd62e5688b4ced6568da1111f5a97bff0a54932e (patch)
tree31030999f23a8fae25e9846e5d9c44f6aa8fcb3f /source3/rpc_client/cli_samr.c
parent5e86a172a567ca9a60d74d1076430fb5e70b27a6 (diff)
downloadsamba-fd62e5688b4ced6568da1111f5a97bff0a54932e.tar.gz
samba-fd62e5688b4ced6568da1111f5a97bff0a54932e.tar.bz2
samba-fd62e5688b4ced6568da1111f5a97bff0a54932e.zip
Use existing srv_name_slash.
Guenther (This used to be commit 5f2b3145fcaeee58f285b6527e9fac09c5337e8a)
Diffstat (limited to 'source3/rpc_client/cli_samr.c')
-rw-r--r--source3/rpc_client/cli_samr.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index 62a5c72d81..f0763cce1f 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -42,18 +42,12 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
uchar new_nt_hash[16];
uchar new_lanman_hash[16];
struct lsa_String server, account;
- char *srv_name_slash = NULL;
DEBUG(10,("rpccli_samr_chgpasswd_user\n"));
- init_lsa_String(&server, srv_name_slash);
+ init_lsa_String(&server, cli->cli->srv_name_slash);
init_lsa_String(&account, username);
- srv_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", cli->cli->desthost);
- if (!srv_name_slash) {
- return NT_STATUS_NO_MEMORY;
- }
-
/* Calculate the MD4 hash (NT compatible) of the password */
E_md4hash(oldpassword, old_nt_hash);
E_md4hash(newpassword, new_nt_hash);
@@ -108,16 +102,10 @@ NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
struct samr_Password old_nt_hash_enc;
struct samr_Password old_lm_hash_enc;
struct lsa_String server, account;
- char *srv_name_slash = NULL;
DEBUG(10,("rpccli_samr_chng_pswd_auth_crap\n"));
- srv_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", cli->cli->desthost);
- if (!srv_name_slash) {
- return NT_STATUS_NO_MEMORY;
- }
-
- init_lsa_String(&server, srv_name_slash);
+ init_lsa_String(&server, cli->cli->srv_name_slash);
init_lsa_String(&account, username);
memcpy(&new_nt_password.data, new_nt_password_blob.data, 516);
@@ -160,16 +148,10 @@ NTSTATUS rpccli_samr_chgpasswd3(struct rpc_pipe_client *cli,
uchar new_lanman_hash[16];
struct lsa_String server, account;
- char *srv_name_slash = NULL;
DEBUG(10,("rpccli_samr_chgpasswd_user3\n"));
- srv_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", cli->cli->desthost);
- if (!srv_name_slash) {
- return NT_STATUS_NO_MEMORY;
- }
-
- init_lsa_String(&server, srv_name_slash);
+ init_lsa_String(&server, cli->cli->srv_name_slash);
init_lsa_String(&account, username);
/* Calculate the MD4 hash (NT compatible) of the password */