Skip to content

Commit

Permalink
Stop loading policy for pw_expiration in LDAP
Browse files Browse the repository at this point in the history
populate_krb5_db_entry() performs a subsidiary LDAP search to load the
password policy, which it uses to update the pw_expiration field.
This has some minimal value (it causes pw_expiration values in
principals to auto-update whenever the pw_max_life field of a policy
changes), but it's complicated, expensive, and inconsistent with the
DB2 back end.  Get rid of it.

ticket: 7535 (new)
  • Loading branch information
greghudson committed Jan 9, 2013
1 parent 941e26f commit 090f561
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1817,30 +1817,6 @@ populate_krb5_db_entry(krb5_context context, krb5_ldap_context *ldap_context,
if ((st=krb5_read_tkt_policy (context, ldap_context, entry, tktpolname)) !=0)
goto cleanup;

/* We already know that the policy is inside the realm container. */
if (polname) {
osa_policy_ent_t pwdpol;
krb5_timestamp last_pw_changed;
krb5_ui_4 pw_max_life;

memset(&pwdpol, 0, sizeof(pwdpol));

if ((st=krb5_ldap_get_password_policy(context, polname, &pwdpol)) != 0)
goto cleanup;
pw_max_life = pwdpol->pw_max_life;
krb5_ldap_free_password_policy(context, pwdpol);

if (pw_max_life > 0) {
if ((st=krb5_dbe_lookup_last_pwd_change(context, entry, &last_pw_changed)) != 0)
goto cleanup;

if (mask & KDB_PWD_EXPIRE_TIME_ATTR) {
if ((last_pw_changed + pw_max_life) < entry->pw_expiration)
entry->pw_expiration = last_pw_changed + pw_max_life;
} else
entry->pw_expiration = last_pw_changed + pw_max_life;
}
}
/* XXX so krb5_encode_princ_contents() will be happy */
entry->len = KRB5_KDB_V1_BASE_LENGTH;

Expand Down

0 comments on commit 090f561

Please sign in to comment.