diff options
author | Tim Potter <tpot@samba.org> | 2002-01-30 03:23:40 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-01-30 03:23:40 +0000 |
commit | 418bdd5919265bc74844401901d91edc84076314 (patch) | |
tree | 0ca1d700a40a5e75081f07e9471634b8c1c647ca /source/nsswitch | |
parent | b5540bee7be957d1def62ee85a84488e0250624b (diff) | |
download | samba-418bdd5919265bc74844401901d91edc84076314.tar.gz samba-418bdd5919265bc74844401901d91edc84076314.tar.xz samba-418bdd5919265bc74844401901d91edc84076314.zip |
Fix for password change from Samuel Ziegler <sam@xpedion.com>
Diffstat (limited to 'source/nsswitch')
-rw-r--r-- | source/nsswitch/winbindd_pam.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/nsswitch/winbindd_pam.c b/source/nsswitch/winbindd_pam.c index 87c5d0fb4b3..ce619ca3d81 100644 --- a/source/nsswitch/winbindd_pam.c +++ b/source/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; } |