diff options
| -rw-r--r-- | meta-oe/recipes-connectivity/krb5/krb5/fix-strchr-conformance-to-C23.patch | 191 | ||||
| -rw-r--r-- | meta-oe/recipes-connectivity/krb5/krb5_1.22.2.bb | 1 |
2 files changed, 192 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/krb5/krb5/fix-strchr-conformance-to-C23.patch b/meta-oe/recipes-connectivity/krb5/krb5/fix-strchr-conformance-to-C23.patch new file mode 100644 index 0000000000..0cc50d2fdb --- /dev/null +++ b/meta-oe/recipes-connectivity/krb5/krb5/fix-strchr-conformance-to-C23.patch | |||
| @@ -0,0 +1,191 @@ | |||
| 1 | From cf3fcbb7ad5f3ffd78eb7dd4ecbc96c98ad15208 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Bokovoy <abokovoy@redhat.com> | ||
| 3 | Date: Wed, 10 Dec 2025 10:42:02 +0200 | ||
| 4 | Subject: [PATCH] Fix strchr() conformance to C23 | ||
| 5 | |||
| 6 | C23 7.28.5.1 specifies search functions such as strchr() as generic, | ||
| 7 | returning const char * if the first argument is of type const char *. | ||
| 8 | Fix uses of strchr() to conform to this change. | ||
| 9 | |||
| 10 | [jrische@redhat.com: altered changes to avoid casts; fixed an | ||
| 11 | additional case] | ||
| 12 | [ghudson@mit.edu: condensed some declarations; rewrote commit message] | ||
| 13 | |||
| 14 | ticket: 9191 (new) | ||
| 15 | |||
| 16 | Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com> | ||
| 17 | Upstream-Status: Backport [https://github.com/krb5/krb5/commit/ad4dcf1856dadc4b352b5c8ff08e51c7290fb41f] | ||
| 18 | --- | ||
| 19 | src/lib/krb5/ccache/ccbase.c | 4 ++-- | ||
| 20 | src/lib/krb5/os/expand_path.c | 3 ++- | ||
| 21 | src/lib/krb5/os/locate_kdc.c | 15 +++++++-------- | ||
| 22 | src/plugins/preauth/pkinit/pkinit_crypto.h | 2 +- | ||
| 23 | src/preauth/pkinit/pkinit_crypto_openssl.c | 6 +++--- | ||
| 24 | src/plugins/preauth/pkinit/pkinit_identity.c | 2 +- | ||
| 25 | src/plugins/preauth/pkinit/pkinit_matching.c | 2 +- | ||
| 26 | src/tests/responder.c | 3 +-- | ||
| 27 | 8 files changed, 18 insertions(+), 19 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/src/lib/krb5/ccache/ccbase.c b/src/lib/krb5/ccache/ccbase.c | ||
| 30 | index 696b681..30a0a41 100644 | ||
| 31 | --- a/src/lib/krb5/ccache/ccbase.c | ||
| 32 | +++ b/src/lib/krb5/ccache/ccbase.c | ||
| 33 | @@ -201,8 +201,8 @@ krb5_cc_register(krb5_context context, const krb5_cc_ops *ops, | ||
| 34 | krb5_error_code KRB5_CALLCONV | ||
| 35 | krb5_cc_resolve (krb5_context context, const char *name, krb5_ccache *cache) | ||
| 36 | { | ||
| 37 | - char *pfx, *cp; | ||
| 38 | - const char *resid; | ||
| 39 | + char *pfx; | ||
| 40 | + const char *cp, *resid; | ||
| 41 | unsigned int pfxlen; | ||
| 42 | krb5_error_code err; | ||
| 43 | const krb5_cc_ops *ops; | ||
| 44 | diff --git a/src/lib/krb5/os/expand_path.c b/src/lib/krb5/os/expand_path.c | ||
| 45 | index 5cbccf0..6569b88 100644 | ||
| 46 | --- a/src/lib/krb5/os/expand_path.c | ||
| 47 | +++ b/src/lib/krb5/os/expand_path.c | ||
| 48 | @@ -454,7 +454,8 @@ k5_expand_path_tokens_extra(krb5_context context, const char *path_in, | ||
| 49 | { | ||
| 50 | krb5_error_code ret; | ||
| 51 | struct k5buf buf; | ||
| 52 | - char *tok_begin, *tok_end, *tok_val, **extra_tokens = NULL, *path; | ||
| 53 | + const char *tok_begin, *tok_end; | ||
| 54 | + char *tok_val, **extra_tokens = NULL, *path; | ||
| 55 | const char *path_left; | ||
| 56 | size_t nargs = 0, i; | ||
| 57 | va_list ap; | ||
| 58 | diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c | ||
| 59 | index d1df04a..6559465 100644 | ||
| 60 | --- a/src/lib/krb5/os/locate_kdc.c | ||
| 61 | +++ b/src/lib/krb5/os/locate_kdc.c | ||
| 62 | @@ -214,8 +214,8 @@ oom: | ||
| 63 | } | ||
| 64 | |||
| 65 | static void | ||
| 66 | -parse_uri_if_https(const char *host_or_uri, k5_transport *transport, | ||
| 67 | - const char **host, const char **uri_path) | ||
| 68 | +parse_uri_if_https(char *host_or_uri, k5_transport *transport, | ||
| 69 | + char **host, const char **uri_path) | ||
| 70 | { | ||
| 71 | char *cp; | ||
| 72 | |||
| 73 | @@ -257,8 +257,7 @@ locate_srv_conf_1(krb5_context context, const krb5_data *realm, | ||
| 74 | k5_transport transport, int udpport) | ||
| 75 | { | ||
| 76 | const char *realm_srv_names[4]; | ||
| 77 | - char **hostlist = NULL, *realmstr = NULL, *host = NULL; | ||
| 78 | - const char *hostspec; | ||
| 79 | + char **hostlist = NULL, *realmstr = NULL, *host = NULL, *hostspec; | ||
| 80 | krb5_error_code code; | ||
| 81 | size_t i; | ||
| 82 | int default_port; | ||
| 83 | @@ -587,8 +586,8 @@ prof_locate_server(krb5_context context, const krb5_data *realm, | ||
| 84 | * Return a NULL *host_out if there are any problems parsing the URI. | ||
| 85 | */ | ||
| 86 | static void | ||
| 87 | -parse_uri_fields(const char *uri, k5_transport *transport_out, | ||
| 88 | - const char **host_out, int *primary_out) | ||
| 89 | +parse_uri_fields(char *uri, k5_transport *transport_out, | ||
| 90 | + char **host_out, int *primary_out) | ||
| 91 | |||
| 92 | { | ||
| 93 | k5_transport transport; | ||
| 94 | @@ -656,8 +655,8 @@ locate_uri(krb5_context context, const krb5_data *realm, | ||
| 95 | krb5_error_code ret; | ||
| 96 | k5_transport transport, host_trans; | ||
| 97 | struct srv_dns_entry *answers, *entry; | ||
| 98 | - char *host, *sitename; | ||
| 99 | - const char *host_field, *path; | ||
| 100 | + char *host, *sitename, *host_field; | ||
| 101 | + const char *path; | ||
| 102 | int port, def_port, primary; | ||
| 103 | |||
| 104 | ret = get_sitename(context, realm, &sitename); | ||
| 105 | diff --git a/src/plugins/preauth/pkinit/pkinit_crypto.h b/src/plugins/preauth/pkinit/pkinit_crypto.h | ||
| 106 | index 57bb3cb..be2d02c 100644 | ||
| 107 | --- a/src/plugins/preauth/pkinit/pkinit_crypto.h | ||
| 108 | +++ b/src/plugins/preauth/pkinit/pkinit_crypto.h | ||
| 109 | @@ -440,7 +440,7 @@ krb5_error_code crypto_load_cas_and_crls | ||
| 110 | defines the storage type (file, directory, etc) */ | ||
| 111 | int catype, /* IN | ||
| 112 | defines the ca type (anchor, intermediate, crls) */ | ||
| 113 | - char *id); /* IN | ||
| 114 | + const char *id); /* IN | ||
| 115 | defines the location (filename, directory name, etc) */ | ||
| 116 | |||
| 117 | /* | ||
| 118 | diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c | ||
| 119 | index f222dbd..0a731a8 100644 | ||
| 120 | --- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c | ||
| 121 | +++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c | ||
| 122 | @@ -4999,7 +4999,7 @@ load_cas_and_crls(krb5_context context, | ||
| 123 | pkinit_req_crypto_context req_cryptoctx, | ||
| 124 | pkinit_identity_crypto_context id_cryptoctx, | ||
| 125 | int catype, | ||
| 126 | - char *filename) | ||
| 127 | + const char *filename) | ||
| 128 | { | ||
| 129 | STACK_OF(X509_INFO) *sk = NULL; | ||
| 130 | STACK_OF(X509) *ca_certs = NULL; | ||
| 131 | @@ -5157,7 +5157,7 @@ load_cas_and_crls_dir(krb5_context context, | ||
| 132 | pkinit_req_crypto_context req_cryptoctx, | ||
| 133 | pkinit_identity_crypto_context id_cryptoctx, | ||
| 134 | int catype, | ||
| 135 | - char *dirname) | ||
| 136 | + const char *dirname) | ||
| 137 | { | ||
| 138 | krb5_error_code retval = EINVAL; | ||
| 139 | char **fnames = NULL, *filename; | ||
| 140 | @@ -5201,7 +5201,7 @@ crypto_load_cas_and_crls(krb5_context context, | ||
| 141 | pkinit_identity_crypto_context id_cryptoctx, | ||
| 142 | int idtype, | ||
| 143 | int catype, | ||
| 144 | - char *id) | ||
| 145 | + const char *id) | ||
| 146 | { | ||
| 147 | switch (idtype) { | ||
| 148 | case IDTYPE_FILE: | ||
| 149 | diff --git a/src/plugins/preauth/pkinit/pkinit_identity.c b/src/plugins/preauth/pkinit/pkinit_identity.c | ||
| 150 | index 0dcfcfc..ad65f23 100644 | ||
| 151 | --- a/src/plugins/preauth/pkinit/pkinit_identity.c | ||
| 152 | +++ b/src/plugins/preauth/pkinit/pkinit_identity.c | ||
| 153 | @@ -473,7 +473,7 @@ process_option_ca_crl(krb5_context context, | ||
| 154 | const char *value, | ||
| 155 | int catype) | ||
| 156 | { | ||
| 157 | - char *residual; | ||
| 158 | + const char *residual; | ||
| 159 | unsigned int typelen; | ||
| 160 | int idtype; | ||
| 161 | |||
| 162 | diff --git a/src/plugins/preauth/pkinit/pkinit_matching.c b/src/plugins/preauth/pkinit/pkinit_matching.c | ||
| 163 | index 0ea072c..b3c8df1 100644 | ||
| 164 | --- a/src/plugins/preauth/pkinit/pkinit_matching.c | ||
| 165 | +++ b/src/plugins/preauth/pkinit/pkinit_matching.c | ||
| 166 | @@ -262,7 +262,7 @@ parse_rule_component(krb5_context context, | ||
| 167 | char err_buf[128]; | ||
| 168 | int ret; | ||
| 169 | struct keyword_desc *kw, *nextkw; | ||
| 170 | - char *nk; | ||
| 171 | + const char *nk; | ||
| 172 | int found_next_kw = 0; | ||
| 173 | char *value = NULL; | ||
| 174 | size_t len; | ||
| 175 | diff --git a/src/tests/responder.c b/src/tests/responder.c | ||
| 176 | index 82f870e..4221a20 100644 | ||
| 177 | --- a/src/tests/responder.c | ||
| 178 | +++ b/src/tests/responder.c | ||
| 179 | @@ -282,8 +282,7 @@ responder(krb5_context ctx, void *rawdata, krb5_responder_context rctx) | ||
| 180 | /* Provide a particular response for an OTP challenge. */ | ||
| 181 | if (data->otp_answer != NULL) { | ||
| 182 | if (krb5_responder_otp_get_challenge(ctx, rctx, &ochl) == 0) { | ||
| 183 | - key = strchr(data->otp_answer, '='); | ||
| 184 | - if (key != NULL) { | ||
| 185 | + if (strchr(data->otp_answer, '=') != NULL) { | ||
| 186 | /* Make a copy of the answer that we can chop up. */ | ||
| 187 | key = strdup(data->otp_answer); | ||
| 188 | if (key == NULL) | ||
| 189 | -- | ||
| 190 | 2.34.1 | ||
| 191 | |||
diff --git a/meta-oe/recipes-connectivity/krb5/krb5_1.22.2.bb b/meta-oe/recipes-connectivity/krb5/krb5_1.22.2.bb index 507a1b2381..5d8ab2dc01 100644 --- a/meta-oe/recipes-connectivity/krb5/krb5_1.22.2.bb +++ b/meta-oe/recipes-connectivity/krb5/krb5_1.22.2.bb | |||
| @@ -21,6 +21,7 @@ inherit autotools-brokensep binconfig perlnative systemd update-rc.d pkgconfig | |||
| 21 | SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" | 21 | SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" |
| 22 | SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}.tar.gz \ | 22 | SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}.tar.gz \ |
| 23 | file://debian-suppress-usr-lib-in-krb5-config.patch;striplevel=2 \ | 23 | file://debian-suppress-usr-lib-in-krb5-config.patch;striplevel=2 \ |
| 24 | file://fix-strchr-conformance-to-C23.patch;striplevel=2 \ | ||
| 24 | file://crosscompile_nm.patch \ | 25 | file://crosscompile_nm.patch \ |
| 25 | file://etc/init.d/krb5-kdc \ | 26 | file://etc/init.d/krb5-kdc \ |
| 26 | file://etc/init.d/krb5-admin-server \ | 27 | file://etc/init.d/krb5-admin-server \ |
