5886N/APatch migrated from Desktop, where it was listed as:
5886N/A# date:2010-10-20 owner:yippi type:bug bugster:6993687
5886N/A
5886N/Aaka:
5886N/A15676303 SUNBT6993687 Solaris D-Bus needs logic to recognize the "console user"
5886N/A
5886N/ASolaris-specific
5886N/A
5886N/A--- dbus-1.2.24/dbus/dbus-sysdeps-util-unix.c-orig 2010-10-19 13:27:19.672465743 -0500
5886N/A+++ dbus-1.2.24/dbus/dbus-sysdeps-util-unix.c 2010-10-19 13:28:39.691609495 -0500
5886N/A@@ -54,6 +54,10 @@
5886N/A #include <syslog.h>
5886N/A #endif
5886N/A
5886N/A+#ifdef __sun
5886N/A+#include <pwd.h>
5886N/A+#endif
5886N/A+
5886N/A #ifdef HAVE_SYS_SYSLIMITS_H
5886N/A #include <sys/syslimits.h>
5886N/A #endif
5886N/A@@ -542,8 +546,31 @@ _dbus_user_at_console (const char *usern
5886N/A
5886N/A DBusString u, f;
5886N/A dbus_bool_t result;
5886N/A+#ifdef __sun
5886N/A+ struct passwd *passwd_entry;
5886N/A+#endif
5886N/A
5886N/A result = FALSE;
5886N/A+
5886N/A+#ifdef __sun
5886N/A+ passwd_entry = getpwnam (username);
5886N/A+ if (passwd_entry != NULL)
5886N/A+ {
5886N/A+ struct stat st;
5886N/A+ uid_t uid;
5886N/A+
5886N/A+ uid = passwd_entry->pw_uid;
5886N/A+
5886N/A+ if (stat ("/dev/vt/console_user", &st) == 0 && st.st_uid == uid)
5886N/A+ {
5886N/A+ /*
5886N/A+ * Owner is allowed to take over. Before we have real
5886N/A+ * ownership in HAL, assume it's the console owner.
5886N/A+ */
5886N/A+ result = TRUE;
5886N/A+ }
5886N/A+ }
5886N/A+#else
5886N/A if (!_dbus_string_init (&f))
5886N/A {
5886N/A _DBUS_SET_OOM (error);
5886N/A@@ -568,6 +595,7 @@ _dbus_user_at_console (const char *usern
5886N/A
5886N/A out:
5886N/A _dbus_string_free (&f);
5886N/A+#endif
5886N/A
5886N/A return result;
5886N/A }