$OpenBSD: patch-kdesu_kdesud_secure_cpp,v 1.1 2002/04/09 22:36:22 espie Exp $
--- kdesu/kdesud/secure.cpp.orig	Thu Mar 29 10:46:32 2001
+++ kdesu/kdesud/secure.cpp	Wed Apr 10 00:26:35 2002
@@ -42,6 +42,20 @@ SocketSecurity::SocketSecurity(int sockf
 }
 
 #else
+# if defined(HAVE_GETPEEREID)
+SocketSecurity::SocketSecurity(int sockfd)
+{
+    uid_t euid;
+    gid_t egid;
+    if (getpeereid(sockfd, &euid, &egid) == 0) {
+	cred.uid = euid;
+	cred.gid = egid;
+	cred.pid = -1;
+	ok = true;
+    }
+}
+
+# else
 
 
 /**
@@ -63,4 +77,5 @@ SocketSecurity::SocketSecurity(int sockf
     ok = true;
 }
 
+# endif
 #endif
