https://www.illumos.org/issues/6728
https://www.illumos.org/issues/5633

Glib function g_check_setuid() uses issetugid() to determine if application
is setuid. If it is setuid, dbus launcher is not executed.
But this check also fires when we use pfexec. So we revert to uid/euid comparison
here to allow applications using glib to work with dbus.

--- glib-2.82.0/glib/gutils.c.orig
+++ glib-2.82.0/glib/gutils.c
@@ -3281,7 +3281,7 @@
   if (errsv)
     g_error ("getauxval () failed: %s", g_strerror (errsv));
   return value;
-#elif defined(HAVE_ISSETUGID) && !defined(__ANDROID__)
+#elif defined(HAVE_ISSETUGID) && !defined(__ANDROID__) && !defined(__sun)
   /* BSD: http://www.freebsd.org/cgi/man.cgi?query=issetugid&sektion=2 */
 
   /* Android had it in older versions but the new 64 bit ABI does not