mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
Use proper struct sockpeercred for SO_PEERCRED for OpenBSD
getsockopt(2) documents this; ucred is wrong ("cr_" member prefix, no pid).
This commit is contained in:
parent
a09360400b
commit
10ccdb7a41
1 changed files with 5 additions and 1 deletions
|
@ -203,7 +203,11 @@ static PeerInfo getPeerInfo(int remote)
|
|||
|
||||
#if defined(SO_PEERCRED)
|
||||
|
||||
ucred cred;
|
||||
# if defined(__OpenBSD__)
|
||||
struct sockpeercred cred;
|
||||
# else
|
||||
ucred cred;
|
||||
# endif
|
||||
socklen_t credLen = sizeof(cred);
|
||||
if (getsockopt(remote, SOL_SOCKET, SO_PEERCRED, &cred, &credLen) == -1)
|
||||
throw SysError("getting peer credentials");
|
||||
|
|
Loading…
Reference in a new issue