John Wolfe [Tue, 6 Oct 2020 21:30:54 +0000 (14:30 -0700)]
Adding the vgauthImport utility to open-vm-tools.
The vmware-alias-import utility is not currently packaged with the
open-vm-tools bundle; this change adds the utility. It is built
only if vgauth is enabled.
John Wolfe [Tue, 22 Sep 2020 21:54:07 +0000 (14:54 -0700)]
Fix the exit code when toolbox-cmd disk shrink is canceled.
The toolbox-cmd disk shrink operation was exiting with status 0
when a SIGINT is received. A non-zero exit status is expected.
Change the exit code to 130, which is the appropriate value
according to TLDP: https://tldp.org/LDP/abs/html/exitcodes.html
John Wolfe [Tue, 22 Sep 2020 21:54:07 +0000 (14:54 -0700)]
Fix memory leaks in guestInfo/diskInfo.c.
When checking for IDE, SATA and SAS disk drives, the glib GMatchInfo is
passed to a g_regex_match() function inside a for loop. It was not
properly passed to g_match_info_free() before subsequently being reused.
This addresses https://github.com/vmware/open-vm-tools/issues/452
John Wolfe [Fri, 11 Sep 2020 19:11:05 +0000 (12:11 -0700)]
hostinfo.h: stop including x86cpuid.h
With the removal of Hostinfo_GetAllCpuid in an earlier change, hostinfo.h
can stop including x86cpuid.h and only needs vendor IDs from x86vendor.h.
Unfortunately, quite a few source files depended in hostinfo.h's automatic
inclusion of x86cpuid.h. Fix them to include what they need.
The lib/include/guestStats.h is a special case that happened to succeed because
of a warning that was disabled in x86cpuid.h which also happens to have
been included earlier than this header. Re-disable the warning.
John Wolfe [Fri, 11 Sep 2020 19:11:05 +0000 (12:11 -0700)]
Ensuring vmtools utilities are only used in a VMware virtual environment.
Several utilities do not check that their running environment is in a
VMware hypervisor. Add checks and generate error messages if the
running environment is a physical machine. Some makefiles were altered
o resolve dependency issues.
John Wolfe [Fri, 11 Sep 2020 19:11:04 +0000 (12:11 -0700)]
Replace a bogus URL provided in a vmcheck.c error message.
Previously the URL "http://www.vmware.com/info?id=99" appeared in
an error message in the vmware_checkvm binary to refer to VMware Tools
updating information that may change from one release to the next.
That information is now available from the single VMware Tools URL"
https://docs.vmware.com/en/VMware-Tools/index.html.
John Wolfe [Fri, 11 Sep 2020 19:11:04 +0000 (12:11 -0700)]
Get rid of more vmware_pack files.
gcc supports the Microsoft-style "pragma pack" syntax.
Standardize on it. The conversion is somewhat non-trivial,
as gcc requires "pragma" to be before or after a statement,
not in the middle.
John Wolfe [Fri, 11 Sep 2020 19:11:03 +0000 (12:11 -0700)]
Adding null check for results passed to log function.
In several files, replies/results from RPC functions can possibly be
null if the function fails. This changeset adds a function-like macro
which does the null checks and is applied to the replies when passed
into logging functions.
John Wolfe [Fri, 11 Sep 2020 19:11:03 +0000 (12:11 -0700)]
Ensure the servicediscovery plugin isn't enabled in an open-vm-tools build for non Linux OS.
The servicediscovery plugin is supported only on Linux platforms. This
change checks that this plugin is enabled only if the OS is Linux.
Otherwise, an error message is printed.
John Wolfe [Fri, 11 Sep 2020 19:11:03 +0000 (12:11 -0700)]
Get rid of vmware_pack files (devices edition)
gcc supports the Microsoft-style "pragma pack" syntax.
Standardize on it. The conversion is somewhat non-trivial,
as gcc requires "pragma" to be before or after a statement,
not in the middle.
John Wolfe [Fri, 11 Sep 2020 19:11:02 +0000 (12:11 -0700)]
LOG: Keep the LOG_LEVEL entries sorted
This is the first in a series of changes to the Log Facility that will add
the ability to have domain specific filtering (e.g. foobar domain can have
log calls which are filtered by domain (name) and level). This will make
LOG like abilities usable in all build types, even a release build.
The LOG_LEVEL entries are difficult to find since they are in a jumbled
order. The existing grouping isn't useful as many of the modules are shared.
Create one big sorted list.
John Wolfe [Fri, 11 Sep 2020 19:11:02 +0000 (12:11 -0700)]
Add --cmdfile argument
Some OSes (Windows) have a relatively small cmdline limit.
Expose a cmdfile argument which works like --cmd, but
reads the input from a file. This allows RPCs which can
have huge arguments (guestVars, namespaceDB, DataSets) to work.
John Wolfe [Wed, 19 Aug 2020 17:01:17 +0000 (10:01 -0700)]
Code cleanup to address a Coverity issue.
Coverity reports a "dereference after NULL check" in
BkdoorChannelStart. However, at the point of dereference
it's known that chan->inStarted is TRUE, which means chan->in
is guaranteed to be non-NULL, so it's not a bug.
Still, given that an input channel, if present, must have been
started before calling BkdoorChannelStart, it's possible to do
some code cleanup that will also get Coverity to stop reporting
the issue. Change what's currently a test into an ASSERT, test
chan->in rather than chan->inStarted, and add comments to make
it clearer what's going on.
John Wolfe [Wed, 19 Aug 2020 17:01:17 +0000 (10:01 -0700)]
Implement the Set_option handler in appInfo plugin.
* Add a handler for Set_option in the appInfo plugin.
The poll loop will be immediately turned off when
the feature is turned off at the host side.
The poll loop will be immediately turned on when
the feature is turned on at the host side.
* Add code to handle VM vmotion to an older host that
doesn't have logic to send 'set_option'.
* Fix some miscellaneous issues in the appinfo plugin.
Use the proper @param and @return statements in the
function documentation for AppInfoServerSetOption.
John Wolfe [Wed, 19 Aug 2020 17:01:17 +0000 (10:01 -0700)]
Pick up the LSB distro file for ALT Linux
Improve the documentation of the Linux identification routine so others
know that nothing needs to be changed in the field.
Only VMware needs to add identification codes.
John Wolfe [Wed, 19 Aug 2020 17:01:16 +0000 (10:01 -0700)]
[AppInfo] Tweak the gather loop only for a real config reload.
The poll loop for appInfo is being tweaked (destroyed and recreated)
for every tools.conf reload, even when nothing related to appinfo changed.
This may cause a few scenarios where the 'application information'
will never be collected inside the guest. Tweak the loop only when there
is a real appinfo related config change in the tools.conf file.