summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_samr.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-01-11 13:07:02 +0100
committerAndreas Schneider <asn@samba.org>2011-01-21 14:34:17 +0100
commit78c4f72c311fb23ab37ed892fe67b75421736803 (patch)
tree054c47db1f6e35dbd5c0eb780cab7807951e501e /source3/rpc_client/cli_samr.c
parent8b1ffc770c50b789ce923f585b20a74d9b42f2ee (diff)
downloadsamba-78c4f72c311fb23ab37ed892fe67b75421736803.tar.gz
samba-78c4f72c311fb23ab37ed892fe67b75421736803.tar.bz2
samba-78c4f72c311fb23ab37ed892fe67b75421736803.zip
s3-rpc_client: Added dcerpc_samr_chgpasswd_user.
Diffstat (limited to 'source3/rpc_client/cli_samr.c')
-rw-r--r--source3/rpc_client/cli_samr.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index 7f5e6fca4a..03acafe515 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -30,13 +30,14 @@
/* User change password */
-NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
+NTSTATUS dcerpc_samr_chgpasswd_user(struct dcerpc_binding_handle *h,
TALLOC_CTX *mem_ctx,
struct policy_handle *user_handle,
const char *newpassword,
- const char *oldpassword)
+ const char *oldpassword,
+ NTSTATUS *presult)
{
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+ NTSTATUS status;
struct samr_Password hash1, hash2, hash3, hash4, hash5, hash6;
uchar old_nt_hash[16];
@@ -64,7 +65,8 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
E_old_pw_hash(old_lm_hash, new_nt_hash, hash5.hash);
E_old_pw_hash(old_nt_hash, new_lm_hash, hash6.hash);
- result = rpccli_samr_ChangePasswordUser(cli, mem_ctx,
+ status = dcerpc_samr_ChangePasswordUser(h,
+ mem_ctx,
user_handle,
true,
&hash1,
@@ -75,11 +77,33 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
true,
&hash5,
true,
- &hash6);
+ &hash6,
+ presult);
- return result;
+ return status;
}
+NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *user_handle,
+ const char *newpassword,
+ const char *oldpassword)
+{
+ NTSTATUS status;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ status = dcerpc_samr_chgpasswd_user(cli->binding_handle,
+ mem_ctx,
+ user_handle,
+ newpassword,
+ oldpassword,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ return result;
+}
/* User change password */