struct dsdb_control_password_change_status *status;
bool pwd_reset;
- bool pwd_last_set_zero;
bool change_status;
bool hash_values;
static int setup_last_set_field(struct setup_password_fields_io *io)
{
- if (io->ac->pwd_last_set_zero) {
- io->g.last_set = 0;
- } else {
- /* set it as now */
- unix_to_nt_time(&io->g.last_set, time(NULL));
- }
+ /* set it as now */
+ unix_to_nt_time(&io->g.last_set, time(NULL));
return LDB_SUCCESS;
}
struct ldb_context *ldb;
struct ph_context *ac;
struct ldb_message_element *userPasswordAttr, *clearTextPasswordAttr,
- *ntAttr, *lmAttr, *pwdLastSetAttr;
+ *ntAttr, *lmAttr;
int ret;
struct ldb_control *bypass = NULL;
if (ldb_msg_find_element(req->op.add.message, "supplementalCredentials")) {
return LDB_ERR_UNWILLING_TO_PERFORM;
}
- pwdLastSetAttr = ldb_msg_find_element(req->op.add.message, "pwdLastSet");
- if (pwdLastSetAttr) {
- if (!ldb_msg_check_string_attribute(req->op.add.message, "pwdLastSet", "0")) {
- /* invalid parameter */
- return LDB_ERR_OTHER;
- }
- }
/* If no part of this touches the 'userPassword' OR 'clearTextPassword'
* OR 'unicodePwd' OR 'dBCSPwd' we don't need to make any changes. */
}
ph_apply_controls(ac);
- if (pwdLastSetAttr) {
- ac->pwd_last_set_zero = true;
- }
-
/* get user domain data */
ret = build_domain_data_request(ac);
if (ret != LDB_SUCCESS) {
const char *passwordAttrs[] = { "userPassword", "clearTextPassword",
"unicodePwd", "dBCSPwd", NULL }, **l;
unsigned int attr_cnt, del_attr_cnt, add_attr_cnt, rep_attr_cnt;
- struct ldb_message_element *passwordAttr, *pwdLastSetAttr;
+ struct ldb_message_element *passwordAttr;
struct ldb_message *msg;
struct ldb_request *down_req;
int ret;
if (ldb_msg_find_element(req->op.mod.message, "supplementalCredentials")) {
return LDB_ERR_UNWILLING_TO_PERFORM;
}
- pwdLastSetAttr = ldb_msg_find_element(req->op.add.message, "pwdLastSet");
- if (pwdLastSetAttr) {
- if (!ldb_msg_check_string_attribute(req->op.add.message, "pwdLastSet", "0")) {
- /* invalid parameter */
- return LDB_ERR_OTHER;
- }
- }
/* If no part of this touches the 'userPassword' OR 'clearTextPassword'
* OR 'unicodePwd' OR 'dBCSPwd' we don't need to make any changes.
}
ph_apply_controls(ac);
- if (pwdLastSetAttr) {
- ac->pwd_last_set_zero = true;
- }
-
/* use a new message structure so that we can modify it */
msg = ldb_msg_copy_shallow(ac, req->op.mod.message);
if (msg == NULL) {