$OpenBSD: patch-kdesu_kdesud_secure_cpp,v 1.1 2002/04/08 23:12:26 espie Exp $
--- kdesu/kdesud/secure.cpp.orig	Mon Apr  8 22:47:14 2002
+++ kdesu/kdesud/secure.cpp	Mon Apr  8 22:51:26 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
