]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix CI errors on Ubuntu 24.04 1404/head
authorGreg Hudson <ghudson@mit.edu>
Fri, 20 Dec 2024 06:51:24 +0000 (01:51 -0500)
committerGreg Hudson <ghudson@mit.edu>
Mon, 23 Dec 2024 01:50:40 +0000 (20:50 -0500)
Supress a warning in the parser generated by Bison from x-deltat.y.
Convert krb5_ldap_get_age() to use a prototype.  Fix memory leaks in
the ASN.1 tests.  Check errflg after argument parsing in kdc5_hammer.

Pin the linux-clang job to Ubuntu 22.04 until we can work around an
llvm-symbolizer issue which causes test suite failures.

.github/workflows/build.yml
src/lib/krb5/krb/x-deltat.y
src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c
src/tests/asn.1/krb5_decode_test.c
src/tests/asn.1/krb5_encode_test.c
src/tests/asn.1/ktest.c
src/tests/asn.1/ktest.h
src/tests/hammer/kdc5_hammer.c

index 8d7d02e74d864d9b51f3916e7eb630fb81a12364..2d166f5df094be0c4541585bd5d353080bfa3c0a 100644 (file)
@@ -13,8 +13,13 @@ jobs:
             matrix:
                 name: [linux-clang, linux-clang-openssl, linux-gcc]
                 include:
+                    # llvm-symbolizer fails on Ubuntu 24.04 until we
+                    # can avoid using LD_LIBRARY_PATH in the test
+                    # suite.  This causes test suite failures due to
+                    # SIGPIPE exits from test programs.  See
+                    # https://github.com/llvm/llvm-project/issues/120915
                     - name: linux-clang
-                      os: ubuntu-latest
+                      os: ubuntu-22.04
                       compiler: clang
                       makevars: CPPFLAGS=-Werror
                       configureopts: --enable-asan
index 34cdf969e4f17cd2e237d603f517b0e9c06fbfbc..03145c8542c2f7e3c1bd983f0afb91a6fdd52f8d 100644 (file)
@@ -44,6 +44,7 @@
 #ifdef __GNUC__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wuninitialized"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 #endif
 
 #include "k5-int.h"
index 1f0c8684df660d69cb8f6ddcd3cbccdd1ed0bc84..342e6df157f2410a9f11d9d6f73fd1648b731a26 100644 (file)
  * ldap get age
  */
 krb5_error_code
