Your message dated Sat, 9 Oct 2021 14:45:34 +0200
with message-id <[email protected]>
and subject line Re: Bug#995049: marked as done (p11-kit: FTBFS on hurd-i386)
has caused the Debian Bug report #995049,
regarding p11-kit: FTBFS on hurd-i386
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
995049: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995049
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: p11-kit
Version: 0.24.0-2
Severity: important
Tags: patch
User: [email protected] [email protected]
Usertags: hurd

Hi,

Currently p11-kit FTBFS on GNU/Hurd due to a missing implementation in
common/unix-peer.c. Fortunately the function getpeereid() is available in the
libbsd library. The same function is also available for kFreeBSD. The patch
debian_control.diff adds a build dependency of libbsd0 for kFreeBSD and Hurd.
configure.ac.diff adds the bsd library, while common_unix_peer.diff adds the
declaration of the function getpeereid(). This is added so that the header file
bsd/unistd.h is not necessarily included (which conflicts with parts of
unistd.h).

Note that with the attached patches the patch, 41_kfreebsd_LOCAL_PEERCRED.diff,
for kFreeBSD is no longer needed.

The patches have been used to successfully build p11-kit on Linux, Hurd and
kFreeBSD.

Thanks!

Index: p11-kit-0.24.0-2.3/common/unix-peer.c
===================================================================
--- p11-kit-0.24.0-2.3.orig/common/unix-peer.c
+++ p11-kit-0.24.0-2.3/common/unix-peer.c
@@ -47,6 +47,11 @@
 #  include <ucred.h>
 #endif
 
+#ifdef HAVE_GETPEEREID
+/* Declare getpeereid from /usr/include/bsd/unistd.h */
+extern int getpeereid(int s, uid_t *euid, gid_t *egid);
+#endif
+
 /* Returns the unix domain socket peer information.
  * Returns zero on success.
  */
@@ -73,7 +78,8 @@ p11_get_upeer_id (int cfd, uid_t *uid, u
 		*pid = cr.pid;
 
 #elif defined(HAVE_GETPEEREID)
-	/* *BSD/MacOSX */
+	/* *BSD/MacOSX/kFreeBSD/Hurd */
+
 	uid_t euid;
 	gid_t egid;
 
Index: p11-kit-0.24.0-2.3/configure.ac
===================================================================
--- p11-kit-0.24.0-2.3.orig/configure.ac
+++ p11-kit-0.24.0-2.3/configure.ac
@@ -132,6 +132,16 @@ if test "$os_unix" = "yes"; then
 	AC_CHECK_FUNCS([getpeereid])
 	AC_CHECK_FUNCS([getpeerucred])
 	AC_CHECK_FUNCS([issetugid])
+	case "$host_os" in
+	kfreebsd*-gnu | gnu*)
+		have_getpeereid=no
+		AC_CHECK_LIB(bsd, getpeereid, have_getpeereid=yes)
+		if test "x$have_getpeereid" = "xyes"; then
+			AC_DEFINE([HAVE_GETPEEREID], [1], [have getpeereid])
+			AC_SEARCH_LIBS([getpeereid], [bsd])
+		fi
+	;;
+	esac
 
 	AC_CACHE_CHECK([for thread-local storage class],
 		[ac_cv_tls_keyword],
--- a/debian/control	2021-06-20 14:49:24.000000000 +0200
+++ b/debian/control	2021-09-25 01:02:28.693455906 +0200
@@ -7,7 +7,8 @@
  gtk-doc-tools,
  libffi-dev,
  libtasn1-6-dev,
- pkg-config
+ pkg-config,
+ libbsd0 [kfreebsd-any hurd-any]
 Standards-Version: 4.5.1
 Rules-Requires-Root: no
 Section: libs

--- End Message ---
--- Begin Message ---
Version: 0.24.0-5

On 2021-10-08 Svante Signell <[email protected]> wrote:
> On Fri, 2021-10-08 at 19:32 +0200, Andreas Metzler wrote:
> > # The older patch version included in the upload did not build on
> > hurd.
> > #
> > # I will re-check
> > 
> > reopen 995049

> Hello,

> The problem is that p11-kit should build-depend on libbsd-dev, not
> libbsd0, as in the latest update to the bug. The inclusion of
> bsd/unistd.h fails!

Indeed the followup upload (to unstable) has already been built on hurd
and kfreebsd. :-)

cu Andreas

--- End Message ---

Reply via email to