summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-01-12 15:14:35 +0100
committerAndreas Schneider <asn@samba.org>2011-01-21 14:34:18 +0100
commite6475f2151eb94b2e9010f9e0f4d3d8c2c315b81 (patch)
tree77bcee777f4de5234b4654cf2aeb5e79d134382a /source3/rpc_client
parent200772653ae295b4c5142d943faf7a2c878121a9 (diff)
downloadsamba-e6475f2151eb94b2e9010f9e0f4d3d8c2c315b81.tar.gz
samba-e6475f2151eb94b2e9010f9e0f4d3d8c2c315b81.tar.bz2
samba-e6475f2151eb94b2e9010f9e0f4d3d8c2c315b81.zip
s3-rpc_client: Added dcerpc_samr_chgpasswd_user3.
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_samr.c50
-rw-r--r--source3/rpc_client/cli_samr.h34
2 files changed, 75 insertions, 9 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index ae91c1c165..b046780890 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -286,13 +286,15 @@ NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
/* change password 3 */
-NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
+NTSTATUS dcerpc_samr_chgpasswd_user3(struct dcerpc_binding_handle *h,
TALLOC_CTX *mem_ctx,
+ const char *srv_name_slash,
const char *username,
const char *newpassword,
const char *oldpassword,
struct samr_DomInfo1 **dominfo1,
- struct userPwdChangeFailureInformation **reject)
+ struct userPwdChangeFailureInformation **reject,
+ NTSTATUS *presult)
{
NTSTATUS status;
@@ -301,16 +303,16 @@ NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
struct samr_Password old_nt_hash_enc;
struct samr_Password old_lanman_hash_enc;
- uchar old_nt_hash[16];
- uchar old_lanman_hash[16];
- uchar new_nt_hash[16];
- uchar new_lanman_hash[16];
+ uint8_t old_nt_hash[16];
+ uint8_t old_lanman_hash[16];
+ uint8_t new_nt_hash[16];
+ uint8_t new_lanman_hash[16];
struct lsa_String server, account;
DEBUG(10,("rpccli_samr_chgpasswd_user3\n"));
- init_lsa_String(&server, cli->srv_name_slash);
+ init_lsa_String(&server, srv_name_slash);
init_lsa_String(&account, username);
/* Calculate the MD4 hash (NT compatible) of the password */
@@ -339,7 +341,8 @@ NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
arcfour_crypt(new_nt_password.data, old_nt_hash, 516);
E_old_pw_hash(new_nt_hash, old_nt_hash, old_nt_hash_enc.hash);
- status = rpccli_samr_ChangePasswordUser3(cli, mem_ctx,
+ status = dcerpc_samr_ChangePasswordUser3(h,
+ mem_ctx,
&server,
&account,
&new_nt_password,
@@ -349,10 +352,39 @@ NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
&old_lanman_hash_enc,
NULL,
dominfo1,
- reject);
+ reject,
+ presult);
+
return status;
}
+NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ const char *username,
+ const char *newpassword,
+ const char *oldpassword,
+ struct samr_DomInfo1 **dominfo1,
+ struct userPwdChangeFailureInformation **reject)
+{
+ NTSTATUS status;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ status = dcerpc_samr_chgpasswd_user3(cli->binding_handle,
+ mem_ctx,
+ cli->srv_name_slash,
+ username,
+ newpassword,
+ oldpassword,
+ dominfo1,
+ reject,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ return result;
+}
+
/* This function returns the bizzare set of (max_entries, max_size) required
for the QueryDisplayInfo RPC to actually work against a domain controller
with large (10k and higher) numbers of users. These values were
diff --git a/source3/rpc_client/cli_samr.h b/source3/rpc_client/cli_samr.h
index 14a3cd64d2..70d0c8b7ff 100644
--- a/source3/rpc_client/cli_samr.h
+++ b/source3/rpc_client/cli_samr.h
@@ -133,6 +133,40 @@ NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
DATA_BLOB old_nt_hash_enc_blob,
DATA_BLOB new_lm_password_blob,
DATA_BLOB old_lm_hash_enc_blob);
+
+/**
+ * @brief
+ *
+ * @param[in] h The dcerpc binding hanlde to use.
+ *
+ * @param[in] mem_ctx The memory context to use.
+ *
+ * @param[in] srv_name_slash The server name with leading slashes.
+ *
+ * @param[in] username The name of ther user.
+ *
+ * @param[in] newpassword The new password to set.
+ *
+ * @param[in] oldpassword The old password to set.
+ *
+ * @param[in] dominfo1 A pointer to hold the domain information.
+ *
+ * @param[in] reject A pointer to store the result of a possible reject.
+ *
+ * @param[out] presult A pointer for the NDR NTSTATUS error code.
+ *
+ * @return A corresponding NTSTATUS error code for the connection.
+ */
+NTSTATUS dcerpc_samr_chgpasswd_user3(struct dcerpc_binding_handle *h,
+ TALLOC_CTX *mem_ctx,
+ const char *srv_name_slash,
+ const char *username,
+ const char *newpassword,
+ const char *oldpassword,
+ struct samr_DomInfo1 **dominfo1,
+ struct userPwdChangeFailureInformation **reject,
+ NTSTATUS *presult);
+
NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const char *username,