diff options
4 files changed, 705 insertions, 10 deletions
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0001-configure-prototypes.patch b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0001-configure-prototypes.patch new file mode 100644 index 0000000000..e1b7c6e8d5 --- /dev/null +++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0001-configure-prototypes.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 3982a8925e15ea16df49891a700e7f9d9a10541c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "mark.yang" <mark.yang@lge.com> | ||
| 3 | Date: Wed, 9 Apr 2025 11:46:36 +0900 | ||
| 4 | Subject: [PATCH 1/3] configure prototypes | ||
| 5 | |||
| 6 | * Set to use function prototypes for ANSI_C | ||
| 7 | If PROTOTYPES is set in md5global.h, it uses PROTO_LIST(list) list instead of PROTO_LIST(list) () | ||
| 8 | to provide parameterized prototyping. | ||
| 9 | Therefore, at the configure.ac stage, when using ANSI_C, PROTOTYPES should be defined. | ||
| 10 | |||
| 11 | * to fix the build error with gcc-15 | ||
| 12 | Even though I added this configuration to fix the error, the error shown in the following patch still occurs. | ||
| 13 | ../../git/lib/md5.c:139:8: error: too many arguments to function 'MD5_memcpy'; expected 0, have 3 | ||
| 14 | 139 | MD5_memcpy | ||
| 15 | | ^~~~~~~~~~ | ||
| 16 | 140 | ((POINTER)&context->buffer[index], (POINTER)input, partLen); MD5Transform | ||
| 17 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 18 | ../../git/lib/md5.c:62:13: note: declared here | ||
| 19 | 62 | static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); | ||
| 20 | | ^~~~~~~~~~ | ||
| 21 | |||
| 22 | Upstream-Status: Submitted [https://github.com/cyrusimap/cyrus-sasl/pull/873] | ||
| 23 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
| 24 | --- | ||
| 25 | configure.ac | 1 + | ||
| 26 | 1 file changed, 1 insertion(+) | ||
| 27 | |||
| 28 | diff --git a/configure.ac b/configure.ac | ||
| 29 | index 2a0cf878..657e178b 100644 | ||
| 30 | --- a/configure.ac | ||
| 31 | +++ b/configure.ac | ||
| 32 | @@ -88,6 +88,7 @@ AC_ARG_ENABLE(obsolete_digest_attr, | ||
| 33 | enable_obsolete_digest_attr=yes) | ||
| 34 | |||
| 35 | AC_PROG_CC | ||
| 36 | +AC_C_PROTOTYPES | ||
| 37 | AX_PROG_CC_FOR_BUILD | ||
| 38 | AC_PROG_CPP | ||
| 39 | AC_PROG_AWK | ||
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0002-Fix-incompatible-pointer-types-error-with-gcc-15.patch b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0002-Fix-incompatible-pointer-types-error-with-gcc-15.patch new file mode 100644 index 0000000000..df66ab86d1 --- /dev/null +++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0002-Fix-incompatible-pointer-types-error-with-gcc-15.patch | |||
| @@ -0,0 +1,122 @@ | |||
| 1 | From 8ad219c21914ee9815c915e075052805efff9757 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "mark.yang" <mark.yang@lge.com> | ||
| 3 | Date: Wed, 9 Apr 2025 15:42:13 +0900 | ||
| 4 | Subject: [PATCH 2/3] Fix incompatible-pointer-types error with gcc-15 | ||
| 5 | |||
| 6 | * Fix incompatible-pointer-types error with gcc-15 | ||
| 7 | ../../git/saslauthd/md5.c:400:14: error: passing argument 1 of 'MD5_memset' from incompatible pointer type [-Wincompatible-pointer-types] | ||
| 8 | 400 | MD5_memset(&k_ipad, 0, sizeof(k_ipad)); | ||
| 9 | | ^~~~~~~ | ||
| 10 | | | | ||
| 11 | | unsigned char (*)[65] | ||
| 12 | ../../git/saslauthd/md5.c:335:9: note: expected 'POINTER' {aka 'unsigned char *'} but argument is of type 'unsigned char (*)[65]' | ||
| 13 | 335 | POINTER output; | ||
| 14 | | ^~~~~~ | ||
| 15 | In file included from ../../git/saslauthd/md5.c:29: | ||
| 16 | ../include/md5global.h:16:24: note: 'POINTER' declared here | ||
| 17 | 16 | typedef unsigned char *POINTER; | ||
| 18 | | ^~~~~~~ | ||
| 19 | ../../git/saslauthd/md5.c:401:14: error: passing argument 1 of 'MD5_memset' from incompatible pointer type [-Wincompatible-pointer-types] | ||
| 20 | 401 | MD5_memset(&k_opad, 0, sizeof(k_opad)); | ||
| 21 | | ^~~~~~~ | ||
| 22 | | | | ||
| 23 | | unsigned char (*)[65] | ||
| 24 | ../../git/saslauthd/md5.c:335:9: note: expected 'POINTER' {aka 'unsigned char *'} but argument is of type 'unsigned char (*)[65]' | ||
| 25 | 335 | POINTER output; | ||
| 26 | | ^~~~~~ | ||
| 27 | ../include/md5global.h:16:24: note: 'POINTER' declared here | ||
| 28 | 16 | typedef unsigned char *POINTER; | ||
| 29 | | ^~~~~~~ | ||
| 30 | ../../git/saslauthd/md5.c:402:14: error: passing argument 1 of 'MD5_memset' from incompatible pointer type [-Wincompatible-pointer-types] | ||
| 31 | 402 | MD5_memset(&tk, 0, sizeof(tk)); | ||
| 32 | | ^~~ | ||
| 33 | | | | ||
| 34 | | unsigned char (*)[16] | ||
| 35 | ../../git/saslauthd/md5.c:335:9: note: expected 'POINTER' {aka 'unsigned char *'} but argument is of type 'unsigned char (*)[16]' | ||
| 36 | 335 | POINTER output; | ||
| 37 | | ^~~~~~ | ||
| 38 | ../include/md5global.h:16:24: note: 'POINTER' declared here | ||
| 39 | 16 | typedef unsigned char *POINTER; | ||
| 40 | | ^~~~~~~ | ||
| 41 | ../../git/saslauthd/md5.c: In function '_saslauthd_hmac_md5_precalc': | ||
| 42 | ../../git/saslauthd/md5.c:427:14: error: passing argument 1 of 'MD5_memset' from incompatible pointer type [-Wincompatible-pointer-types] | ||
| 43 | 427 | MD5_memset(&hmac, 0, sizeof(hmac)); | ||
| 44 | | ^~~~~ | ||
| 45 | | | | ||
| 46 | | HMAC_MD5_CTX * {aka struct HMAC_MD5_CTX_s *} | ||
| 47 | ../../git/saslauthd/md5.c:335:9: note: expected 'POINTER' {aka 'unsigned char *'} but argument is of type 'HMAC_MD5_CTX *' {aka 'struct HMAC_MD5_CTX_s *'} | ||
| 48 | 335 | POINTER output; | ||
| 49 | | ^~~~~~ | ||
| 50 | ../include/md5global.h:16:24: note: 'POINTER' declared here | ||
| 51 | 16 | typedef unsigned char *POINTER; | ||
| 52 | | ^~~~~~~ | ||
| 53 | ../../git/saslauthd/md5.c: In function '_saslauthd_hmac_md5_import': | ||
| 54 | ../../git/saslauthd/md5.c:435:14: error: passing argument 1 of 'MD5_memset' from incompatible pointer type [-Wincompatible-pointer-types] | ||
| 55 | 435 | MD5_memset(hmac, 0, sizeof(HMAC_MD5_CTX)); | ||
| 56 | | ^~~~ | ||
| 57 | | | | ||
| 58 | | HMAC_MD5_CTX * {aka struct HMAC_MD5_CTX_s *} | ||
| 59 | ../../git/saslauthd/md5.c:335:9: note: expected 'POINTER' {aka 'unsigned char *'} but argument is of type 'HMAC_MD5_CTX *' {aka 'struct HMAC_MD5_CTX_s *'} | ||
| 60 | 335 | POINTER output; | ||
| 61 | | ^~~~~~ | ||
| 62 | ../include/md5global.h:16:24: note: 'POINTER' declared here | ||
| 63 | 16 | typedef unsigned char *POINTER; | ||
| 64 | | ^~~~~~~ | ||
| 65 | ../../git/saslauthd/md5.c: In function '_saslauthd_hmac_md5': | ||
| 66 | ../../git/saslauthd/md5.c:455:6: warning: old-style function definition [-Wold-style-definition] | ||
| 67 | 455 | void _saslauthd_hmac_md5(text, text_len, key, key_len, digest) | ||
| 68 | | ^~~~~~~~~~~~~~~~~~~ | ||
| 69 | ../../git/saslauthd/md5.c:499:23: warning: passing argument 2 of 'MD5_memcpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] | ||
| 70 | 499 | MD5_memcpy( k_ipad, key, key_len); | ||
| 71 | | ^~~ | ||
| 72 | ../../git/saslauthd/md5.c:322:9: note: expected 'POINTER' {aka 'unsigned char *'} but argument is of type 'const unsigned char *' | ||
| 73 | 322 | POINTER input; | ||
| 74 | | ^~~~~ | ||
| 75 | ../../git/saslauthd/md5.c:500:23: warning: passing argument 2 of 'MD5_memcpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] | ||
| 76 | 500 | MD5_memcpy( k_opad, key, key_len); | ||
| 77 | | ^~~ | ||
| 78 | ../../git/saslauthd/md5.c:322:9: note: expected 'POINTER' {aka 'unsigned char *'} but argument is of type 'const unsigned char *' | ||
| 79 | 322 | POINTER input; | ||
| 80 | | ^~~~~ | ||
| 81 | |||
| 82 | Upstream-Status: Submitted [https://github.com/cyrusimap/cyrus-sasl/pull/873] | ||
| 83 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
| 84 | --- | ||
| 85 | saslauthd/md5.c | 10 +++++----- | ||
| 86 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
| 87 | |||
| 88 | diff --git a/saslauthd/md5.c b/saslauthd/md5.c | ||
| 89 | index d38425d2..c16922d8 100644 | ||
| 90 | --- a/saslauthd/md5.c | ||
| 91 | +++ b/saslauthd/md5.c | ||
| 92 | @@ -397,9 +397,9 @@ void _saslauthd_hmac_md5_init(HMAC_MD5_CTX *hmac, | ||
| 93 | _saslauthd_MD5Update(&hmac->octx, k_opad, 64); /* apply outer pad */ | ||
| 94 | |||
| 95 | /* scrub the pads and key context (if used) */ | ||
| 96 | - MD5_memset(&k_ipad, 0, sizeof(k_ipad)); | ||
| 97 | - MD5_memset(&k_opad, 0, sizeof(k_opad)); | ||
| 98 | - MD5_memset(&tk, 0, sizeof(tk)); | ||
| 99 | + MD5_memset(k_ipad, 0, sizeof(k_ipad)); | ||
| 100 | + MD5_memset(k_opad, 0, sizeof(k_opad)); | ||
| 101 | + MD5_memset(tk, 0, sizeof(tk)); | ||
| 102 | |||
| 103 | /* and we're done. */ | ||
| 104 | } | ||
| 105 | @@ -424,7 +424,7 @@ void _saslauthd_hmac_md5_precalc(HMAC_MD5_STATE *state, | ||
| 106 | state->istate[lupe] = htonl(hmac.ictx.state[lupe]); | ||
| 107 | state->ostate[lupe] = htonl(hmac.octx.state[lupe]); | ||
| 108 | } | ||
| 109 | - MD5_memset(&hmac, 0, sizeof(hmac)); | ||
| 110 | + MD5_memset((POINTER)&hmac, 0, sizeof(hmac)); | ||
| 111 | } | ||
| 112 | |||
| 113 | |||
| 114 | @@ -432,7 +432,7 @@ void _saslauthd_hmac_md5_import(HMAC_MD5_CTX *hmac, | ||
| 115 | HMAC_MD5_STATE *state) | ||
| 116 | { | ||
| 117 | unsigned lupe; | ||
| 118 | - MD5_memset(hmac, 0, sizeof(HMAC_MD5_CTX)); | ||
| 119 | + MD5_memset((POINTER)hmac, 0, sizeof(HMAC_MD5_CTX)); | ||
| 120 | for (lupe = 0; lupe < 4; lupe++) { | ||
| 121 | hmac->ictx.state[lupe] = ntohl(state->istate[lupe]); | ||
| 122 | hmac->octx.state[lupe] = ntohl(state->ostate[lupe]); | ||
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0003-Add-compatibility-for-gcc-15-869.patch b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0003-Add-compatibility-for-gcc-15-869.patch new file mode 100644 index 0000000000..924d39d301 --- /dev/null +++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl/0003-Add-compatibility-for-gcc-15-869.patch | |||
| @@ -0,0 +1,530 @@ | |||
| 1 | From dcd29d8e5ee427b68f34fdede007fa4787caf464 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Rob Crittenden <rcritten@redhat.com> | ||
| 3 | Date: Fri, 28 Feb 2025 12:07:25 -0500 | ||
| 4 | Subject: [PATCH 3/3] Add compatibility for gcc 15 (#869) | ||
| 5 | |||
| 6 | Fedora 42 is going to use gcc 15 which changes some warnings into | ||
| 7 | errors. Address the issues raised. | ||
| 8 | |||
| 9 | The issues addressed include: | ||
| 10 | - The RETURN macro is defined differently in two places. Rename one. | ||
| 11 | - Both atexit and the sigint and sigterm actions call server_exit(). | ||
| 12 | The function arguments diff. Introduce a new generic signal handler | ||
| 13 | to call server_exit() for sigint and sigterm signals. | ||
| 14 | |||
| 15 | Signed-off-by: Rob Crittenden <rcritten@redhat.com> | ||
| 16 | |||
| 17 | Upstream-Status: Backport [https://github.com/cyrusimap/cyrus-sasl/pull/869] | ||
| 18 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
| 19 | --- | ||
| 20 | lib/auxprop.c | 2 +- | ||
| 21 | lib/canonusr.c | 6 +++--- | ||
| 22 | lib/client.c | 6 +++--- | ||
| 23 | lib/common.c | 40 +++++++++++++++++++------------------- | ||
| 24 | lib/saslint.h | 8 ++++---- | ||
| 25 | lib/server.c | 32 +++++++++++++++--------------- | ||
| 26 | saslauthd/auth_sasldb.c | 4 +--- | ||
| 27 | saslauthd/saslauthd-main.c | 12 ++++++++---- | ||
| 28 | saslauthd/saslauthd-main.h | 5 +++-- | ||
| 29 | 9 files changed, 59 insertions(+), 56 deletions(-) | ||
| 30 | |||
| 31 | diff --git a/lib/auxprop.c b/lib/auxprop.c | ||
| 32 | index 1b0162db..0d465a2d 100644 | ||
| 33 | --- a/lib/auxprop.c | ||
| 34 | +++ b/lib/auxprop.c | ||
| 35 | @@ -780,7 +780,7 @@ int sasl_auxprop_request(sasl_conn_t *conn, const char **propnames) | ||
| 36 | } | ||
| 37 | |||
| 38 | result = prop_request(sconn->sparams->propctx, propnames); | ||
| 39 | - RETURN(conn, result); | ||
| 40 | + RETURN_VAL(conn, result); | ||
| 41 | } | ||
| 42 | |||
| 43 | |||
| 44 | diff --git a/lib/canonusr.c b/lib/canonusr.c | ||
| 45 | index 66f7e112..654a72ed 100644 | ||
| 46 | --- a/lib/canonusr.c | ||
| 47 | +++ b/lib/canonusr.c | ||
| 48 | @@ -192,7 +192,7 @@ int _sasl_canon_user(sasl_conn_t *conn, | ||
| 49 | oparams->user = conn->user_buf; | ||
| 50 | } | ||
| 51 | |||
| 52 | - RETURN(conn, result); | ||
| 53 | + RETURN_VAL(conn, result); | ||
| 54 | } | ||
| 55 | |||
| 56 | /* Lookup all properties for authentication and/or authorization identity. */ | ||
| 57 | @@ -256,7 +256,7 @@ static int _sasl_auxprop_lookup_user_props (sasl_conn_t *conn, | ||
| 58 | } | ||
| 59 | #endif | ||
| 60 | |||
| 61 | - RETURN(conn, result); | ||
| 62 | + RETURN_VAL(conn, result); | ||
| 63 | } | ||
| 64 | |||
| 65 | /* default behavior: | ||
| 66 | @@ -285,7 +285,7 @@ int _sasl_canon_user_lookup (sasl_conn_t *conn, | ||
| 67 | oparams); | ||
| 68 | } | ||
| 69 | |||
| 70 | - RETURN(conn, result); | ||
| 71 | + RETURN_VAL(conn, result); | ||
| 72 | } | ||
| 73 | |||
| 74 | void _sasl_canonuser_free() | ||
| 75 | diff --git a/lib/client.c b/lib/client.c | ||
| 76 | index 3784bb0e..281285b8 100644 | ||
| 77 | --- a/lib/client.c | ||
| 78 | +++ b/lib/client.c | ||
| 79 | @@ -435,7 +435,7 @@ int sasl_client_new(const char *service, | ||
| 80 | &client_idle, serverFQDN, | ||
| 81 | iplocalport, ipremoteport, | ||
| 82 | prompt_supp, &global_callbacks_client); | ||
| 83 | - if (result != SASL_OK) RETURN(*pconn, result); | ||
| 84 | + if (result != SASL_OK) RETURN_VAL(*pconn, result); | ||
| 85 | |||
| 86 | utils = _sasl_alloc_utils(*pconn, &global_callbacks_client); | ||
| 87 | if (utils == NULL) { | ||
| 88 | @@ -879,7 +879,7 @@ int sasl_client_start(sasl_conn_t *conn, | ||
| 89 | done: | ||
| 90 | if (ordered_mechs != NULL) | ||
| 91 | c_conn->cparams->utils->free(ordered_mechs); | ||
| 92 | - RETURN(conn, result); | ||
| 93 | + RETURN_VAL(conn, result); | ||
| 94 | } | ||
| 95 | |||
| 96 | /* do a single authentication step. | ||
| 97 | @@ -952,7 +952,7 @@ int sasl_client_step(sasl_conn_t *conn, | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 101 | - RETURN(conn,result); | ||
| 102 | + RETURN_VAL(conn,result); | ||
| 103 | } | ||
| 104 | |||
| 105 | /* returns the length of all the mechanisms | ||
| 106 | diff --git a/lib/common.c b/lib/common.c | ||
| 107 | index d9104c89..e9d58d1b 100644 | ||
| 108 | --- a/lib/common.c | ||
| 109 | +++ b/lib/common.c | ||
| 110 | @@ -303,7 +303,7 @@ int sasl_encode(sasl_conn_t *conn, const char *input, | ||
| 111 | |||
| 112 | result = sasl_encodev(conn, &tmp, 1, output, outputlen); | ||
| 113 | |||
| 114 | - RETURN(conn, result); | ||
| 115 | + RETURN_VAL(conn, result); | ||
| 116 | } | ||
| 117 | |||
| 118 | /* Internal function that doesn't do any verification */ | ||
| 119 | @@ -389,7 +389,7 @@ _sasl_encodev (sasl_conn_t *conn, | ||
| 120 | |||
| 121 | (*p_num_packets)++; | ||
| 122 | |||
| 123 | - RETURN(conn, result); | ||
| 124 | + RETURN_VAL(conn, result); | ||
| 125 | } | ||
| 126 | |||
| 127 | /* security-encode an iovec */ | ||
| 128 | @@ -434,7 +434,7 @@ int sasl_encodev(sasl_conn_t *conn, | ||
| 129 | *output = conn->encode_buf->data; | ||
| 130 | *outputlen = (unsigned) conn->encode_buf->curlen; | ||
| 131 | |||
| 132 | - RETURN(conn, result); | ||
| 133 | + RETURN_VAL(conn, result); | ||
| 134 | } | ||
| 135 | |||
| 136 | /* This might be better to check on a per-plugin basis, but I think | ||
| 137 | @@ -592,7 +592,7 @@ cleanup: | ||
| 138 | sasl_FREE(cur_invec); | ||
| 139 | } | ||
| 140 | |||
| 141 | - RETURN(conn, result); | ||
| 142 | + RETURN_VAL(conn, result); | ||
| 143 | } | ||
| 144 | |||
| 145 | /* output is only valid until next call to sasl_decode */ | ||
| 146 | @@ -609,7 +609,7 @@ int sasl_decode(sasl_conn_t *conn, | ||
| 147 | if(!conn->props.maxbufsize) { | ||
| 148 | sasl_seterror(conn, 0, | ||
| 149 | "called sasl_decode with application that does not support security layers"); | ||
| 150 | - RETURN(conn, SASL_TOOWEAK); | ||
| 151 | + RETURN_VAL(conn, SASL_TOOWEAK); | ||
| 152 | } | ||
| 153 | |||
| 154 | if(conn->oparams.decode == NULL) | ||
| 155 | @@ -623,7 +623,7 @@ int sasl_decode(sasl_conn_t *conn, | ||
| 156 | if(inputlen > conn->props.maxbufsize) { | ||
| 157 | sasl_seterror(conn, 0, | ||
| 158 | "input too large for default sasl_decode"); | ||
| 159 | - RETURN(conn,SASL_BUFOVER); | ||
| 160 | + RETURN_VAL(conn,SASL_BUFOVER); | ||
| 161 | } | ||
| 162 | |||
| 163 | if(!conn->decode_buf) | ||
| 164 | @@ -644,7 +644,7 @@ int sasl_decode(sasl_conn_t *conn, | ||
| 165 | /* NULL an empty buffer (for misbehaved applications) */ | ||
| 166 | if (*outputlen == 0) *output = NULL; | ||
| 167 | |||
| 168 | - RETURN(conn, result); | ||
| 169 | + RETURN_VAL(conn, result); | ||
| 170 | } | ||
| 171 | |||
| 172 | INTERROR(conn, SASL_FAIL); | ||
| 173 | @@ -738,11 +738,11 @@ int _sasl_conn_init(sasl_conn_t *conn, | ||
| 174 | |||
| 175 | result = sasl_setprop(conn, SASL_IPLOCALPORT, iplocalport); | ||
| 176 | if(result != SASL_OK) | ||
| 177 | - RETURN(conn, result); | ||
| 178 | + RETURN_VAL(conn, result); | ||
| 179 | |||
| 180 | result = sasl_setprop(conn, SASL_IPREMOTEPORT, ipremoteport); | ||
| 181 | if(result != SASL_OK) | ||
| 182 | - RETURN(conn, result); | ||
| 183 | + RETURN_VAL(conn, result); | ||
| 184 | |||
| 185 | conn->encode_buf = NULL; | ||
| 186 | conn->context = NULL; | ||
| 187 | @@ -787,7 +787,7 @@ int _sasl_conn_init(sasl_conn_t *conn, | ||
| 188 | |||
| 189 | if(result != SASL_OK) MEMERROR( conn ); | ||
| 190 | |||
| 191 | - RETURN(conn, SASL_OK); | ||
| 192 | + RETURN_VAL(conn, SASL_OK); | ||
| 193 | } | ||
| 194 | |||
| 195 | int _sasl_common_init(sasl_global_callbacks_t *global_callbacks) | ||
| 196 | @@ -1068,11 +1068,11 @@ int sasl_getprop(sasl_conn_t *conn, int propnum, const void **pvalue) | ||
| 197 | } else if(result == SASL_NOTDONE) { | ||
| 198 | sasl_seterror(conn, SASL_NOLOG, | ||
| 199 | "Information that was requested is not yet available."); | ||
| 200 | - RETURN(conn, result); | ||
| 201 | + RETURN_VAL(conn, result); | ||
| 202 | } else if(result != SASL_OK) { | ||
| 203 | INTERROR(conn, result); | ||
| 204 | } else | ||
| 205 | - RETURN(conn, result); | ||
| 206 | + RETURN_VAL(conn, result); | ||
| 207 | } | ||
| 208 | |||
| 209 | /* set property in SASL connection state | ||
| 210 | @@ -1146,7 +1146,7 @@ int sasl_setprop(sasl_conn_t *conn, int propnum, const void *value) | ||
| 211 | if(props->maxbufsize == 0 && props->min_ssf != 0) { | ||
| 212 | sasl_seterror(conn, 0, | ||
| 213 | "Attempt to disable security layers (maxoutbuf == 0) with min_ssf > 0"); | ||
| 214 | - RETURN(conn, SASL_TOOWEAK); | ||
| 215 | + RETURN_VAL(conn, SASL_TOOWEAK); | ||
| 216 | } | ||
| 217 | |||
| 218 | conn->props = *props; | ||
| 219 | @@ -1168,7 +1168,7 @@ int sasl_setprop(sasl_conn_t *conn, int propnum, const void *value) | ||
| 220 | } else if (_sasl_ipfromstring(ipremoteport, NULL, 0) | ||
| 221 | != SASL_OK) { | ||
| 222 | sasl_seterror(conn, 0, "Bad IPREMOTEPORT value"); | ||
| 223 | - RETURN(conn, SASL_BADPARAM); | ||
| 224 | + RETURN_VAL(conn, SASL_BADPARAM); | ||
| 225 | } else { | ||
| 226 | strcpy(conn->ipremoteport, ipremoteport); | ||
| 227 | conn->got_ip_remote = 1; | ||
| 228 | @@ -1209,7 +1209,7 @@ int sasl_setprop(sasl_conn_t *conn, int propnum, const void *value) | ||
| 229 | } else if (_sasl_ipfromstring(iplocalport, NULL, 0) | ||
| 230 | != SASL_OK) { | ||
| 231 | sasl_seterror(conn, 0, "Bad IPLOCALPORT value"); | ||
| 232 | - RETURN(conn, SASL_BADPARAM); | ||
| 233 | + RETURN_VAL(conn, SASL_BADPARAM); | ||
| 234 | } else { | ||
| 235 | strcpy(conn->iplocalport, iplocalport); | ||
| 236 | conn->got_ip_local = 1; | ||
| 237 | @@ -1302,7 +1302,7 @@ int sasl_setprop(sasl_conn_t *conn, int propnum, const void *value) | ||
| 238 | result = SASL_BADPARAM; | ||
| 239 | } | ||
| 240 | |||
| 241 | - RETURN(conn, result); | ||
| 242 | + RETURN_VAL(conn, result); | ||
| 243 | } | ||
| 244 | |||
| 245 | /* this is apparently no longer a user function */ | ||
| 246 | @@ -1708,7 +1708,7 @@ _sasl_proxy_policy(sasl_conn_t *conn, | ||
| 247 | (memcmp(auth_identity, requested_user, rlen) != 0)) { | ||
| 248 | sasl_seterror(conn, 0, | ||
| 249 | "Requested identity not authenticated identity"); | ||
| 250 | - RETURN(conn, SASL_BADAUTH); | ||
| 251 | + RETURN_VAL(conn, SASL_BADAUTH); | ||
| 252 | } | ||
| 253 | |||
| 254 | return SASL_OK; | ||
| 255 | @@ -1809,7 +1809,7 @@ int _sasl_getcallback(sasl_conn_t * conn, | ||
| 256 | *pproc = NULL; | ||
| 257 | *pcontext = NULL; | ||
| 258 | sasl_seterror(conn, SASL_NOLOG, "Unable to find a callback: %d", callbackid); | ||
| 259 | - RETURN(conn,SASL_FAIL); | ||
| 260 | + RETURN_VAL(conn,SASL_FAIL); | ||
| 261 | } | ||
| 262 | |||
| 263 | |||
| 264 | @@ -2405,10 +2405,10 @@ int sasl_listmech(sasl_conn_t *conn, | ||
| 265 | if(!conn) { | ||
| 266 | return SASL_BADPARAM; | ||
| 267 | } else if(conn->type == SASL_CONN_SERVER) { | ||
| 268 | - RETURN(conn, _sasl_server_listmech(conn, user, prefix, sep, suffix, | ||
| 269 | + RETURN_VAL(conn, _sasl_server_listmech(conn, user, prefix, sep, suffix, | ||
| 270 | result, plen, pcount)); | ||
| 271 | } else if (conn->type == SASL_CONN_CLIENT) { | ||
| 272 | - RETURN(conn, _sasl_client_listmech(conn, prefix, sep, suffix, | ||
| 273 | + RETURN_VAL(conn, _sasl_client_listmech(conn, prefix, sep, suffix, | ||
| 274 | result, plen, pcount)); | ||
| 275 | } | ||
| 276 | |||
| 277 | diff --git a/lib/saslint.h b/lib/saslint.h | ||
| 278 | index ebade78f..77fbb1b5 100644 | ||
| 279 | --- a/lib/saslint.h | ||
| 280 | +++ b/lib/saslint.h | ||
| 281 | @@ -74,22 +74,22 @@ | ||
| 282 | * memory errors. | ||
| 283 | * -Only errors (error codes < SASL_OK) should be remembered | ||
| 284 | */ | ||
| 285 | -#define RETURN(conn, val) { if(conn && (val) < SASL_OK) \ | ||
| 286 | +#define RETURN_VAL(conn, val) { if(conn && (val) < SASL_OK) \ | ||
| 287 | (conn)->error_code = (val); \ | ||
| 288 | return (val); } | ||
| 289 | #define MEMERROR(conn) {\ | ||
| 290 | if(conn) sasl_seterror( (conn), 0, \ | ||
| 291 | "Out of Memory in " __FILE__ " near line %d", __LINE__ ); \ | ||
| 292 | - RETURN(conn, SASL_NOMEM) } | ||
| 293 | + RETURN_VAL(conn, SASL_NOMEM) } | ||
| 294 | #define PARAMERROR(conn) {\ | ||
| 295 | if(conn) sasl_seterror( (conn), SASL_NOLOG, \ | ||
| 296 | "Parameter error in " __FILE__ " near line %d", __LINE__ ); \ | ||
| 297 | - RETURN(conn, SASL_BADPARAM) } | ||
| 298 | + RETURN_VAL(conn, SASL_BADPARAM) } | ||
| 299 | #define INTERROR(conn, val) {\ | ||
| 300 | if(conn) sasl_seterror( (conn), 0, \ | ||
| 301 | "Internal Error %d in " __FILE__ " near line %d", (val),\ | ||
| 302 | __LINE__ ); \ | ||
| 303 | - RETURN(conn, (val)) } | ||
| 304 | + RETURN_VAL(conn, (val)) } | ||
| 305 | |||
| 306 | #ifndef PATH_MAX | ||
| 307 | # ifdef WIN32 | ||
| 308 | diff --git a/lib/server.c b/lib/server.c | ||
| 309 | index bff461f8..4ea27643 100644 | ||
| 310 | --- a/lib/server.c | ||
| 311 | +++ b/lib/server.c | ||
| 312 | @@ -155,7 +155,7 @@ int sasl_setpass(sasl_conn_t *conn, | ||
| 313 | (current_mech == NULL) ) { | ||
| 314 | sasl_seterror( conn, SASL_NOLOG, | ||
| 315 | "No current SASL mechanism available"); | ||
| 316 | - RETURN(conn, SASL_BADPARAM); | ||
| 317 | + RETURN_VAL(conn, SASL_BADPARAM); | ||
| 318 | } | ||
| 319 | |||
| 320 | /* Do we want to store SASL_AUX_PASSWORD_PROP (plain text)? and | ||
| 321 | @@ -297,7 +297,7 @@ int sasl_setpass(sasl_conn_t *conn, | ||
| 322 | } | ||
| 323 | } | ||
| 324 | |||
| 325 | - RETURN(conn, result); | ||
| 326 | + RETURN_VAL(conn, result); | ||
| 327 | } | ||
| 328 | |||
| 329 | /* local mechanism which disposes of server */ | ||
| 330 | @@ -991,7 +991,7 @@ _sasl_transition(sasl_conn_t * conn, | ||
| 331 | NULL, 0, SASL_SET_CREATE | flags); | ||
| 332 | } | ||
| 333 | |||
| 334 | - RETURN(conn,result); | ||
| 335 | + RETURN_VAL(conn,result); | ||
| 336 | } | ||
| 337 | |||
| 338 | |||
| 339 | @@ -1367,7 +1367,7 @@ static int do_authorization(sasl_server_conn_t *s_conn) | ||
| 340 | (s_conn->user_realm ? (unsigned) strlen(s_conn->user_realm) : 0), | ||
| 341 | s_conn->sparams->propctx); | ||
| 342 | |||
| 343 | - RETURN(&s_conn->base, ret); | ||
| 344 | + RETURN_VAL(&s_conn->base, ret); | ||
| 345 | } | ||
| 346 | |||
| 347 | |||
| 348 | @@ -1484,7 +1484,7 @@ int sasl_server_start(sasl_conn_t *conn, | ||
| 349 | |||
| 350 | if (result != SASL_OK) { | ||
| 351 | /* The library will eventually be freed, don't sweat it */ | ||
| 352 | - RETURN(conn, result); | ||
| 353 | + RETURN_VAL(conn, result); | ||
| 354 | } | ||
| 355 | } | ||
| 356 | |||
| 357 | @@ -1573,7 +1573,7 @@ int sasl_server_start(sasl_conn_t *conn, | ||
| 358 | conn->oparams.doneflag = 0; | ||
| 359 | } | ||
| 360 | |||
| 361 | - RETURN(conn,result); | ||
| 362 | + RETURN_VAL(conn,result); | ||
| 363 | } | ||
| 364 | |||
| 365 | |||
| 366 | @@ -1701,7 +1701,7 @@ int sasl_server_step(sasl_conn_t *conn, | ||
| 367 | conn->oparams.doneflag = 0; | ||
| 368 | } | ||
| 369 | |||
| 370 | - RETURN(conn, ret); | ||
| 371 | + RETURN_VAL(conn, ret); | ||
| 372 | } | ||
| 373 | |||
| 374 | /* returns the length of all the mechanisms | ||
| 375 | @@ -1950,7 +1950,7 @@ static int _sasl_checkpass(sasl_conn_t *conn, | ||
| 376 | if (result != SASL_OK) | ||
| 377 | sasl_seterror(conn, SASL_NOLOG, "checkpass failed"); | ||
| 378 | |||
| 379 | - RETURN(conn, result); | ||
| 380 | + RETURN_VAL(conn, result); | ||
| 381 | } | ||
| 382 | |||
| 383 | /* check if a plaintext password is valid | ||
| 384 | @@ -1990,7 +1990,7 @@ int sasl_checkpass(sasl_conn_t *conn, | ||
| 385 | result = _sasl_canon_user(conn, user, userlen, | ||
| 386 | SASL_CU_AUTHID | SASL_CU_AUTHZID, | ||
| 387 | &(conn->oparams)); | ||
| 388 | - if(result != SASL_OK) RETURN(conn, result); | ||
| 389 | + if(result != SASL_OK) RETURN_VAL(conn, result); | ||
| 390 | user = conn->oparams.user; | ||
| 391 | |||
| 392 | /* Check the password and lookup additional properties */ | ||
| 393 | @@ -2001,7 +2001,7 @@ int sasl_checkpass(sasl_conn_t *conn, | ||
| 394 | result = do_authorization((sasl_server_conn_t *)conn); | ||
| 395 | } | ||
| 396 | |||
| 397 | - RETURN(conn,result); | ||
| 398 | + RETURN_VAL(conn,result); | ||
| 399 | } | ||
| 400 | |||
| 401 | /* check if a user exists on server | ||
| 402 | @@ -2074,7 +2074,7 @@ int sasl_user_exists(sasl_conn_t *conn, | ||
| 403 | sasl_seterror(conn, SASL_NOLOG, "no plaintext password verifier?"); | ||
| 404 | } | ||
| 405 | |||
| 406 | - RETURN(conn, result); | ||
| 407 | + RETURN_VAL(conn, result); | ||
| 408 | } | ||
| 409 | |||
| 410 | /* check if an apop exchange is valid | ||
| 411 | @@ -2136,7 +2136,7 @@ int sasl_checkapop(sasl_conn_t *conn, | ||
| 412 | if (!user_end || strspn(user_end + 1, "0123456789abcdef") != 32) | ||
| 413 | { | ||
| 414 | sasl_seterror(conn, 0, "Bad Digest"); | ||
| 415 | - RETURN(conn,SASL_BADPROT); | ||
| 416 | + RETURN_VAL(conn,SASL_BADPROT); | ||
| 417 | } | ||
| 418 | |||
| 419 | user_len = (size_t)(user_end - response); | ||
| 420 | @@ -2148,7 +2148,7 @@ int sasl_checkapop(sasl_conn_t *conn, | ||
| 421 | if(result != SASL_OK) | ||
| 422 | { | ||
| 423 | sasl_FREE(user); | ||
| 424 | - RETURN(conn, result); | ||
| 425 | + RETURN_VAL(conn, result); | ||
| 426 | } | ||
| 427 | |||
| 428 | /* erase the plaintext password */ | ||
| 429 | @@ -2163,7 +2163,7 @@ int sasl_checkapop(sasl_conn_t *conn, | ||
| 430 | &(conn->oparams)); | ||
| 431 | sasl_FREE(user); | ||
| 432 | |||
| 433 | - if(result != SASL_OK) RETURN(conn, result); | ||
| 434 | + if(result != SASL_OK) RETURN_VAL(conn, result); | ||
| 435 | |||
| 436 | /* Do APOP verification */ | ||
| 437 | result = _sasl_auxprop_verify_apop(conn, conn->oparams.authid, | ||
| 438 | @@ -2178,11 +2178,11 @@ int sasl_checkapop(sasl_conn_t *conn, | ||
| 439 | conn->oparams.authid = NULL; | ||
| 440 | } | ||
| 441 | |||
| 442 | - RETURN(conn, result); | ||
| 443 | + RETURN_VAL(conn, result); | ||
| 444 | #else /* sasl_checkapop was disabled at compile time */ | ||
| 445 | sasl_seterror(conn, SASL_NOLOG, | ||
| 446 | "sasl_checkapop called, but was disabled at compile time"); | ||
| 447 | - RETURN(conn, SASL_NOMECH); | ||
| 448 | + RETURN_VAL(conn, SASL_NOMECH); | ||
| 449 | #endif /* DO_SASL_CHECKAPOP */ | ||
| 450 | } | ||
| 451 | |||
| 452 | diff --git a/saslauthd/auth_sasldb.c b/saslauthd/auth_sasldb.c | ||
| 453 | index b6aaa393..08db1892 100644 | ||
| 454 | --- a/saslauthd/auth_sasldb.c | ||
| 455 | +++ b/saslauthd/auth_sasldb.c | ||
| 456 | @@ -51,9 +51,7 @@ | ||
| 457 | #include "../sasldb/sasldb.h" | ||
| 458 | |||
| 459 | static int | ||
| 460 | -vf(void *context __attribute__((unused)), | ||
| 461 | - char *file __attribute__((unused)), | ||
| 462 | - int type __attribute__((unused))) | ||
| 463 | +vf(void) | ||
| 464 | { | ||
| 465 | /* always say ok */ | ||
| 466 | return SASL_OK; | ||
| 467 | diff --git a/saslauthd/saslauthd-main.c b/saslauthd/saslauthd-main.c | ||
| 468 | index ca5b7256..68ffd02f 100644 | ||
| 469 | --- a/saslauthd/saslauthd-main.c | ||
| 470 | +++ b/saslauthd/saslauthd-main.c | ||
| 471 | @@ -593,7 +593,7 @@ void signal_setup() { | ||
| 472 | /************************************************************** | ||
| 473 | * Handler for SIGTERM | ||
| 474 | **************************************************************/ | ||
| 475 | - act_sigterm.sa_handler = server_exit; | ||
| 476 | + act_sigterm.sa_handler = handle_exit; | ||
| 477 | sigemptyset(&act_sigterm.sa_mask); | ||
| 478 | |||
| 479 | if (sigaction(SIGTERM, &act_sigterm, NULL) != 0) { | ||
| 480 | @@ -606,7 +606,7 @@ void signal_setup() { | ||
| 481 | /************************************************************** | ||
| 482 | * Handler for SIGINT | ||
| 483 | **************************************************************/ | ||
| 484 | - act_sigint.sa_handler = server_exit; | ||
| 485 | + act_sigint.sa_handler = handle_exit; | ||
| 486 | sigemptyset(&act_sigint.sa_mask); | ||
| 487 | |||
| 488 | if (sigaction(SIGINT, &act_sigint, NULL) != 0) { | ||
| 489 | @@ -876,7 +876,7 @@ pid_t have_baby() { | ||
| 490 | /************************************************************* | ||
| 491 | * Reap in all the dead children | ||
| 492 | **************************************************************/ | ||
| 493 | -void handle_sigchld() { | ||
| 494 | +void handle_sigchld(__attribute__((unused)) int sig) { | ||
| 495 | pid_t pid; | ||
| 496 | |||
| 497 | while ((pid = waitpid(-1, 0, WNOHANG)) > 0) { | ||
| 498 | @@ -888,11 +888,15 @@ void handle_sigchld() { | ||
| 499 | return; | ||
| 500 | } | ||
| 501 | |||
| 502 | +void handle_exit(__attribute__((unused)) int sig) { | ||
| 503 | + server_exit(); | ||
| 504 | +} | ||
| 505 | + | ||
| 506 | |||
| 507 | /************************************************************* | ||
| 508 | * Do some final cleanup here. | ||
| 509 | **************************************************************/ | ||
| 510 | -void server_exit() { | ||
| 511 | +void server_exit(void) { | ||
| 512 | |||
| 513 | /********************************************************* | ||
| 514 | * If we're not the master process, don't do anything | ||
| 515 | diff --git a/saslauthd/saslauthd-main.h b/saslauthd/saslauthd-main.h | ||
| 516 | index 754626c6..29998f03 100644 | ||
| 517 | --- a/saslauthd/saslauthd-main.h | ||
| 518 | +++ b/saslauthd/saslauthd-main.h | ||
| 519 | @@ -96,8 +96,9 @@ extern void set_mech_option(const char *); | ||
| 520 | extern void set_run_path(const char *); | ||
| 521 | extern void signal_setup(); | ||
| 522 | extern void detach_tty(); | ||
| 523 | -extern void handle_sigchld(); | ||
| 524 | -extern void server_exit(); | ||
| 525 | +extern void handle_sigchld(int sig); | ||
| 526 | +extern void handle_exit(int sig); | ||
| 527 | +extern void server_exit(void); | ||
| 528 | extern pid_t have_baby(); | ||
| 529 | |||
| 530 | /* ipc api delcarations */ | ||
diff --git a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl_2.1.28.bb b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl_2.1.28.bb index 1f4b4bf732..40e51a6a43 100644 --- a/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl_2.1.28.bb +++ b/meta-oe/recipes-networking/cyrus-sasl/cyrus-sasl_2.1.28.bb | |||
| @@ -7,16 +7,20 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396" | |||
| 7 | 7 | ||
| 8 | SRCREV = "7a6b45b177070198fed0682bea5fa87c18abb084" | 8 | SRCREV = "7a6b45b177070198fed0682bea5fa87c18abb084" |
| 9 | 9 | ||
| 10 | SRC_URI = "git://github.com/cyrusimap/cyrus-sasl;protocol=https;branch=cyrus-sasl-2.1 \ | 10 | SRC_URI = " \ |
| 11 | file://avoid-to-call-AC_TRY_RUN.patch \ | 11 | git://github.com/cyrusimap/cyrus-sasl;protocol=https;branch=cyrus-sasl-2.1 \ |
| 12 | file://debian_patches_0014_avoid_pic_overwrite.diff \ | 12 | file://avoid-to-call-AC_TRY_RUN.patch \ |
| 13 | file://0001-sample-Rename-dprintf-to-cyrus_dprintf.patch \ | 13 | file://debian_patches_0014_avoid_pic_overwrite.diff \ |
| 14 | file://saslauthd.service \ | 14 | file://0001-sample-Rename-dprintf-to-cyrus_dprintf.patch \ |
| 15 | file://saslauthd.conf \ | 15 | file://saslauthd.service \ |
| 16 | file://CVE-2019-19906.patch \ | 16 | file://saslauthd.conf \ |
| 17 | file://CVE-2022-24407.patch \ | 17 | file://CVE-2019-19906.patch \ |
| 18 | file://0001-Fix-time.h-check.patch \ | 18 | file://CVE-2022-24407.patch \ |
| 19 | " | 19 | file://0001-Fix-time.h-check.patch \ |
| 20 | file://0001-configure-prototypes.patch \ | ||
| 21 | file://0002-Fix-incompatible-pointer-types-error-with-gcc-15.patch \ | ||
| 22 | file://0003-Add-compatibility-for-gcc-15-869.patch \ | ||
| 23 | " | ||
| 20 | 24 | ||
| 21 | UPSTREAM_CHECK_URI = "https://github.com/cyrusimap/cyrus-sasl/archives" | 25 | UPSTREAM_CHECK_URI = "https://github.com/cyrusimap/cyrus-sasl/archives" |
| 22 | 26 | ||
