From c5a93fd897791c395710365453b057093dbdff91 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 22 Apr 2007 17:00:58 +0000 Subject: r22464: remove double code and use a function metze (This used to be commit aa28bcc4669bf08f73815d00cd87c854d2ac1e92) --- source3/rpc_client/cli_samr.c | 39 +++++---------------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) (limited to 'source3/rpc_client') 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 */ -- cgit