summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_pam.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-01-30 03:23:40 +0000
committerTim Potter <tpot@samba.org>2002-01-30 03:23:40 +0000
commit62ea16ae360f7fde644823443da407659be734f9 (patch)
tree81cf6fd73fe566b54b5f863aa4ebf35a8ee61075 /source3/nsswitch/winbindd_pam.c
parent4b9839c58a99cb17cd891c6490e7d194f0311b81 (diff)
downloadsamba-62ea16ae360f7fde644823443da407659be734f9.tar.gz
samba-62ea16ae360f7fde644823443da407659be734f9.tar.bz2
samba-62ea16ae360f7fde644823443da407659be734f9.zip
Fix for password change from Samuel Ziegler <sam@xpedion.com>
(This used to be commit 418bdd5919265bc74844401901d91edc84076314)
Diffstat (limited to 'source3/nsswitch/winbindd_pam.c')
-rw-r--r--source3/nsswitch/winbindd_pam.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c
index 87c5d0fb4b..ce619ca3d8 100644
--- a/source3/nsswitch/winbindd_pam.c
+++ b/source3/nsswitch/winbindd_pam.c
@@ -209,6 +209,7 @@ enum winbindd_result winbindd_pam_chauthtok(struct winbindd_cli_state *state)
fstring domain, user;
uchar nt_oldhash[16];
uchar lm_oldhash[16];
+ CLI_POLICY_HND *hnd;
DEBUG(3, ("[%5d]: pam chauthtok %s\n", state->pid,
state->request.data.chauthtok.user));
@@ -218,26 +219,25 @@ enum winbindd_result winbindd_pam_chauthtok(struct winbindd_cli_state *state)
if (state == NULL)
return WINBINDD_ERROR;
- if (!parse_domain_user(state->request.data.chauthtok.user, domain, user))
+ if (!parse_domain_user(state->request.data.chauthtok.user, domain,
+ user))
return WINBINDD_ERROR;
+ /* Change password */
+
oldpass = state->request.data.chauthtok.oldpass;
newpass = state->request.data.chauthtok.newpass;
- nt_lm_owf_gen(oldpass, nt_oldhash, lm_oldhash);
-
- /* Change password */
-
-#if 0
+ /* Get sam handle */
- /* XXX */
+ if (!(hnd = cm_get_sam_handle(domain)))
+ return WINBINDD_ERROR;
- if (!msrpc_sam_ntchange_pwd(server_state.controller, domain, user,
- lm_oldhash, nt_oldhash, newpass)) {
- DEBUG(0, ("password change failed for user %s/%s\n", domain, user));
+ if (!cli_oem_change_password(hnd->cli, user, newpass, oldpass)) {
+ DEBUG(0, ("password change failed for user %s/%s\n", domain,
+ user));
return WINBINDD_ERROR;
}
-#endif
return WINBINDD_OK;
}