xfce4-taskmanager 1.0.1 Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) i686 GNU/Linux Debian Jessie xfce4-taskmanager reports UID root when 3 other programs report UID unbound. I assume this is because Unbound drops privileges from UID root to UID unbound and somehow xfce4-taskmanager does not check for that. Please fix, I spent a long time debugging Unbound for this when the problem was xfce4-taskmanager. myuser@debian:~$ grep unbound /etc/group unbound:x:125: 1. myuser@debian:~$ top -b PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 17497 unbound 20 0 16184 6980 3336 S 0.0 0.2 0:00.01 unbound 2. myuser@debian:~$ ps -u -p $(pidof unbound) USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND unbound 17497 0.0 0.1 16184 6980 ? Ss 16:53 0:00 /usr/sbin/unbound 3. myuser@debian:~$ uid=$(awk '/^Uid:/{print $2}' /proc/$(pidof unbound)/status) myuser@debian:~$ getent passwd "$uid" | awk -F: '{print $1}' unbound
Created attachment 6907 Proposed fix To get the correct UID, it should use "/proc/%d/task" but it is using "/proc/%d/stat". I have attached a patch.
Thanks for the patch, but to be honest I cannot reproduce your problem. Can you please check with the latest version of taskman or git master? (Yours is 1yr older than the latest release, which is still 2 years old.) Anyhow, I'd like to get this fixed before I push out a new release.
*** Bug 12446 has been marked as a duplicate of this bug. ***
I can reproduce the problem with taskmanager 1.2.0 (problem with suid binaries ?), and I confirm that the patch fix it ! I think it can be merged :)
Alberto Sepo referenced this bugreport in commit bd1e267062cafd4f4e2319b4df21b3352825f59d Fix incorrect UID reporting (Bug #12970) https://git.xfce.org/apps/xfce4-taskmanager/commit?id=bd1e267062cafd4f4e2319b4df21b3352825f59d
Ok, thanks for testing/reproducing!
Created attachment 7210 UID fix correctly The patch that was already committed apparently fixes the issue but using a non-documented method. My patch fixes the issue as described in "man proc". (The UID is extracted by parsing /proc/*/status not by using stat() on /proc/*/task). Also, my patch can easily be extended to also report other UIDs besides the "effective" UID: real, effective, saved set, and filesystem UIDs. That is up to the taskmanager developers to implement because I don't know GTK. RECAP: The reason why the first patch was proposed was because some programs start as root and later change to a different effective UID. Unbound is an example of such program. This was previously incorrectly reported as root by taskmanager.
I confirm that your patch works.
Crap, I missed the bugid in the commit :'( Anyway, pushed to master: https://git.xfce.org/apps/xfce4-taskmanager/commit/?id=946be336114ed84ad5d24838b4ae14a0bfc0f0fe