openbsd-ports/net/ucspi-unix/patches/patch-env_c
2010-07-09 08:17:50 +00:00

17 lines
521 B
Plaintext

$OpenBSD: patch-env_c,v 1.1 2010/07/09 08:17:50 landry Exp $
--- env.c.orig Fri Jul 9 10:10:54 2010
+++ env.c Fri Jul 9 10:11:30 2010
@@ -9,7 +9,11 @@ extern const char* utoa(unsigned long);
void setup_env(int fd, const char* socket)
{
#ifdef SO_PEERCRED
- struct ucred peer;
+#ifndef __OpenBSD__
+ struct ucred peer;
+#else
+ struct sockpeercred peer;
+#endif
int optlen = sizeof(peer);
if(getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &peer, &optlen) != -1) {
setenv("UNIXREMOTEEGID", utoa(peer.gid), 1);