summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2014-06-04 11:24:10 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2014-06-04 11:24:10 +0300
commit4ecd6e49164ee027cee8dfdbb51fd8389694ff43 (patch)
tree19fc65b358cf6217a6895939c84af2dd5e4c9fcd
parent055f014bfc8b4c25bdc9d90a4fbfcd44e891e583 (diff)
downloadmetacity-4ecd6e49164ee027cee8dfdbb51fd8389694ff43.tar.gz
Add error handling to glibtop_get_proc_uid
Author: Tomaž Šolc Bug: https://bugzilla.gnome.org/show_bug.cgi?id=603240
-rw-r--r--src/core/window-props.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 3fb7d6df..608e06f3 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.