Univention Bugzilla – Full Text Bug Listing |
Summary: | Traceback in top module when uid is unknown | ||
---|---|---|---|
Product: | UCS | Reporter: | Dirk Wiesenthal <wiesenthal> |
Component: | UMC - Process overview | Assignee: | Johannes Keiser <keiser> |
Status: | CLOSED FIXED | QA Contact: | Florian Best <best> |
Severity: | normal | ||
Priority: | P5 | CC: | best, gohmann, klaeser, walkenhorst |
Version: | UCS 3.2 | ||
Target Milestone: | UCS 4.0-1-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
URL: | https://github.com/giampaolo/psutil/issues/547 | ||
What kind of report is it?: | --- | What type of bug is this?: | --- |
Who will be affected by this bug?: | --- | How will those affected feel about the bug?: | --- |
User Pain: | Enterprise Customer affected?: | ||
School Customer affected?: | ISV affected?: | ||
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | Bug group (optional): | Error handling, External feedback | |
Max CVSS v3 score: |
Description
Dirk Wiesenthal
2014-01-14 11:03:57 CET
(In reply to Dirk Wiesenthal from comment #0) > Anyone knows how to run a process with one's Gid as Uid? Clarification: Uids normally start with 1000, Gids with 5000. So it seems as if not the Uid, but the Gid was used as Uid. But this is only a guess. Reported again, again a Uid > 5000: Traceback: Die Ausführung des Kommandos top/query ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 178, in _response return function(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/top/__init__.py", line 63, in query listEntry['user'] = process.username File "/usr/lib/pymodules/python2.6/psutil/__init__.py", line 238, in username self._procinfo.username = pwd.getpwuid(self.uid).pw_name KeyError: 'getpwuid(): uid not found: 5109' Remark: In der UMC auf "Prozesse" geklickt. maybe there is a broken process with wrong uid: cat <<<"#include <unistd.h> int main() { setuid(12345); char* envp[1]={0}; execle("/usr/bin/python","python",(char*)0,envp); }" > fakeuid.c && gcc fakeuid.c -o fake && ./fake → UMC traceback Reported again: Ticket #2014092521000292 Reported again, 4.0-0 errata0 (Walle) Remark: Ich wollte mir eine Übersicht über die aktuell laufenden Prozesse mit dem Admin User machen. It could be that this issue has been resolved in the psutil itself:
> root@ucs-6489:~# rgrep getpwuid /usr/share/pyshared/psutil/
> /usr/share/pyshared/psutil/__init__.py: return pwd.getpwuid(self.uids.real).pw_name
I would opt for waiting for more feedback with a more recent UCS version.
(In reply to Alexander Kläser from comment #6) > It could be that this issue has been resolved in the psutil itself: → No, i don't think so. We received this traceback with UCS 4.0 which is already a never version. We can also just catch the exception without reproducing it. For the QA it can be reproduced with the script from comment #3. The UCS 4.0-0 traceback: Die Ausführung des Kommandos top/query ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/management/console/modules/__init__.py", line 176, in _decorated return function(self, request, *args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 188, in _response return function(self, request) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/top/__init__.py", line 62, in query listEntry['user'] = process.username File "/usr/lib/pymodules/python2.7/psutil/__init__.py", line 369, in username return pwd.getpwuid(self.uids.real).pw_name KeyError: 'getpwuid(): uid not found: 3000051' Reported again, 3.2-4 errata277 Reported again, 4.0-1 errata82 (Walle) It would be fixed in python-psutil "2.2.0", we currently have python-psutil "0.7.0". The behavior from psutil has been integrated into the UMC module. Fixed: r59100 univention-management-console-module-top (4.1.0-4) * Bug #33923: Use process uid as process username if the uid can not be resolved by the system. YAML: r59117 Reproduces with: cat <<<' #include <unistd.h> int main() { setuid(12345); char* envp[1]={0}; execle("/bin/cat","<b>cat</b>",(char*)0,envp); }' > fakeuid.c && gcc fakeuid.c -o fake && ./fake Fix: OK Code-Review: OK YAML: OK This was btw https://github.com/giampaolo/psutil/issues/547 Fix in psutil 2.2.0: https://github.com/giampaolo/psutil/commit/4dfb4ad8ac0f312c68bf5cececcd3fdd694fcccb |