[Xfce4-commits] [apps/xfce4-taskmanager] 01/01: Fix incorrect UID reporting (Bug #12970)

noreply at xfce.org noreply at xfce.org
Wed Jun 14 00:13:38 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-taskmanager.

commit bd1e267062cafd4f4e2319b4df21b3352825f59d
Author: Alberto Sepo <albertosepo at mail.com>
Date:   Wed Jun 14 00:12:36 2017 +0200

    Fix incorrect UID reporting (Bug #12970)
---
 src/task-manager-linux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/task-manager-linux.c b/src/task-manager-linux.c
index 96403cd..3242e5c 100644
--- a/src/task-manager-linux.c
+++ b/src/task-manager-linux.c
@@ -194,7 +194,7 @@ get_task_details (guint pid, Task *task)
 	gchar filename[96];
 	gchar buffer[1024];
 
-	snprintf (filename, 96, "/proc/%d/stat", pid);
+	snprintf (filename, sizeof(filename), "/proc/%d/stat", pid);
 	if ((file = fopen (filename, "r")) == NULL || fgets (buffer, 1024, file) == NULL)
 		return FALSE;
 	fclose (file);
@@ -281,6 +281,7 @@ get_task_details (guint pid, Task *task)
 		task->rss *= get_pagesize ();
 		get_cpu_percent (task->pid, jiffies_user, &task->cpu_user, jiffies_system, &task->cpu_system);
 
+		snprintf (filename, sizeof(filename), "/proc/%d/task", pid);
 		stat (filename, &sstat);
 		pw = getpwuid (sstat.st_uid);
 		task->uid = sstat.st_uid;
@@ -342,4 +343,3 @@ pid_is_sleeping (guint pid)
 
 	return (state[0] == 'T') ? TRUE : FALSE;
 }
-

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list