]> 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:39:47 +0000 (19:39 -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.14.6

src/lib/kadm5/srv/svr_principal.c

index 87b8c23e07f49e2075fa3d19e2d9b51ed29cc945..51a7c99c266f30df7caed5b9a0dabe3856342ac5 100644 (file)
@@ -1892,6 +1892,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;
 
@@ -2156,6 +2159,9 @@ kadm5_setkey_principal_3(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;