From e99e7d71f75394b68b581e86af4bdbdb43ee64ea Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Tue, 8 Dec 2020 16:38:17 +0100 Subject: client: Do not use SOL_SOCKET for LOCAL_PEERCRED This is wrong, and leads to LOCAL_PEERCRED being interpreted as SO_DEBUG. 0 should be used instead. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189. --- seatd/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seatd/client.c b/seatd/client.c index 5cacae7..edea23c 100644 --- a/seatd/client.c +++ b/seatd/client.c @@ -37,7 +37,7 @@ static int get_peer(int fd, pid_t *pid, uid_t *uid, gid_t *gid) { #elif defined(__FreeBSD__) struct xucred cred; socklen_t len = sizeof cred; - if (getsockopt(fd, SOL_SOCKET, LOCAL_PEERCRED, &cred, &len) == -1) { + if (getsockopt(fd, 0, LOCAL_PEERCRED, &cred, &len) == -1) { return -1; } *pid = -1; -- cgit v1.2.3