commit:     98b0490aaace089a0df45217197bca620b541968
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 25 15:50:07 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 25 15:50:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98b0490a

net-nds/gssproxy: fix build w/ C23

This needed a patch in mit-krb5 too.

Bug: https://bugs.gentoo.org/944006
Closes: https://bugs.gentoo.org/944915
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/gssproxy/files/gssproxy-0.9.2-c23.patch | 106 +++++++++++++++++++++
 net-nds/gssproxy/gssproxy-0.9.2-r1.ebuild       | 117 ++++++++++++++++++++++++
 2 files changed, 223 insertions(+)

diff --git a/net-nds/gssproxy/files/gssproxy-0.9.2-c23.patch 
b/net-nds/gssproxy/files/gssproxy-0.9.2-c23.patch
new file mode 100644
index 000000000000..12d81aff1638
--- /dev/null
+++ b/net-nds/gssproxy/files/gssproxy-0.9.2-c23.patch
@@ -0,0 +1,106 @@
+https://github.com/gssapi/gssproxy/commit/91c87d24bf844875701957f01552b674cced2ca8
+
+From 91c87d24bf844875701957f01552b674cced2ca8 Mon Sep 17 00:00:00 2001
+From: Simo Sorce <[email protected]>
+Date: Mon, 10 Feb 2025 14:55:37 -0500
+Subject: [PATCH] Change declaration of function map
+
+Newer compilers complain if funciton is declared w/o arguments,
+so we redeclare the xdrptoc_t as xdrfn and give it proper arguments
+
+Signed-off-by: Simo Sorce <[email protected]>
+---
+ rpcgen/gp_xdr.h         | 4 ++++
+ src/client/gpm_common.c | 8 ++++++--
+ src/gp_rpc_process.c    | 8 ++++++--
+ 3 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/rpcgen/gp_xdr.h b/rpcgen/gp_xdr.h
+index bbd747d0a..e7a476f3d 100644
+--- a/rpcgen/gp_xdr.h
++++ b/rpcgen/gp_xdr.h
+@@ -5,6 +5,10 @@
+ 
+ #include "gssrpc/rpc.h"
+ 
++/* Equivalent to xdrptoc_t but with proper arguments so that modern
++ * compilers do not complain */
++typedef int xdrfn(XDR *, void *);
++
+ #define xdr_u_quad_t gp_xdr_uint64_t
+ 
+ bool_t gp_xdr_uint64_t(XDR *xdrs, uint64_t *objp);
+diff --git a/src/client/gpm_common.c b/src/client/gpm_common.c
+index 22a74ab48..2c0925d05 100644
+--- a/src/client/gpm_common.c
++++ b/src/client/gpm_common.c
+@@ -676,6 +676,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union 
gp_rpc_res *res)
+     gp_rpc_msg msg;
+     XDR xdr_call_ctx = {0};
+     XDR xdr_reply_ctx = {0};
++    xdrfn *arg_fn;
++    xdrfn *res_fn;
+     char *send_buffer = NULL;
+     char *recv_buffer = NULL;
+     uint32_t send_length;
+@@ -726,7 +728,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union 
gp_rpc_res *res)
+     }
+ 
+     /* encode data */
+-    xdrok = gpm_xdr_set[proc].arg_fn(&xdr_call_ctx, (char *)arg);
++    arg_fn = gpm_xdr_set[proc].arg_fn;
++    xdrok = arg_fn(&xdr_call_ctx, arg);
+     if (!xdrok) {
+         ret = EINVAL;
+         goto done;
+@@ -765,7 +768,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union 
gp_rpc_res *res)
+     }
+ 
+     /* decode answer */
+-    xdrok = gpm_xdr_set[proc].res_fn(&xdr_reply_ctx, (char *)res);
++    res_fn = gpm_xdr_set[proc].res_fn;
++    xdrok = res_fn(&xdr_reply_ctx, res);
+     if (!xdrok) {
+         ret = EINVAL;
+     }
+diff --git a/src/gp_rpc_process.c b/src/gp_rpc_process.c
+index eaffc55eb..1ac7c167f 100644
+--- a/src/gp_rpc_process.c
++++ b/src/gp_rpc_process.c
+@@ -196,6 +196,7 @@ static int gp_rpc_decode_call(XDR *xdr_call_ctx,
+                               gp_rpc_accept_status *acc,
+                               gp_rpc_reject_status *rej)
+ {
++    xdrfn *arg_fn;
+     bool xdrok;
+     int ret;
+ 
+@@ -204,7 +205,8 @@ static int gp_rpc_decode_call(XDR *xdr_call_ctx,
+         return ret;
+     }
+ 
+-    xdrok = gp_xdr_set[*proc].arg_fn(xdr_call_ctx, (char *)arg);
++    arg_fn = gp_xdr_set[*proc].arg_fn;
++    xdrok = arg_fn(xdr_call_ctx, arg);
+     if (!xdrok) {
+         *acc = GP_RPC_GARBAGE_ARGS;
+         return EINVAL;
+@@ -283,6 +285,7 @@ static int gp_rpc_encode_reply(XDR *xdr_reply_ctx,
+                                gp_rpc_accept_status acc,
+                                gp_rpc_reject_status rej)
+ {
++    xdrfn *res_fn;
+     bool xdrok;
+     int ret;
+ 
+@@ -291,7 +294,8 @@ static int gp_rpc_encode_reply(XDR *xdr_reply_ctx,
+         return ret;
+     }
+ 
+-    xdrok = gp_xdr_set[proc].res_fn(xdr_reply_ctx, (char *)res);
++    res_fn = gp_xdr_set[proc].res_fn;
++    xdrok = res_fn(xdr_reply_ctx, res);
+ 
+     if (!xdrok) {
+         return gp_rpc_encode_reply_header(xdr_reply_ctx, xid, EINVAL,
+

diff --git a/net-nds/gssproxy/gssproxy-0.9.2-r1.ebuild 
b/net-nds/gssproxy/gssproxy-0.9.2-r1.ebuild
new file mode 100644
index 000000000000..5c938e4ca513
--- /dev/null
+++ b/net-nds/gssproxy/gssproxy-0.9.2-r1.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Daemon to proxy GSSAPI context establishment and channel handling"
+HOMEPAGE="https://github.com/gssapi/gssproxy";
+SRC_URI="https://github.com/gssapi/${PN}/releases/download/v${PV}/${P}.tar.gz";
+
+LICENSE="BSD-1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="debug selinux systemd"
+
+DEPEND="
+       >=dev-libs/libverto-0.2.2
+       >=dev-libs/ding-libs-0.6.1
+       virtual/krb5
+       selinux? ( sys-libs/libselinux )
+"
+RDEPEND="
+       ${DEPEND}
+       selinux? ( sec-policy/selinux-gssproxy )
+"
+# We need xml stuff to build the man pages, and people really want/need
+# the man pages for this package :), bug #585200
+BDEPEND="
+       app-text/docbook-xml-dtd:4.5
+       dev-libs/libxslt
+       virtual/pkgconfig
+"
+
+# Many requirements to run tests, including running slapd as root, hence
+# unfeasible.
+RESTRICT="test"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.9.2-no-git-log.patch
+       "${FILESDIR}"/${P}-docbook-upgrade.patch
+       "${FILESDIR}"/${P}-c23.patch
+)
+
+# pkg_setup() {
+#      # Here instead of flag-logic in DEPEND, since virtual/krb5 does not
+#      # allow to specify the openldap use flag, which heimdal doesn't
+#      # support.
+#      # Using mit-krb5 explicitly because heimdal doesn't install kerberos
+#      # schemata required for the tests of gss-proxy.
+#      if use test && ! has_version "app-crypt/mit-krb5[openldap]"; then
+#              eerror "Tests of this package require the kerberos schemata 
installed from app-crypt/mit-krb5[openldap]."
+#              die "Tests enabled but no app-crypt/mit-krb5[openldap] being 
installed."
+#      fi
+# }
+
+# Was required in 0.7.0 to fix the schema- and slapd-path. Reason for
+# comment: see RESTRICT comment
+# src_prepare() {
+#      default
+#      # The tests look for kerberos schemata in the documentation
+#      # directory of krb5, however these are installed in /etc/openldap
+#      # and only if the openldap useflag is supplied
+#      sed -i \
+#              -e 's#/usr/share/doc/krb5-server-ldap*#/etc/openldap/schema#' \
+#              -e 
"s#\(subprocess.Popen..\"\)slapd#\1/usr/$(get_libdir)/openldap/slapd#" \
+#              "${S}/tests/testlib.py" || die
+# }
+
+src_prepare() {
+       default
+
+       # Just for gssproxy-0.9.2-no-git-log.patch
+       eautoreconf
+}
+
+src_configure() {
+       local myeconfargs=(
+               # The build assumes localstatedir is /var and takes care of
+               # using all the right subdirs itself.
+               --localstatedir="${EPREFIX}"/var
+
+               --with-os=gentoo
+               --with-initscript=$(usex systemd systemd none)
+               $(use_with selinux)
+               $(use_with debug gssidebug)
+
+               # We already set FORTIFY_SOURCE by default along with the
+               # other bits. But setting it on each compile line interferes
+               # with efforts to try e.g. FORTIFY_SOURCE=3. So, disable it,
+               # but there's no actual difference to the safety of the binaries
+               # because of Gentoo's configuration/patches to the toolchain.
+               --without-hardening
+       )
+
+       econf "${myeconfargs[@]}"
+}
+
+src_install() {
+       default
+
+       # This is a plugin module, so no need for la file.
+       find "${ED}"/usr -name proxymech.la -delete || die
+
+       doinitd "${FILESDIR}"/gssproxy
+       insinto /etc/gssproxy
+       doins examples/*.conf
+
+       keepdir /var/lib/gssproxy
+       keepdir /var/lib/gssproxy/clients
+       keepdir /var/lib/gssproxy/rcache
+       fperms 0700 /var/lib/gssproxy/clients
+       fperms 0700 /var/lib/gssproxy/rcache
+
+       # The build installs a bunch of empty dirs, so prune them.
+       find "${ED}" -depth -type d -empty -delete || die
+}

Reply via email to