Fix g_sck_get_peer_cred() on FreeBSD

Socket level should be SOL_LOCAL rather than SOL_SOCKET - See
'man unix'.
This commit is contained in:
matt335672
2022-12-15 11:45:59 +00:00
parent 1a48527df9
commit 47ace4acfd
+1 -1
View File
@@ -671,7 +671,7 @@ g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid)
unsigned int xucred_length;
xucred_length = sizeof(xucred);
if (getsockopt(sck, SOL_SOCKET, LOCAL_PEERCRED, &xucred, &xucred_length))
if (getsockopt(sck, SOL_LOCAL, LOCAL_PEERCRED, &xucred, &xucred_length))
{
return 1;
}