summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-22 17:00:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:35 -0500
commitc5a93fd897791c395710365453b057093dbdff91 (patch)
treebe99443b5c93b887bc996f6d1678751fa2d3449f /source3/rpc_client
parent04724b8451e25c509018d34b8e0bb32d8f3678d2 (diff)
downloadsamba-c5a93fd897791c395710365453b057093dbdff91.tar.gz
samba-c5a93fd897791c395710365453b057093dbdff91.tar.bz2
samba-c5a93fd897791c395710365453b057093dbdff91.zip
r22464: remove double code and use a function
metze (This used to be commit aa28bcc4669bf08f73815d00cd87c854d2ac1e92)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_samr.c39
1 files changed, 5 insertions, 34 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index 7a4d9fd58a..593b0f385b 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -1193,11 +1193,6 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
const char *newpassword,
const char *oldpassword )
{
- prs_struct qbuf, rbuf;
- SAMR_Q_CHGPASSWD_USER q;
- SAMR_R_CHGPASSWD_USER r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
uchar new_nt_password[516];
uchar new_lm_password[516];
uchar old_nt_hash[16];
@@ -1208,13 +1203,8 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
uchar new_nt_hash[16];
uchar new_lanman_hash[16];
- char *srv_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", cli->cli->desthost);
-
DEBUG(10,("rpccli_samr_chgpasswd_user\n"));
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
/* Calculate the MD4 hash (NT compatible) of the password */
E_md4hash(oldpassword, old_nt_hash);
E_md4hash(newpassword, new_nt_hash);
@@ -1241,30 +1231,11 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
SamOEMhash( new_nt_password, old_nt_hash, 516);
E_old_pw_hash( new_nt_hash, old_nt_hash, old_nt_hash_enc);
- /* Marshall data and send request */
-
- init_samr_q_chgpasswd_user(&q, srv_name_slash, username,
- new_nt_password,
- old_nt_hash_enc,
- new_lm_password,
- old_lanman_hash_enc);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_CHGPASSWD_USER,
- q, r,
- qbuf, rbuf,
- samr_io_q_chgpasswd_user,
- samr_io_r_chgpasswd_user,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- if (!NT_STATUS_IS_OK(result = r.status)) {
- goto done;
- }
-
- done:
-
- return result;
+ return rpccli_samr_chng_pswd_auth_crap(cli, mem_ctx, username,
+ data_blob_const(new_nt_password,sizeof(new_nt_password)),
+ data_blob_const(old_nt_hash_enc,sizeof(old_nt_hash_enc)),
+ data_blob_const(new_lm_password,sizeof(new_lm_password)),
+ data_blob_const(old_lanman_hash_enc,sizeof(old_lanman_hash_enc)));
}
/* User change passwd with auth crap */