From 059293cbf4553a3b4dbfe78dcadb362ec344ef3b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 25 Jun 2008 10:35:59 +0200 Subject: rename rpccli_samr_chgpasswd_user to rpccli_samr_chgpasswd_user2. Guenther (This used to be commit 5b4650d56c04be0c498413f17afb2cf6d0e7d548) --- source3/rpc_client/cli_samr.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/rpc_client/cli_samr.c') diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index 21fecc4196..3ff2ef9d07 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -25,11 +25,11 @@ /* User change password */ -NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *username, - const char *newpassword, - const char *oldpassword) +NTSTATUS rpccli_samr_chgpasswd_user2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *username, + const char *newpassword, + const char *oldpassword) { NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct samr_CryptPassword new_nt_password; @@ -43,7 +43,7 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli, uchar new_lanman_hash[16]; struct lsa_String server, account; - DEBUG(10,("rpccli_samr_chgpasswd_user\n")); + DEBUG(10,("rpccli_samr_chgpasswd_user2\n")); init_lsa_String(&server, cli->srv_name_slash); init_lsa_String(&account, username); @@ -149,7 +149,7 @@ NTSTATUS rpccli_samr_chgpasswd3(struct rpc_pipe_client *cli, struct lsa_String server, account; - DEBUG(10,("rpccli_samr_chgpasswd_user3\n")); + DEBUG(10,("rpccli_samr_chgpasswd3\n")); init_lsa_String(&server, cli->srv_name_slash); init_lsa_String(&account, username); -- cgit From 14d500c0e7e4261fa8d9dbc12e14d79a424059c3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 25 Jun 2008 21:49:57 +0200 Subject: rename rpccli_samr_chgpasswd3 to rpccli_samr_chgpasswd_user3. Guenther (This used to be commit b1209a039b45985e0b28777e04cba5bcc3de061e) --- source3/rpc_client/cli_samr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/rpc_client/cli_samr.c') diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index 3ff2ef9d07..d0c71c5bb1 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -127,13 +127,13 @@ NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli, /* change password 3 */ -NTSTATUS rpccli_samr_chgpasswd3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *username, - const char *newpassword, - const char *oldpassword, - struct samr_DomInfo1 **dominfo1, - struct samr_ChangeReject **reject) +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 samr_ChangeReject **reject) { NTSTATUS status; @@ -149,7 +149,7 @@ NTSTATUS rpccli_samr_chgpasswd3(struct rpc_pipe_client *cli, struct lsa_String server, account; - DEBUG(10,("rpccli_samr_chgpasswd3\n")); + DEBUG(10,("rpccli_samr_chgpasswd_user3\n")); init_lsa_String(&server, cli->srv_name_slash); init_lsa_String(&account, username); -- cgit From 402733b518dada3ffd3a9cb622a8f994ed35a9ac Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 25 Jun 2008 11:50:17 +0200 Subject: rpc_client: add rpccli_samr_chgpasswd_user() call. Guenther (This used to be commit 10fd2baa8320f96286d53b677cf38f3ca3aa88a7) --- source3/rpc_client/cli_samr.c | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'source3/rpc_client/cli_samr.c') diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index d0c71c5bb1..ed42d56a02 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -23,6 +23,59 @@ #include "includes.h" +/* User change password */ + +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 result = NT_STATUS_UNSUCCESSFUL; + struct samr_Password hash1, hash2, hash3, hash4, hash5, hash6; + + uchar old_nt_hash[16]; + uchar old_lm_hash[16]; + uchar new_nt_hash[16]; + uchar new_lm_hash[16]; + + ZERO_STRUCT(old_nt_hash); + ZERO_STRUCT(old_lm_hash); + ZERO_STRUCT(new_nt_hash); + ZERO_STRUCT(new_lm_hash); + + DEBUG(10,("rpccli_samr_chgpasswd_user\n")); + + E_md4hash(oldpassword, old_nt_hash); + E_md4hash(newpassword, new_nt_hash); + + E_deshash(oldpassword, old_lm_hash); + E_deshash(newpassword, new_lm_hash); + + E_old_pw_hash(new_lm_hash, old_lm_hash, hash1.hash); + E_old_pw_hash(old_lm_hash, new_lm_hash, hash2.hash); + E_old_pw_hash(new_nt_hash, old_nt_hash, hash3.hash); + E_old_pw_hash(old_nt_hash, new_nt_hash, hash4.hash); + 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, + user_handle, + true, + &hash1, + &hash2, + true, + &hash3, + &hash4, + true, + &hash5, + true, + &hash6); + + return result; +} + + /* User change password */ NTSTATUS rpccli_samr_chgpasswd_user2(struct rpc_pipe_client *cli, -- cgit