]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
Fix the command name for few linux processes.
authorOliver Kurth <okurth@vmware.com>
Wed, 3 Jul 2019 21:28:56 +0000 (14:28 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 3 Jul 2019 21:28:56 +0000 (14:28 -0700)
commit2660d40ca4f5beca0ba3a4c68a66f8c7dcf77a67
tree7e1307dc45f2860aa491dabfb65d0bb150bdf565
parent7aaf580b14f44a994100ede098e0ced5d60ba484
Fix the command name for few linux processes.

ProcMgr library publishes the 'command name' attribute for
each process while listing down all the processes.  For doing this,
the commandline is first parsed from /proc/<PID>/cmdline file
and the part starting from the right-most '/' is considered as the
command name.  This is OK only if we have an absolute path for the
command binary.  Other wise, this may result in incorrect results.

For example:
sshd: root@pts/1
gdm-session-worker [pam/gdm-autologin]

Fixed the code to ignore the parsing if we do not have an absolute
path.

Note: There are two ways how the command name is retrieved for each
process.

1. /proc/<PID>/cmdline is parsed.

If (1) fails for some reason, then

2. /proc/<PID>/status is parsed.

There is no issue with (2). This changeset fixes the parsing issue only
with (1) approach mentioned above.
open-vm-tools/lib/procMgr/procMgrPosix.c