Skip to content

Commit

Permalink
Issue 4789 - Temporary password rules are not enforce with local pass…
Browse files Browse the repository at this point in the history
…word policy

Bug description:
	When allocating a password policy structure (new_passwdPolicy)
        it is initialized with the local policy definition or
	the global one. If it exists a local policy entry, the TPR
        attributes (passwordTPRMaxUse, passwordTPRDelayValidFrom and
        passwordTPRDelayExpireAt) are not taken into account.

Fix description:
	Take into account TPR attributes to initialize the policy

relates: 389ds#4789

Reviewed by: Simon Pichugin, William Brown

Platforms tested: F34
  • Loading branch information
tbordaz committed Jun 7, 2021
1 parent f53b284 commit 21e0a8a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ldap/servers/slapd/pw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2356,6 +2356,18 @@ new_passwdPolicy(Slapi_PBlock *pb, const char *dn)
if ((sval = attr_get_present_values(attr))) {
pwdpolicy->pw_dict_path = (char *)slapi_value_get_string(*sval);
}
} else if (!strcasecmp(attr_name, CONFIG_PW_TPR_MAXUSE)) {
if ((sval = attr_get_present_values(attr))) {
pwdpolicy->pw_tpr_maxuse = slapi_value_get_int(*sval);
}
} else if (!strcasecmp(attr_name, CONFIG_PW_TPR_DELAY_EXPIRE_AT)) {
if ((sval = attr_get_present_values(attr))) {
pwdpolicy->pw_tpr_delay_expire_at = slapi_value_get_int(*sval);
}
} else if (!strcasecmp(attr_name, CONFIG_PW_TPR_DELAY_VALID_FROM)) {
if ((sval = attr_get_present_values(attr))) {
pwdpolicy->pw_tpr_delay_valid_from = slapi_value_get_int(*sval);
}
}
} /* end of for() loop */
if (pw_entry) {
Expand Down

0 comments on commit 21e0a8a

Please sign in to comment.