summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-01 23:06:43 +0100
committerGünther Deschner <gd@samba.org>2008-02-01 23:26:09 +0100
commite7a82edd3557ce0da11c56231bf3f51b3e686061 (patch)
tree5af9c506ff6ddb7a68170432886a12e3c66ced66
parentb9b75f37acec632333cea1737edc46071661b480 (diff)
downloadsamba-e7a82edd3557ce0da11c56231bf3f51b3e686061.tar.gz
samba-e7a82edd3557ce0da11c56231bf3f51b3e686061.tar.bz2
samba-e7a82edd3557ce0da11c56231bf3f51b3e686061.zip
Use pidl for _samr_ChangePasswordUser2().
Guenther (This used to be commit a142fe21e386233af658024b5a194eee0bc5c4ba)
-rw-r--r--source3/rpc_server/srv_samr.c24
-rw-r--r--source3/rpc_server/srv_samr_nt.c36
2 files changed, 13 insertions, 47 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index f2e6f79d8c..38bbda3f3a 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -355,29 +355,7 @@ static bool api_samr_lookup_names(pipes_struct *p)
static bool api_samr_chgpasswd_user(pipes_struct *p)
{
- SAMR_Q_CHGPASSWD_USER q_u;
- SAMR_R_CHGPASSWD_USER r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- /* change password request */
- if (!samr_io_q_chgpasswd_user("", &q_u, data, 0)) {
- DEBUG(0,("api_samr_chgpasswd_user: Failed to unmarshall SAMR_Q_CHGPASSWD_USER.\n"));
- return False;
- }
-
- r_u.status = _samr_chgpasswd_user(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if(!samr_io_r_chgpasswd_user("", &r_u, rdata, 0)) {
- DEBUG(0,("api_samr_chgpasswd_user: Failed to marshall SAMR_R_CHGPASSWD_USER.\n" ));
- return False;
- }
-
- return True;
+ return proxy_samr_call(p, NDR_SAMR_CHANGEPASSWORDUSER2);
}
/*******************************************************************
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 3f2022c9ed..2ccb202aed 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -1529,22 +1529,22 @@ NTSTATUS _samr_lookup_names(pipes_struct *p, SAMR_Q_LOOKUP_NAMES *q_u, SAMR_R_LO
}
/*******************************************************************
- _samr_chgpasswd_user
+ _samr_ChangePasswordUser2
********************************************************************/
+NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p,
+ struct samr_ChangePasswordUser2 *r)
-NTSTATUS _samr_chgpasswd_user(pipes_struct *p, SAMR_Q_CHGPASSWD_USER *q_u, SAMR_R_CHGPASSWD_USER *r_u)
{
+ NTSTATUS status;
fstring user_name;
fstring wks;
- DEBUG(5,("_samr_chgpasswd_user: %d\n", __LINE__));
+ DEBUG(5,("_samr_ChangePasswordUser2: %d\n", __LINE__));
- r_u->status = NT_STATUS_OK;
+ fstrcpy(user_name, r->in.account->string);
+ fstrcpy(wks, r->in.server->string);
- rpcstr_pull(user_name, q_u->uni_user_name.buffer, sizeof(user_name), q_u->uni_user_name.uni_str_len*2, 0);
- rpcstr_pull(wks, q_u->uni_dest_host.buffer, sizeof(wks), q_u->uni_dest_host.uni_str_len*2,0);
-
- DEBUG(5,("samr_chgpasswd_user: user: %s wks: %s\n", user_name, wks));
+ DEBUG(5,("_samr_ChangePasswordUser2: user: %s wks: %s\n", user_name, wks));
/*
* Pass the user through the NT -> unix user mapping
@@ -1558,14 +1558,12 @@ NTSTATUS _samr_chgpasswd_user(pipes_struct *p, SAMR_Q_CHGPASSWD_USER *q_u, SAMR_
* is case insensitive.
*/
- r_u->status = pass_oem_change(user_name, q_u->lm_newpass.pass, q_u->lm_oldhash.hash,
- q_u->nt_newpass.pass, q_u->nt_oldhash.hash, NULL);
-
- init_samr_r_chgpasswd_user(r_u, r_u->status);
+ status = pass_oem_change(user_name, r->in.lm_password->data, r->in.lm_verifier->hash,
+ r->in.nt_password->data, r->in.nt_verifier->hash, NULL);
- DEBUG(5,("_samr_chgpasswd_user: %d\n", __LINE__));
+ DEBUG(5,("_samr_ChangePasswordUser2: %d\n", __LINE__));
- return r_u->status;
+ return status;
}
/*******************************************************************
@@ -5513,16 +5511,6 @@ NTSTATUS _samr_OemChangePasswordUser2(pipes_struct *p,
/****************************************************************
****************************************************************/
-NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p,
- struct samr_ChangePasswordUser2 *r)
-{
- p->rng_fault_state = true;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
NTSTATUS _samr_Connect2(pipes_struct *p,
struct samr_Connect2 *r)
{