--- source/passdb/pdb_ldap.c.orig Mon Jun 26 10:58:12 2006 +++ source/passdb/pdb_ldap.c Mon Jun 26 11:01:51 2006 @@ -7,6 +7,7 @@ Copyright (C) Andrew Bartlett 2002-2003 Copyright (C) Stefan (metze) Metzmacher 2002-2003 Copyright (C) Simo Sorce 2006 + Copyright (C) Alex Deiter 2006 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1581,8 +1582,18 @@ if (!smbldap_has_extension(ldap_state->smbldap_state->ldap_struct, LDAP_EXOP_MODIFY_PASSWD)) { - DEBUG(2, ("ldap password change requested, but LDAP " - "server does not support it -- ignoring\n")); + LDAPMod **mods = NULL; + smbldap_set_mod(&mods, LDAP_MOD_REPLACE, "userPassword", + pdb_get_plaintext_passwd(newpwd)); + rc = smbldap_modify(ldap_state->smbldap_state, dn, mods); + ldap_mods_free(mods, True); + if (rc != LDAP_SUCCESS) { + DEBUG(2,("Failed modify userPassword for user %s: %s\n", + pdb_get_username(newpwd), ldap_err2string(rc))); + return NT_STATUS_UNSUCCESSFUL; + } + DEBUG(2,("Successfully modify userPassword for user %s\n", + pdb_get_username(newpwd))); return NT_STATUS_OK; } }