~kennylevinsen/seatd-devel

client: enable cr_pid on FreeBSD >= 12.3 v1 APPLIED

Jan Beich
Jan Beich: 1
 client: enable cr_pid on FreeBSD >= 12.3

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~kennylevinsen/seatd-devel/patches/21333/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] client: enable cr_pid on FreeBSD >= 12.3 Export this patch

Jan Beich
https://cgit.freebsd.org/src/commit/?id=925f44f33862908f9a2e72520a17af148c7d0db5
https://cgit.freebsd.org/src/commit/?id=2b61bda2c75f30f6eadd18fb891fd885e4c8d19d
---
 seatd/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Similar change in other projects:
https://github.com/emersion/basu/pull/35
https://reviews.freebsd.org/D29360
https://svnweb.freebsd.org/changeset/ports/568915

diff --git a/seatd/client.c b/seatd/client.c
index d0f321d..1bfe94a 100644
--- a/seatd/client.c
+++ b/seatd/client.c
@@ -40,7 +40,7 @@ static int get_peer(int fd, pid_t *pid, uid_t *uid, gid_t *gid) {
	if (getsockopt(fd, 0, LOCAL_PEERCRED, &cred, &len) == -1) {
		return -1;
	}
#if __FreeBSD_version >= 1300030
#if __FreeBSD_version >= 1300030 || (__FreeBSD_version >= 1202506 && __FreeBSD_version < 1300000)
	*pid = cred.cr_pid;
#else
	*pid = -1;
Applied, thanks!