-krb5_ldap_get_age(context, db_name, age)
-    krb5_context context;
-    char *db_name;
-    time_t *age;
+krb5_ldap_get_age(krb5_context context, char *db_name, time_t *age)
 {
     time (age);
     return 0;
index 391bf0f20a24b9d654baddd8f2221455c56f72c9..6ead19d5d3da804de7c326f98d46135ede3d2638 100644 (file)
@@ -51,6 +51,10 @@ static void ktest_free_pa_pk_as_rep(krb5_context context,
 static void ktest_free_reply_key_pack(krb5_context context,
                                       krb5_reply_key_pack *val);
 #endif
+#ifdef ENABLE_LDAP
+static void ktest_free_ldap_seqof_key_data(krb5_context context,
+                                           ldap_seqof_key_data *val);
+#endif
 static void ktest_free_kkdcp_message(krb5_context context,
                                      krb5_kkdcp_message *val);
 
@@ -1210,6 +1214,7 @@ main(int argc, char **argv)
         ktest_make_sample_principal(&ref);
         decode_run("krb5_principal_name","","30 2E A0 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 A1 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61",
                    acc.decode_krb5_principal_name,equal_principal,krb5_free_principal);
+        ktest_destroy_principal(&ref);
     }
 
 #endif /* not DISABLE_PKINIT */
@@ -1218,8 +1223,8 @@ main(int argc, char **argv)
     /* ldap sequence_of_keys */
     {
         setup(ldap_seqof_key_data,ktest_make_sample_ldap_seqof_key_data);
-        decode_run("ldap_seqof_key_data","","30 81 87 A0 03 02 01 01 A1 03 02 01 01 A2 03 02 01 2A A3 03 02 01 0E A4 71 30 6F 30 23 A0 10 30 0E A0 03 02 01 00 A1 07 04 05 73 61 6C 74 30 A1 0F 30 0D A0 03 02 01 02 A1 06 04 04 6B 65 79 30 30 23 A0 10 30 0E A0 03 02 01 01 A1 07 04 05 73 61 6C 74 31 A1 0F 30 0D A0 03 02 01 02 A1 06 04 04 6B 65 79 31 30 23 A0 10 30 0E A0 03 02 01 02 A1 07 04 05 73 61 6C 74 32 A1 0F 30 0D A0 03 02 01 02 A1 06 04 04 6B 65 79 32",acc.asn1_ldap_decode_sequence_of_keys,ktest_equal_ldap_sequence_of_keys,ktest_empty_ldap_seqof_key_data);
-        ktest_empty_ldap_seqof_key_data(test_context, &ref);
+        decode_run("ldap_seqof_key_data","","30 81 87 A0 03 02 01 01 A1 03 02 01 01 A2 03 02 01 2A A3 03 02 01 0E A4 71 30 6F 30 23 A0 10 30 0E A0 03 02 01 00 A1 07 04 05 73 61 6C 74 30 A1 0F 30 0D A0 03 02 01 02 A1 06 04 04 6B 65 79 30 30 23 A0 10 30 0E A0 03 02 01 01 A1 07 04 05 73 61 6C 74 31 A1 0F 30 0D A0 03 02 01 02 A1 06 04 04 6B 65 79 31 30 23 A0 10 30 0E A0 03 02 01 02 A1 07 04 05 73 61 6C 74 32 A1 0F 30 0D A0 03 02 01 02 A1 06 04 04 6B 65 79 32",acc.asn1_ldap_decode_sequence_of_keys,ktest_equal_ldap_sequence_of_keys,ktest_free_ldap_seqof_key_data);
+        ktest_empty_ldap_seqof_key_data(&ref);
     }
 
 #endif
@@ -1290,6 +1295,16 @@ ktest_free_reply_key_pack(krb5_context context, krb5_reply_key_pack *val)
 
 #endif /* not DISABLE_PKINIT */
 
+#ifdef ENABLE_LDAP
+static void
+ktest_free_ldap_seqof_key_data(krb5_context context, ldap_seqof_key_data *val)
+{
+    if (val)
+        ktest_empty_ldap_seqof_key_data(val);
+    free(val);
+}
+#endif /* ENABLE_LDAP */
+
 static void
 ktest_free_kkdcp_message(krb5_context context,
                          krb5_kkdcp_message *val)
index f4e754b1cc0845fa24945f35d04dbc6028727c47..d7bfa51341227d66c39d540e3b65c50f6689c63a 100644 (file)
@@ -840,7 +840,7 @@ main(int argc, char **argv)
         ktest_make_sample_ldap_seqof_key_data(&skd);
         encode_run(skd, "ldap_seqof_key_data", "",
                    acc.asn1_ldap_encode_sequence_of_keys);
-        ktest_empty_ldap_seqof_key_data(test_context, &skd);
+        ktest_empty_ldap_seqof_key_data(&skd);
     }
 #endif
 
index 98f7cc4aaa568464e0430699ec0b431f546bf551..02d26c085503b33b2586be5da5ccd6966b30fbd3 100644 (file)
@@ -1710,7 +1710,7 @@ void ktest_empty_pkinit_supp_pub_info(krb5_pkinit_supp_pub_info *p)
 
 #ifdef ENABLE_LDAP
 void
-ktest_empty_ldap_seqof_key_data(krb5_context ctx, ldap_seqof_key_data *p)
+ktest_empty_ldap_seqof_key_data(ldap_seqof_key_data *p)
 {
     int i;
 
@@ -1758,7 +1758,7 @@ ktest_empty_cammac(krb5_cammac *p)
 void
 ktest_empty_secure_cookie(krb5_secure_cookie *p)
 {
-    ktest_empty_pa_data_array(p->data);
+    ktest_destroy_pa_data_array(&p->data);
 }
 
 void
index 53180ab82e10efb74e4eb8e57452b3ba65afafb0..3b49def8868435b2511a29278469bd1c4a4ad32e 100644 (file)
@@ -195,7 +195,7 @@ void ktest_empty_pkinit_supp_pub_info(krb5_pkinit_supp_pub_info *p);
 #endif
 
 #ifdef ENABLE_LDAP
-void ktest_empty_ldap_seqof_key_data(krb5_context, ldap_seqof_key_data *p);
+void ktest_empty_ldap_seqof_key_data(ldap_seqof_key_data *p);
 #endif
 
 void ktest_empty_kkdcp_message(krb5_kkdcp_message *p);
index 76ef527ccff0242e4ab8c11849ad0739dc3891e1..36d271387288caa1742d76e31a8c4828381fdeac 100644 (file)
@@ -179,7 +179,8 @@ main(int argc, char **argv)
        }
     }
 
-    if (!(num_to_check && prefix[0])) usage(prog, 1);
+    if (!(num_to_check && prefix[0]) || errflg)
+       usage(prog, 1);
 
     if (!cur_realm) {
        if ((retval = krb5_get_default_realm(test_context, &cur_realm))) {