SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
19
sysutils/nix/patches/patch-src_nix-daemon_nix-daemon_cc
Normal file
19
sysutils/nix/patches/patch-src_nix-daemon_nix-daemon_cc
Normal file
|
@ -0,0 +1,19 @@
|
|||
Use proper struct sockpeercred for SO_PEERCRED
|
||||
|
||||
getsockopt(2) documents this; ucred is wrong ("cr_" member prefix, no pid).
|
||||
|
||||
Index: src/nix-daemon/nix-daemon.cc
|
||||
--- src/nix-daemon/nix-daemon.cc.orig
|
||||
+++ src/nix-daemon/nix-daemon.cc
|
||||
@@ -901,7 +901,11 @@ static PeerInfo getPeerInfo(int remote)
|
||||
|
||||
#if defined(SO_PEERCRED)
|
||||
|
||||
+#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…
Add table
Add a link
Reference in a new issue