]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix kadm5 setkey operation with LDAP KDB
authorGreg Hudson <ghudson@mit.edu>
Mon, 26 Jun 2017 21:31:37 +0000 (17:31 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 17 Jul 2017 23:28:32 +0000 (19:28 -0400)
Add mask assignments to kadm5_setv4key_principal() and
kadm5_setkey_principal_4() so that their changes to the principal are
properly written to KDB modules which use the mask flag, such as the
LDAP KDB module.  Reported by Frank Lonigro.

(cherry picked from commit f8ed1bde848a16dfda5c6558ffe4326acc37bc95)

ticket: 8589
version_fixed: 1.15.2

src/lib/kadm5/srv/svr_principal.c

index 0640b47c40d46b1aade29e6d34932908dc198a66..8f4da0e52281d5a64add1f88e773a54426848e0b 100644 (file)
@@ -1788,6 +1788,9 @@ kadm5_setv4key_principal(void *server_handle,
     /* unlock principal on this KDC */
     kdb->fail_auth_count = 0;
 
+    /* key data changed, let the database provider know */
+    kdb->mask = KADM5_KEY_DATA | KADM5_FAIL_AUTH_COUNT;
+
     if ((ret = kdb_put_entry(handle, kdb, &adb)))
         goto done;
 
@@ -2038,6 +2041,9 @@ kadm5_setkey_principal_4(void *server_handle, krb5_principal principal,
     /* Unlock principal on this KDC. */
     kdb->fail_auth_count = 0;
 
+    /* key data changed, let the database provider know */
+    kdb->mask = KADM5_KEY_DATA | KADM5_FAIL_AUTH_COUNT;
+
     ret = kdb_put_entry(handle, kdb, &adb);
     if (ret)
         goto done;