]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix conditional in kadm5_chpass_principal_3() 1423/head
authorGreg Hudson <ghudson@mit.edu>
Thu, 10 Apr 2025 00:22:15 +0000 (20:22 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 22 Apr 2025 18:51:53 +0000 (14:51 -0400)
Ensure that kadm5_chpass_principal_3() does not reference pol or hist
when the principal has a policy reference but the policy does not
exist.  (Both structures are zeroed in this case, so the resulting
checks are pointless but have defined and harmless behavior.)

src/lib/kadm5/srv/svr_principal.c

index 1557937f22a8ec096c9c007e478b26bfbb217025..8f381882d16550fb144e837bd039511a340df7e6 100644 (file)
@@ -1304,9 +1304,7 @@ kadm5_chpass_principal_3(void *server_handle,
         goto done;
 
     kdb->pw_expiration = 0;
-    if ((adb.aux_attributes & KADM5_POLICY)) {
-        /* the policy was loaded before */
-
+    if (have_pol) {
         ret = check_pw_reuse(handle->context, hist_keyblocks,
                              kdb->n_key_data, kdb->key_data,
                              1, &hist);