Fix ucred support in openbsd

(cherry picked from commit 3adf509ac8)
v3.5.13-sru
François Andriot 10 years ago committed by Slávek Banko
parent 59e46bd1c8
commit b04a282c62

@ -717,7 +717,11 @@ bool DCOPClient::isSuspended() const
// Check whether the remote end is owned by the same user.
static bool peerIsUs(int sockfd)
{
#if defined(__OpenBSD__)
struct sockpeercred cred;
#else
struct ucred cred;
#endif
socklen_t siz = sizeof(cred);
if (getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &cred, &siz) != 0)
return false;

Loading…
Cancel
Save