only add krb5EncryptionType for already existing entries or heidmal entries

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15938 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-08-19 13:07:04 +00:00
parent 5d847fc33b
commit 8822335041

View File

@@ -666,7 +666,13 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry * ent,
} }
if (ent->etypes) { if (ent->etypes) {
/* clobber and replace encryption types. */ int add_krb5EncryptionType = 0;
/*
* Only add/modify krb5EncryptionType if its a new heimdal
* entry or krb5EncryptionType already exists on the entry.
*/
if (!is_new_entry) { if (!is_new_entry) {
values = ldap_get_values(HDB2LDAP(db), msg, "krb5EncryptionType"); values = ldap_get_values(HDB2LDAP(db), msg, "krb5EncryptionType");
if (values) { if (values) {
@@ -675,8 +681,12 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry * ent,
NULL); NULL);
if (ret) if (ret)
goto out; goto out;
add_krb5EncryptionType = 1;
} }
} } else if (is_heimdal_entry)
add_krb5EncryptionType = 1;
if (add_krb5EncryptionType) {
for (i = 0; i < ent->etypes->len; i++) { for (i = 0; i < ent->etypes->len; i++) {
if (is_samba_account && if (is_samba_account &&
ent->keys.val[i].key.keytype == ETYPE_ARCFOUR_HMAC_MD5) ent->keys.val[i].key.keytype == ETYPE_ARCFOUR_HMAC_MD5)
@@ -691,6 +701,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry * ent,
} }
} }
} }
}
/* for clarity */ /* for clarity */
ret = 0; ret = 0;