~kennylevinsen/seatd

e99e7d71f75394b68b581e86af4bdbdb43ee64ea — Kenny Levinsen 2 months ago e3a357b
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.
1 files changed, 1 insertions(+), 1 deletions(-)

M seatd/client.c
M seatd/client.c => seatd/client.c +1 -1
@@ 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;