]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
_dbus_read_credentials_socket: support OpenBSD
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 21 Jan 2011 13:27:18 +0000 (13:27 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 21 Jan 2011 13:27:18 +0000 (13:27 +0000)
OpenBSD SO_PEERCRED is nearly the same as Linux SO_PEERCRED, but the
struct is named differently. Sigh.

Based on a patch from 'ajacoutot'.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32542

dbus/dbus-sysdeps-unix.c

index 81040730a5fd0ed08ab1615280ad12769bb880d8..fdea63421e19658f8c30d4abfe02ddd285aec4ca 100644 (file)
@@ -1660,7 +1660,11 @@ _dbus_read_credentials_socket  (int              client_fd,
 
   {
 #ifdef SO_PEERCRED
+#ifdef __OpenBSD__
+    struct sockpeercred cr;
+#else
     struct ucred cr;
+#endif
     int cr_len = sizeof (cr);
 
     if (getsockopt (client_fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) == 0 &&