Index: policykit-1-0.105/src/polkit/polkitunixprocess.c
===================================================================
--- policykit-1-0.105.orig/src/polkit/polkitunixprocess.c	2013-06-23 11:54:44.046099547 +0400
+++ policykit-1-0.105/src/polkit/polkitunixprocess.c	2013-06-23 14:44:35.778728343 +0400
@@ -33,6 +33,10 @@
 #include <string.h>
 #include <errno.h>
 #include <stdio.h>
+#include <fcntl.h>
+#ifdef HAVE_SOLARIS
+#include <procfs.h>
+#endif
 
 #include "polkitunixprocess.h"
 #include "polkitsubject.h"
@@ -513,8 +517,8 @@
 }
 
 #ifdef HAVE_SOLARIS
-static int
-get_pid_psinfo (pid_t pid, struct psinfo *ps)
+static gboolean
+get_pid_psinfo (pid_t pid, psinfo_t *ps)
 {
   char pname[32];
   int  procfd;
@@ -522,15 +526,15 @@
   (void) snprintf(pname, sizeof(pname), "/proc/%d/psinfo", pid);
   if ((procfd = open(pname, O_RDONLY)) == -1)
     {
-      return -1;
+      return FALSE;
     }
-  if (read(procfd, ps, sizeof(struct psinfo)) < 0)
+  if (read(procfd, ps, sizeof(psinfo_t)) < 0)
     {
       (void) close(procfd);
-      return -1;
+      return FALSE;
     }
   (void) close(procfd);
-  return 0;
+  return TRUE;
 }
 #endif
 
@@ -559,7 +563,8 @@
                         GError **error)
 {
   guint64 start_time;
-#ifndef HAVE_FREEBSD
+  start_time = 0;
+#ifdef HAVE_LINUX
   gchar *filename;
   gchar *contents;
   size_t length;
@@ -568,7 +573,6 @@
   gchar *p;
   gchar *endp;
 
-  start_time = 0;
   contents = NULL;
 
   filename = g_strdup_printf ("/proc/%d/stat", pid);
@@ -631,11 +635,9 @@
  out:
   g_free (filename);
   g_free (contents);
-#else
+#elif HAVE_FREEBSD
   struct kinfo_proc p;
 
-  start_time = 0;
-
   if (! get_kinfo_proc (pid, &p))
     {
       g_set_error (error,
@@ -650,6 +652,22 @@
   start_time = (guint64) p.ki_start.tv_sec;
 
 out:
+#elif HAVE_SOLARIS
+  psinfo_t p;
+  if (!get_pid_psinfo (pid, &p))
+    {
+      g_set_error (error,
+                   POLKIT_ERROR,
+                   POLKIT_ERROR_FAILED,
+                   "Error obtaining start time for %d (%s)",
+                   (gint) pid,
+                   g_strerror (errno));
+      goto out;
+    }
+  start_time = (guint64) p.pr_start.tv_sec;
+out:
+#else
+#warning Your system is not supported
 #endif
 
   return start_time;
@@ -660,24 +678,26 @@
                                 GError            **error)
 {
   gint result;
-  gchar *contents;
-  gchar **lines;
 #ifdef HAVE_FREEBSD
   struct kinfo_proc p;
-#else
+#elif HAVE_LINUX
+  gchar *contents;
+  gchar **lines;
   gchar filename[64];
   guint n;
+#elif HAVE_SOLARIS
+  psinfo_t p;
+#else
+#warning Your system is not supported
 #endif
 
   g_return_val_if_fail (POLKIT_IS_UNIX_PROCESS (process), 0);
   g_return_val_if_fail (error == NULL || *error == NULL, 0);
 
   result = 0;
-  lines = NULL;
-  contents = NULL;
 
 #ifdef HAVE_FREEBSD
-  if (get_kinfo_proc (process->pid, &p) == 0)
+  if (!get_kinfo_proc (process->pid, &p))
     {
       g_set_error (error,
                    POLKIT_ERROR,
@@ -689,7 +709,24 @@
     }
 
   result = p.ki_uid;
-#else
+out:
+#elif HAVE_SOLARIS
+  if (!get_pid_psinfo (process->pid, &p))
+    {
+      g_set_error (error,
+                   POLKIT_ERROR,
+                   POLKIT_ERROR_FAILED,
+                   "get_pid_psinfo() failed for pid %d: %s",
+                   process->pid,
+                   g_strerror (errno));
+      goto out;
+    }
+
+  result = p.pr_uid;
+out:
+#elif HAVE_LINUX
+  lines = NULL;
+  contents = NULL;
 
   /* see 'man proc' for layout of the status file
    *
@@ -731,11 +768,13 @@
                POLKIT_ERROR_FAILED,
                "Didn't find any line starting with `Uid:' in file %s",
                filename);
-#endif
-
 out:
   g_strfreev (lines);
   g_free (contents);
+#else
+#warning Your system is not supported
+#endif
+
   return result;
 }
 
Index: policykit-1-0.105/configure.ac
===================================================================
--- policykit-1-0.105.orig/configure.ac	2012-04-24 20:05:34.000000000 +0400
+++ policykit-1-0.105/configure.ac	2013-06-23 11:59:07.222669274 +0400
@@ -402,6 +402,7 @@
 dnl ---------------------------------------------------------------------------
 case "$host_os" in
   *linux*)
+	AC_DEFINE([HAVE_LINUX], 1, [Is this a Linux system?])
 	;;
   *solaris*)
 	AC_DEFINE([HAVE_SOLARIS], 1, [Is this a Solaris system?])
