[metacity] Add error handling to glibtop_get_proc_uid Author: Tomaž Šolc Bug: https://bugzilla.gno me.org/show



commit 4ecd6e49164ee027cee8dfdbb51fd8389694ff43
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Jun 4 11:24:10 2014 +0300

    Add error handling to glibtop_get_proc_uid
    Author: Tomaž Šolc
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=603240

 src/core/window-props.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 3fb7d6d..608e06f 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -335,8 +335,15 @@ owner_of_process (pid_t process, uid_t *result)
       
   glibtop_get_proc_uid (&process_details, process);
 
-  *result = process_details.uid;
-  return TRUE;
+  if (process_details.flags & (1L << GLIBTOP_PROC_UID_UID))
+    {
+      *result = process_details.uid;
+      return TRUE;
+    }
+  else
+    {
+      return FALSE;
+    }
 #else
   /* I don't know, maybe we could do something hairy like see whether
    * /proc/$PID exists and who owns it, in case they have procfs.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]