forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net-nds/openldap: fix more -Werror=incompatible-pointer-types cases
Signed-off-by: Robin H. Johnson <[email protected]> Closes: https://bugs.gentoo.org/show_bug.cgi?id=933875
- Loading branch information
Showing
5 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
net-nds/openldap/files/openldap-2.6.x-gnutls-pointer-error.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From 634017950c1c920d0de63fffa5c52e621de1d603 Mon Sep 17 00:00:00 2001 | ||
From: Wang Mingyu <[email protected]> | ||
Date: Wed, 26 Jun 2024 07:41:01 +0000 | ||
Subject: Fix incompatible pointer type error with gcc option | ||
-Wincompatible-pointer-types | ||
|
||
lib32-openldap do_compile failure with gcc-14: | ||
| tls_g.c:971:57: error: passing argument 4 of 'gnutls_fingerprint' from incompatible pointer type [-Wincompatible-pointer-types] | ||
| 971 | keyhash.bv_val, &keyhash.bv_len ) < 0 ) { | ||
| | ^~~~~~~~~~~~~~~ | ||
| | | | ||
| | ber_len_t * {aka long unsigned int *} | ||
| In file included from tls_g.c:44: | ||
| /usr/include/gnutls/gnutls.h:2406:32: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'ber_len_t *' {aka 'long unsigned int *'} | ||
| 2406 | size_t *result_size); | ||
| | ^~~ | ||
|
||
Upstream-Status: Submitted | ||
|
||
Signed-off-by: Wang Mingyu <[email protected]> | ||
--- | ||
libraries/libldap/tls_g.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/libraries/libldap/tls_g.c b/libraries/libldap/tls_g.c | ||
index 7c23875..b4b487d 100644 | ||
--- a/libraries/libldap/tls_g.c | ||
+++ b/libraries/libldap/tls_g.c | ||
@@ -968,7 +968,7 @@ tlsg_session_pinning( LDAP *ld, tls_session *sess, char *hashalg, struct berval | ||
keyhash.bv_len = gnutls_hash_get_len( alg ); | ||
keyhash.bv_val = LDAP_MALLOC( keyhash.bv_len ); | ||
if ( !keyhash.bv_val || gnutls_fingerprint( alg, &key, | ||
- keyhash.bv_val, &keyhash.bv_len ) < 0 ) { | ||
+ keyhash.bv_val, (size_t *)&keyhash.bv_len ) < 0 ) { | ||
goto done; | ||
} | ||
} else { | ||
-- | ||
2.34.1 | ||
|
71 changes: 71 additions & 0 deletions
71
net-nds/openldap/files/openldap-2.6.x-slapd-pointer-types.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# https://git.openldap.org/openldap/openldap/-/commit/fb9e6a81bbee880549e7ec18f0a74ddddbd2d1ab.patch | ||
From fb9e6a81bbee880549e7ec18f0a74ddddbd2d1ab Mon Sep 17 00:00:00 2001 | ||
From: Stephen Gallagher <[email protected]> | ||
Date: Tue, 6 Feb 2024 21:38:24 -0500 | ||
Subject: [PATCH] ITS#10171 - Explicitly cast private values | ||
|
||
Fixes issues with -Werror=incompatible-pointer-types | ||
|
||
Signed-off-by: Stephen Gallagher <[email protected]> | ||
--- | ||
servers/slapd/config.c | 2 +- | ||
servers/slapd/overlays/constraint.c | 2 +- | ||
servers/slapd/overlays/dyngroup.c | 2 +- | ||
servers/slapd/overlays/valsort.c | 2 +- | ||
4 files changed, 4 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/servers/slapd/config.c b/servers/slapd/config.c | ||
index 80333f359c..987c862d91 100644 | ||
--- a/servers/slapd/config.c | ||
+++ b/servers/slapd/config.c | ||
@@ -151,7 +151,7 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { | ||
int rc, arg_user, arg_type, arg_syn, iarg; | ||
unsigned uiarg; | ||
long larg; | ||
- size_t ularg; | ||
+ unsigned long ularg; | ||
ber_len_t barg; | ||
|
||
if(Conf->arg_type == ARG_IGNORED) { | ||
diff --git a/servers/slapd/overlays/constraint.c b/servers/slapd/overlays/constraint.c | ||
index f939b37762..0d6156af4d 100644 | ||
--- a/servers/slapd/overlays/constraint.c | ||
+++ b/servers/slapd/overlays/constraint.c | ||
@@ -557,7 +557,7 @@ done:; | ||
a2->restrict_filter = ap.restrict_filter; | ||
a2->restrict_val = ap.restrict_val; | ||
|
||
- for ( app = &on->on_bi.bi_private; *app; app = &(*app)->ap_next ) | ||
+ for ( app = (constraint **)&on->on_bi.bi_private; *app; app = &(*app)->ap_next ) | ||
/* Get to the end */ ; | ||
|
||
a2->ap_next = *app; | ||
diff --git a/servers/slapd/overlays/dyngroup.c b/servers/slapd/overlays/dyngroup.c | ||
index 5d890d6650..e0e70af2d9 100644 | ||
--- a/servers/slapd/overlays/dyngroup.c | ||
+++ b/servers/slapd/overlays/dyngroup.c | ||
@@ -111,7 +111,7 @@ static int dgroup_cf( ConfigArgs *c ) | ||
*/ | ||
a2 = ch_malloc( sizeof(adpair) ); | ||
|
||
- for ( app = &on->on_bi.bi_private; *app; app = &(*app)->ap_next ) | ||
+ for ( app = (adpair **)&on->on_bi.bi_private; *app; app = &(*app)->ap_next ) | ||
/* Get to the end */ ; | ||
|
||
a2->ap_mem = ap.ap_mem; | ||
diff --git a/servers/slapd/overlays/valsort.c b/servers/slapd/overlays/valsort.c | ||
index 3d998e2fcb..e251500d0b 100644 | ||
--- a/servers/slapd/overlays/valsort.c | ||
+++ b/servers/slapd/overlays/valsort.c | ||
@@ -201,7 +201,7 @@ valsort_cf_func(ConfigArgs *c) { | ||
return(1); | ||
} | ||
|
||
- for ( vip = &on->on_bi.bi_private; *vip; vip = &(*vip)->vi_next ) | ||
+ for ( vip = (valsort_info **)&on->on_bi.bi_private; *vip; vip = &(*vip)->vi_next ) | ||
/* Get to the end */ ; | ||
|
||
vi = ch_malloc( sizeof(valsort_info) ); | ||
-- | ||
GitLab | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters