pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/devel/capnproto
Module Name: pkgsrc
Committed By: riastradh
Date: Fri Feb 7 13:19:30 UTC 2025
Modified Files:
pkgsrc/devel/capnproto: Makefile distinfo
Added Files:
pkgsrc/devel/capnproto/patches: patch-src_kj_async-io-unix.c++
Log Message:
devel/capnproto: Teach this to get local socket peer creds on NetBSD.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/devel/capnproto/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/devel/capnproto/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/devel/capnproto/patches/patch-src_kj_async-io-unix.c++
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/devel/capnproto/Makefile
diff -u pkgsrc/devel/capnproto/Makefile:1.7 pkgsrc/devel/capnproto/Makefile:1.8
--- pkgsrc/devel/capnproto/Makefile:1.7 Fri Feb 7 13:10:11 2025
+++ pkgsrc/devel/capnproto/Makefile Fri Feb 7 13:19:30 2025
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.7 2025/02/07 13:10:11 riastradh Exp $
+# $NetBSD: Makefile,v 1.8 2025/02/07 13:19:30 riastradh Exp $
DISTNAME= capnproto-c++-1.1.0
PKGNAME= ${DISTNAME:S/-c++-/-/}
+PKGREVISION= 1
CATEGORIES= devel
MASTER_SITES= https://capnproto.org/
Index: pkgsrc/devel/capnproto/distinfo
diff -u pkgsrc/devel/capnproto/distinfo:1.4 pkgsrc/devel/capnproto/distinfo:1.5
--- pkgsrc/devel/capnproto/distinfo:1.4 Mon Feb 3 16:59:10 2025
+++ pkgsrc/devel/capnproto/distinfo Fri Feb 7 13:19:30 2025
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.4 2025/02/03 16:59:10 adam Exp $
+$NetBSD: distinfo,v 1.5 2025/02/07 13:19:30 riastradh Exp $
BLAKE2s (capnproto-c++-1.1.0.tar.gz) = 8b8600454b8dba12e351509cd78533ec56ecdd22b101be70626757828d7ac664
SHA512 (capnproto-c++-1.1.0.tar.gz) = 11f58bcaab5a5ffbc9cabecd85e74c37cc8657392d8755709e9e2db84b37379f9084a43e922519a4f975ac0a5438811fb124f715a3a9e5f6293983eb8c3e4581
Size (capnproto-c++-1.1.0.tar.gz) = 1768797 bytes
+SHA1 (patch-src_kj_async-io-unix.c++) = b2bbb22bcb287850f8e4893ce7e2b51e4987965b
Added files:
Index: pkgsrc/devel/capnproto/patches/patch-src_kj_async-io-unix.c++
diff -u /dev/null pkgsrc/devel/capnproto/patches/patch-src_kj_async-io-unix.c++:1.1
--- /dev/null Fri Feb 7 13:19:31 2025
+++ pkgsrc/devel/capnproto/patches/patch-src_kj_async-io-unix.c++ Fri Feb 7 13:19:30 2025
@@ -0,0 +1,41 @@
+$NetBSD: patch-src_kj_async-io-unix.c++,v 1.1 2025/02/07 13:19:30 riastradh Exp $
+
+Teach capnproto how to get local socket peer identity on NetBSD.
+Resolves:
+
+ kj/async-io-test.c++:208: LocalPeerIdentity for unix socket had null UID
+ stack:
+ kj/async-io-test.c++:236: LocalPeerIdentity for unix socket had null UID
+ stack:
+ [ FAIL ] kj/async-io-test.c++:176: legacy test: AsyncIo/UnixSocket (335 μs)
+
+--- src/kj/async-io-unix.c++.orig 2024-12-21 15:52:28.000000000 +0000
++++ src/kj/async-io-unix.c++
+@@ -66,7 +66,7 @@
+ #include <sys/ucred.h>
+ #endif
+
+-#if !defined(SOL_LOCAL) && (__FreeBSD__ || __DragonflyBSD__ || __APPLE__)
++#if !defined(SOL_LOCAL) && (__FreeBSD__ || __DragonflyBSD__ || __NetBSD__ || __APPLE__)
+ // On DragonFly, FreeBSD < 12.2 and older Darwin you're supposed to use 0 for SOL_LOCAL.
+ #define SOL_LOCAL 0
+ #endif
+@@ -1728,6 +1728,18 @@ kj::Own<PeerIdentity> SocketAddress::get
+ result.pid = pid;
+ }
+ #endif
++
++#elif defined(LOCAL_PEEREID)
++ // The main public interface is getpeereid(3), but this is more
++ // convenient to slip in here without threading anything new
++ // through the AsyncIoStream abstraction.
++ struct unpcbid creds;
++ socklen_t length = sizeof(creds);
++ stream.getsockopt(SOL_LOCAL, LOCAL_PEEREID, &creds, &length);
++ KJ_ASSERT(length == sizeof(creds));
++ if (creds.unp_euid != static_cast<uid_t>(-1)) {
++ result.uid = creds.unp_euid;
++ }
+ #endif
+
+ return LocalPeerIdentity::newInstance(result);
Home |
Main Index |
Thread Index |
Old Index