aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-12-08 16:38:17 +0100
committerKenny Levinsen <kl@kl.wtf>2020-12-08 16:38:17 +0100
commite99e7d71f75394b68b581e86af4bdbdb43ee64ea (patch)
tree518ce871e7fdbeda7b44449568c9b07c5d9f3c6d
parente3a357badea76a6f67f00b07c15dc67dd08be560 (diff)
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.
-rw-r--r--seatd/client.c2
1 files changed, 1 insertions, 1 deletions
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;