]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
Fix the 'procCmdName' attribute of process information.
authorOliver Kurth <okurth@vmware.com>
Wed, 8 May 2019 22:27:20 +0000 (15:27 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 8 May 2019 22:27:20 +0000 (15:27 -0700)
commit5b0e339cde98dce03ec5046c04ded329f61dc5ef
tree82278d4859feb7aeaac144884ca5310baa659bee
parent7b096ae277428efd8f550c1bbb35e98bb0cdf565
Fix the 'procCmdName' attribute of process information.

* When listing down the processes, /proc/{PID}/cmdline file is read
and parsed to figure out the command name.  While doing this parsing,
the terminating NUL character is not parsed.  Due to this, if any
process doesn't have any command line arguments, the 'command name' is
retrieved as NULL.

Note: This issue doesn't happen if the cmdLine has any arguments.

Ex:
/usr/bin/vmtoolsd -> 'cmdName' is retrieved as NULL
/usr/bin/vmtoolsd -n vmusr -> 'cmdName' is retrieved properly as 'vmtoolsd'

* Fixed the code to include the trailing NUL character also while parsing.
open-vm-tools/lib/procMgr/procMgrPosix.c