]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
5 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)] 
Common header file change not applicable to open-vm-tools.

5 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)] 
Common header file change not applicable to open-vm-tools.

5 years agolib/file: memory leak in File_WalkDirectoryNext
Oliver Kurth [Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)] 
lib/file: memory leak in File_WalkDirectoryNext

During a sequence of POSIX readdir calls it is possible for a directory
to be rearranged and a file that was previously reported may be found
again.  The code that protects the caller from seeing this isn't freeing
the file name string if a duplicate is discovered.  Fix this.

5 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)] 
Common header file change not applicable to open-vm-tools.

5 years agoBack out the previous change to lib/include/str.h
Oliver Kurth [Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)] 
Back out the previous change to lib/include/str.h

5 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)] 
Common header file change not applicable to open-vm-tools.

5 years agoMore LOG() calls changed to variadic form.
Oliver Kurth [Thu, 13 Feb 2020 00:49:09 +0000 (16:49 -0800)] 
More LOG() calls changed to variadic form.

5 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Thu, 13 Feb 2020 00:49:08 +0000 (16:49 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 22 Jan 2020 19:30:44 +0000 (11:30 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoMore LOG() calls changed to variadic form.
Oliver Kurth [Wed, 22 Jan 2020 19:30:44 +0000 (11:30 -0800)] 
More LOG() calls changed to variadic form.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 22 Jan 2020 19:30:44 +0000 (11:30 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoMore LOG() calls changed to variadic form - backdoor.c
Oliver Kurth [Wed, 22 Jan 2020 19:30:44 +0000 (11:30 -0800)] 
More LOG() calls changed to variadic form - backdoor.c

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 22 Jan 2020 19:30:44 +0000 (11:30 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoMerge branch 'stable-11.0.x'
Oliver Kurth [Wed, 15 Jan 2020 22:43:51 +0000 (14:43 -0800)] 
Merge branch 'stable-11.0.x'

6 years agoprepare for 11.0.5 release stable-11.0.x stable-11.0.5
Oliver Kurth [Wed, 15 Jan 2020 22:24:15 +0000 (14:24 -0800)] 
prepare for 11.0.5 release

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Mon, 6 Jan 2020 23:46:20 +0000 (15:46 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoChanges to common header files.
Oliver Kurth [Mon, 6 Jan 2020 23:46:20 +0000 (15:46 -0800)] 
Changes to common header files.
Make ALIGNED() functional for 64-bit Windows

The current implementation of ALIGNED in vm_basic_types.h only
works for compilers that are, or pretend to be, GCC.  However,
it is reasonable to conclude that data specifically aligned
for one OS / compiler should be aligned the same way when built
with other tools or for OSes.

This change updates the ALIGNED macro to correctly function when
building on 64-bit Windows.  If not using GCC-alike, or Windows,
the macro continues to expand to nothing.

The MSVC __declspec construct accepts a limited syntax, basically
requiring an integer literal (see pciPassthruInfo_public.h).  It
must be a prefix operation.

The GCC __attribute__ is more expressive and can be postfix or
prefix, so it is moved to be prefix.

The bulk of the change moves the use of ALIGNED to be prefix in
all places that compile for the Workstation product on Windows.

6 years agoLOG_ONCE changes to variadic just as LOG did recently.
Oliver Kurth [Mon, 6 Jan 2020 23:46:20 +0000 (15:46 -0800)] 
LOG_ONCE changes to variadic just as LOG did recently.

6 years agocommon header file changes not applicable to open-vm-tools.
Oliver Kurth [Mon, 6 Jan 2020 23:46:20 +0000 (15:46 -0800)] 
common header file changes not applicable to open-vm-tools.

6 years agoTools: More support for "VMware Tools for Linux-arm64"
Oliver Kurth [Mon, 6 Jan 2020 23:46:20 +0000 (15:46 -0800)] 
Tools: More support for "VMware Tools for Linux-arm64"

Preliminary touch-ups in the main branch to support the upcoming upstreaming
of the "VMware Tools for Linux-arm64" build code.

bora-vmsoft/vgauth/service/servicePosix.c:
  The glibc on arm64 does not have <sys/io.h>.  It makes sense because I/O
  ports are an x86-ism (for more details, sees
   https://bugzilla.redhat.com/show_bug.cgi?id=1116162#c1 ).  Instead of
  making the inclusion conditions more complex, It was noticed that none
  of the symbols defined in <sys/io.h> and <sys/sysinfo.h> are used in
  this C file.  So these inclusions are not necessary.

6 years agoCommon header file change not directly applicable to open-vm-tools.
Oliver Kurth [Mon, 6 Jan 2020 23:46:19 +0000 (15:46 -0800)] 
Common header file change not directly applicable to open-vm-tools.

6 years agoRemove overly complex ifdefs in the dndcp plugin.
Oliver Kurth [Mon, 6 Jan 2020 23:46:19 +0000 (15:46 -0800)] 
Remove overly complex ifdefs in the dndcp plugin.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Mon, 6 Jan 2020 23:46:19 +0000 (15:46 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Mon, 6 Jan 2020 23:46:19 +0000 (15:46 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Mon, 6 Jan 2020 23:46:19 +0000 (15:46 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:52 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:52 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:52 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:52 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoImplement better logging for deploypkg plugin if vmware-imc cannot be created.
Oliver Kurth [Fri, 20 Dec 2019 20:25:52 +0000 (12:25 -0800)] 
Implement better logging for deploypkg plugin if vmware-imc cannot be created.

If vmware-imc cannot be created, log the error message and also redirect the
customization log to tools log.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:52 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoA previous change incorrectly deals with the capacity of file system - the
Oliver Kurth [Fri, 20 Dec 2019 20:25:52 +0000 (12:25 -0800)] 
A previous change incorrectly deals with the capacity of file system - the
file system size - and the amount of free space the file system has.

Revert the change; fix a function header; comments to make it clear
what not to break in the future.

6 years agoClean up and make consistent [trivial]
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
Clean up and make consistent [trivial]

Make the ASSERTs consitent in their coding; clean up a few things.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoFile locking depriv, part 2
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
File locking depriv, part 2

Remove the device locking code.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agocommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
common header file change not applicable to open-vm-tools.

6 years agoChanges to common source files not directly applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
Changes to common source files not directly applicable to open-vm-tools.
Depriv the file locking code, part 1

This is the first change in a series of changes toward removing the
need to be root to use the file locking code.  Here, doing some cleanup
and separate the file locking code from the device locking code.

Another later change will depriv the file locking code.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:51 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:50 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years ago[Dynbuf] Rename DynBuf_GrowToFit to DynBuf_EnsureMinSize
Oliver Kurth [Fri, 20 Dec 2019 20:25:50 +0000 (12:25 -0800)] 
[Dynbuf] Rename DynBuf_GrowToFit to DynBuf_EnsureMinSize

As suggested, GrowToFit isn't a verb, suggest renaming the function to
DynBuf_EnsureMinSize, and change the description as "Ensure that the
size of the DynBuf is at least 'size'"

Change all references of DynBuf_GrowToFit to DynBuf_EnsureMinSize.

6 years agoRemove sslDirect.c from open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:50 +0000 (12:25 -0800)] 
Remove sslDirect.c from open-vm-tools.

It is no longer needed.

6 years ago[Dynbuf] Fix minor bug in DynBuf_GrowToFit
Oliver Kurth [Fri, 20 Dec 2019 20:25:50 +0000 (12:25 -0800)] 
[Dynbuf] Fix minor bug in DynBuf_GrowToFit

DynBuf_GrowToFit tries to provide a dynbuf with size greater than the
given size.  However, the second argument passed to DynBuf_Enlarge doesn't
match the intention.  The size should be directly passed, not the
difference between the target and current size.

6 years agoTrivial - Add Copyright symbol '(c)' to tools.conf.
Oliver Kurth [Fri, 20 Dec 2019 20:25:49 +0000 (12:25 -0800)] 
Trivial - Add Copyright symbol '(c)' to tools.conf.

Missed this in the previous review.
Legal guidelines are to use '(c)' in ASCII files.

6 years agoAdd Copyright notice to bora-vmsoft/install/common/tools.conf.
Oliver Kurth [Fri, 20 Dec 2019 20:25:49 +0000 (12:25 -0800)] 
Add Copyright notice to bora-vmsoft/install/common/tools.conf.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:49 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 20 Dec 2019 20:25:49 +0000 (12:25 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoAvoid vmtoolsd crash in HostInfo.
Oliver Kurth [Wed, 11 Dec 2019 18:19:09 +0000 (10:19 -0800)] 
Avoid vmtoolsd crash in HostInfo.

The guest identification code causes vmtoolsd to crash in certain
versions of some distros.  The crash is caused by recent changes to
the lsb_release command.  Previously, if the command existed, all
of its options worked.  Now, some of the options no longer exist.

Change the code to check for an lsb_release failure whenever it is
invoked.

Fix for: https://github.com/vmware/open-vm-tools/issues/390

6 years agodndUIX11.cpp::GetLastDirName() Remove a trailing slash in a directory pathname.
Oliver Kurth [Wed, 11 Dec 2019 18:19:09 +0000 (10:19 -0800)] 
dndUIX11.cpp::GetLastDirName() Remove a trailing slash in a directory pathname.

6 years agoConfigurable environment for vmtoolsd.
Oliver Kurth [Wed, 11 Dec 2019 18:19:09 +0000 (10:19 -0800)] 
Configurable environment for vmtoolsd.

If a user wants to override(*) an environment variable e.g.
TMPDIR for vmtoolsd, the only choices for the user are:
1. Change system environment variable, that may affect more
than vmtoolsd
2. Change vmtoolsd service startup scripts on Linux.
Some of these methods, especially #2 gets overwritten by
upgrades and user is forced to re-apply the change on every
upgrade of VMTools. Also, #2 is somewhat complex due to
different type of VMTools installations and differences
in Linux distros.

We can't override the environment completely from within
service but we can configure the environment to a large
extent once vmtoolsd comes up and reads tools.conf.

*=> "override" term here applies to setting, modifying and/or
unsetting an environment variable.

This is mainly required for system service vmsvc, but
given that vmusr shares code with vmsvc, we can provide
this functionality for both.

Updated example tools.conf with the new configuration.

6 years agonicinfo: report real nameservers used when using systemd-resolved
Oliver Kurth [Wed, 11 Dec 2019 18:19:09 +0000 (10:19 -0800)] 
nicinfo: report real nameservers used when using systemd-resolved

If systemd-resolved is used, report the external DNS server, not the
locally installed one.  This is detected by checking if /etc/resolv.conf
is a link to /run/systemd/resolve/stub-resolv.conf.  In that case,
/run/systemd/resolve/resolv.conf will hold the actual DNS server.  See
https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html

6 years agoFix Coverity reported issue in dndUIX11.cpp
Oliver Kurth [Wed, 11 Dec 2019 18:19:09 +0000 (10:19 -0800)] 
Fix Coverity reported issue in dndUIX11.cpp

- unsigned_compare: This greater-than-or-equal-to-zero comparison of an
  unsigned value is always true. end >= 0UL.
 Function: GetLastDirName

6 years ago[open-vm-tools Coverity] Fix Coverity scan reported issues in copyPasteUIX11.cpp
Oliver Kurth [Wed, 11 Dec 2019 18:19:09 +0000 (10:19 -0800)] 
[open-vm-tools Coverity] Fix Coverity scan reported issues in copyPasteUIX11.cpp

- Non-static class member mHGGetListTime is not initialized in this constructor
 solution: add it into init list of constructor

- unsigned_compare: This greater-than-or-equal-to-zero comparison of an
  unsigned value is always true. end >= 0UL.
 Function: GetLastDirName

6 years agoRemove residual data when the DNS nameserver configuration changes.
Oliver Kurth [Wed, 11 Dec 2019 18:19:08 +0000 (10:19 -0800)] 
Remove residual data when the DNS nameserver configuration changes.

If the list of DNS nameservers available should shorten or both IPv4 and
IPv6 entries are present, residual data can still be available for display.
This change to nicInfoPosix.c corrects the problem.

6 years agoTools-11.0.5 - Trim trailing whitespace from log params in /etc/tools.conf.
Oliver Kurth [Wed, 11 Dec 2019 18:19:08 +0000 (10:19 -0800)] 
Tools-11.0.5 - Trim trailing whitespace from log params in /etc/tools.conf.

Remove trailing whitespace from pathnames and parameters in
tools.conf.

6 years agoAvoid securing disk device info for ZFS pools (at this time)
Oliver Kurth [Wed, 11 Dec 2019 18:19:08 +0000 (10:19 -0800)] 
Avoid securing disk device info for ZFS pools (at this time)

ZFS filesystem pools device names can appear as single directory name
at the root directory.  The current logic to locate the
/sys/class/blocks/<device> PCI structure based on typical device name
format will fail for ZFS pools.  As an immediate fix to the SIGSEGV,
avoid attempting to locate the PCI info; keep vmtoolsd running.

Addresses https://github.com/vmware/open-vm-tools/issues/378

6 years agoAvoid vmtoolsd crash in HostInfo.
Oliver Kurth [Thu, 5 Dec 2019 19:34:43 +0000 (11:34 -0800)] 
Avoid vmtoolsd crash in HostInfo.

The guest identification code causes vmtoolsd to crash in certain
versions of some distros.  The crash is caused by recent changes to
the lsb_release command.  Previously, if the command existed, all
of its options worked.  Now, some of the options no longer exist.

Change the code to check for an lsb_release failure whenever it is
invoked.

Fix for: https://github.com/vmware/open-vm-tools/issues/390

6 years agoRemove an unused variable from the "VMware Tools for Linux-Arm" build
Oliver Kurth [Thu, 5 Dec 2019 19:34:43 +0000 (11:34 -0800)] 
Remove an unused variable from the "VMware Tools for Linux-Arm" build

The gHvVendor variable is unused when building for arm64.  So move the
variable declaration next to the only x86 code which uses the variable,
and rename the variable since it is no longer global.

6 years agoIntroduce Clang SA-specific assert
Oliver Kurth [Thu, 5 Dec 2019 19:34:43 +0000 (11:34 -0800)] 
Introduce Clang SA-specific assert

Introduce an assert which would only be generated during clang SA
execution.  With it we would avoid generating extra code from
assertations which might be needed specifically for Clang SA's correct
working (even with enabled analyzer, binary wouldn't grow, as
__clang_analyzer__ is only defined while the analyzer is parsing
the files for analysis, and not during Clang's compilation).

Cases in which might be used is for example before a statement which
we are fine just to fail or to possibly silence a false positive.

A real example where we would require such assertion is for the attached
report in the review.  There seem to be a bug with the analyzer where it
will falsely ignore branches if we assert a parent class pointer before
using dynamic_cast as it will evaluate both pointers to be same.

To show more precisely, we would use helper functions from debug checker
ExprInspection.

Example 1:
745 void
746 DvsKeeper::GetMethodFault(Exception *e, Ref<MethodFault>& fault)
747 {
748    MethodFault::Exception *mfe = dynamic_cast<MethodFault::Exception *>(e);
749    clang_analyzer_warnIfReached();
750    if (mfe != nullptr) {
751       clang_analyzer_warnIfReached();
752       fault = mfe->GetFault();
753    } else {
754       clang_analyzer_warnIfReached();
755       fault = new SystemError(e->what());
756    }
757    clang_analyzer_warnIfReached();
758 }

This would generate the following warnings:
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:749:4: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:751:7: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:754:7: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:755:31: warning: Called C++ object pointer is null
fault = new SystemError(e->what());
^~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:757:4: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.

Example 2:
745 void
746 DvsKeeper::GetMethodFault(Exception *e, Ref<MethodFault>& fault)
747 {
748    ASSERT(e != nullptr);
749    MethodFault::Exception *mfe = dynamic_cast<MethodFault::Exception *>(e);
750    clang_analyzer_warnIfReached();
751    if (mfe != nullptr) {
752       clang_analyzer_warnIfReached();
753       fault = mfe->GetFault();
754    } else {
755       clang_analyzer_warnIfReached();
756       fault = new SystemError(e->what());
757    }
758    clang_analyzer_warnIfReached();
759 }
Result:
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:750:4: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:752:7: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:758:4: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.

When we do that, the whole else branch is unreachable by the analyzer,
which shouldn't be the case.

Example 3:
745 void
746 DvsKeeper::GetMethodFault(Exception *e, Ref<MethodFault>& fault)
747 {
748    ASSERT(e != nullptr);
749    MethodFault::Exception *mfe = dynamic_cast<MethodFault::Exception *>(e);
750    ASSERT(mfe == nullptr);
751    clang_analyzer_warnIfReached();
752    if (mfe != nullptr) {
753       clang_analyzer_warnIfReached();
754       fault = mfe->GetFault();
755    } else {
756       clang_analyzer_warnIfReached();
757       fault = new SystemError(e->what());
758    }
759    clang_analyzer_warnIfReached();
760 }

No warnings are generated, and 'mfe' can be null if the cast fails.

Example 4:
746 void
747 DvsKeeper::GetMethodFault(Exception *e, Ref<MethodFault>& fault)
748 {
749    ASSERT(e != nullptr);
750    MethodFault::Exception *mfe = dynamic_cast<MethodFault::Exception *>(e);
751    clang_analyzer_eval(e == mfe);
752    clang_analyzer_warnIfReached();
753    if (mfe != nullptr) {
754       clang_analyzer_warnIfReached();
755       fault = mfe->GetFault();
756    } else {
757       clang_analyzer_warnIfReached();
758       fault = new SystemError(e->what());
759    }
760    clang_analyzer_warnIfReached();
761 }
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:751:4: warning: TRUE
clang_analyzer_eval(e == mfe);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:752:4: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:754:7: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:760:4: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.

Even knowing 'e' is not a nullptr, the analyzer falsely evaluates 'e'
and 'mfe' to be the same, which leads to many other wrong assumptions.

Example 5 (What would be best way to work around this bug with least
           analyzer impact):
745 void
746 DvsKeeper::GetMethodFault(Exception *e, Ref<MethodFault>& fault)
747 {
748    MethodFault::Exception *mfe = dynamic_cast<MethodFault::Exception *>(e);
749    clang_analyzer_warnIfReached();
750    if (mfe != nullptr) {
751       clang_analyzer_warnIfReached();
752       fault = mfe->GetFault();
753    } else {
754       clang_analyzer_warnIfReached();
755       ASSERT(e != nullptr);
756       clang_analyzer_warnIfReached();
757       fault = new SystemError(e->what());
758    }
759    clang_analyzer_warnIfReached();
760 }
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:749:4: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:751:7: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:754:7: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bora/vpx/vpxd/dvs/core/dvsKeeper.cpp:759:4: warning: REACHABLE
clang_analyzer_warnIfReached();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.

In such cases, we could look into the problem as both real and analyzer
issue and other ways to "fix" it either don't work, or impact the further
work of the analyzer, which we would like to be as minimal as possible.

6 years agoLinuxDeployment.c: Temp directories are not cleaned up in the case of error.
Oliver Kurth [Thu, 5 Dec 2019 19:34:43 +0000 (11:34 -0800)] 
LinuxDeployment.c: Temp directories are not cleaned up in the case of error.

Clean up the created temporary directory if an error happens.

6 years agoAdd arm64 support in open-vm-tools
Oliver Kurth [Thu, 5 Dec 2019 19:34:43 +0000 (11:34 -0800)] 
Add arm64 support in open-vm-tools

This adds the required files and fixes to be able to build
the open-vm-tools for arm64.

One major change is the update of autoconf from 2.61 to 2.69,
with automake.  The autoconf update forced to add the libtool
include path to properly run autoreconf on the tools.  I don't
know if these AUTOCONF/AUTORECONF variables are used anywhere
else.

The open-vm-tools have been tested on debian 10 and fedora 31
VMs (thanks to Andreas Scherr).

Also fixed Hostinfo_TouchVirtualPC() which was incorrectly
testing if vm_x86_64 was defined.  It is always defined, to
either to 0 or 1.

6 years agoClean up some code in hostinfo.
Oliver Kurth [Thu, 5 Dec 2019 19:34:41 +0000 (11:34 -0800)] 
Clean up some code in hostinfo.

Remove duplicate declarations in hostinfo.h
Re-indent some lines in hostinfoPosix.c

6 years agoChange to common header file not applicable to open-vm-tools.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Change to common header file not applicable to open-vm-tools.

6 years agoChange to common header file not applicable to open-vm-tools.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Change to common header file not applicable to open-vm-tools.

6 years agoFix a resource leak issue in deployPkg
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Fix a resource leak issue in deployPkg

Variable file going out of scope in error path leaks the storage it
points to.  Added fclose before return when malloc failed.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoAdd Coverity annotations to bora/lib/file/file.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Add Coverity annotations to bora/lib/file/file.

Add annotations for Coverity-reported false positives in filePosix.c
and fileIOPosix.c.

6 years agoCode clean up in lib/file/filePosix.c
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Code clean up in lib/file/filePosix.c

Consolidate identical code in File_GetCapacity() and File_GetFreeSpace().

6 years agoAddress two Coverity-reported issues in hostinfoPosix.c.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Address two Coverity-reported issues in hostinfoPosix.c.

Rework some code with the intent of making it more straightfoward,
which also eliminates a false positive.

Check the return value from PosixUnlink and log a warning on error.

6 years agoFix a potential NULL pointer dereference in the vmbackup plugin.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
Fix a potential NULL pointer dereference in the vmbackup plugin.

In some circumtances, VmBackupAsyncCallback might dereference
gBackupState after calling VmBackupDoAbort even though the
latter function can potentially set gBackupState to NULL.  Add
a check to prevent the potential NULL pointer dereference.

6 years agoLOG() calls changed to variadic form.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
LOG() calls changed to variadic form.

6 years agoMore LOG() calls changed to variadic form.
Oliver Kurth [Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)] 
More LOG() calls changed to variadic form.

6 years agoEnable appinfo plugin for hosted products.
Oliver Kurth [Fri, 22 Nov 2019 22:52:34 +0000 (14:52 -0800)] 
Enable appinfo plugin for hosted products.

Currently, with TOT code, appInfo plugin is loaded only when
the VM is managed by VMware ESX server.  In this changeset, that
limitation is removed and the plugin will be loaded for hosted
products also.

6 years agodndUIX11.cpp::GetLastDirName() Remove a trailing slash in a directory pathname.
Oliver Kurth [Fri, 22 Nov 2019 22:52:34 +0000 (14:52 -0800)] 
dndUIX11.cpp::GetLastDirName() Remove a trailing slash in a directory pathname.

6 years agoFix Coverity reported issue time of check to time of use (TOCTOU) in deployPkg
Oliver Kurth [Fri, 22 Nov 2019 22:52:34 +0000 (14:52 -0800)] 
Fix Coverity reported issue time of check to time of use (TOCTOU) in deployPkg

Change to call mkdir directly, then check and log the error.

6 years agoLOG() calls changed to variadic form.
Oliver Kurth [Fri, 22 Nov 2019 22:52:34 +0000 (14:52 -0800)] 
LOG() calls changed to variadic form.

6 years agoAdd Coverity annotations in services/plugins/dndcp/dndGuest/rpcV4Util.cpp.
Oliver Kurth [Fri, 22 Nov 2019 22:52:34 +0000 (14:52 -0800)] 
Add Coverity annotations in services/plugins/dndcp/dndGuest/rpcV4Util.cpp.

Add Coverity annotations for false positives reported by a scan of
open-vm-tools.

6 years agoChanges to common header file not applicable to open-vm-tools.
Oliver Kurth [Fri, 22 Nov 2019 22:52:34 +0000 (14:52 -0800)] 
Changes to common header file not applicable to open-vm-tools.

6 years agoBackout previous change to lib/file/filePosix.c.
Oliver Kurth [Fri, 22 Nov 2019 22:52:31 +0000 (14:52 -0800)] 
Backout previous change to lib/file/filePosix.c.

6 years agoCommon source file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 12 Nov 2019 02:12:24 +0000 (18:12 -0800)] 
Common source file change not applicable to open-vm-tools.

6 years agoopen-vm-tools: Do not build the appInfo plugin on FreeBSD
Oliver Kurth [Tue, 12 Nov 2019 02:12:23 +0000 (18:12 -0800)] 
open-vm-tools: Do not build the appInfo plugin on FreeBSD

The appInfo plugin is supported only on Linux and Windows guests.
Modify the bora-vmsoft/install/Source/services/plugins/Makefile.am
to only include appInfo in the build if OVT is being built for a Linux
guest.

6 years agoMore LOG() calls changed to variadic form.
Oliver Kurth [Tue, 12 Nov 2019 02:12:23 +0000 (18:12 -0800)] 
More LOG() calls changed to variadic form.

6 years agoMore LOG() calls changed to variadic form.
Oliver Kurth [Tue, 12 Nov 2019 02:12:23 +0000 (18:12 -0800)] 
More LOG() calls changed to variadic form.

6 years agoMore LOG() calls changed to variadic form - dndcp plugin.
Oliver Kurth [Tue, 12 Nov 2019 02:12:23 +0000 (18:12 -0800)] 
More LOG() calls changed to variadic form - dndcp plugin.

6 years agoMore LOG() calls changed to variadic form - hgfsServer.
Oliver Kurth [Tue, 12 Nov 2019 02:12:23 +0000 (18:12 -0800)] 
More LOG() calls changed to variadic form - hgfsServer.

6 years agoCommon source file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 12 Nov 2019 02:12:23 +0000 (18:12 -0800)] 
Common source file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 12 Nov 2019 02:12:23 +0000 (18:12 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoMore LOG() calls changed to variadic form.
Oliver Kurth [Tue, 12 Nov 2019 02:12:23 +0000 (18:12 -0800)] 
More LOG() calls changed to variadic form.

6 years agoMore LOG() calls changed to variadic form.
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
More LOG() calls changed to variadic form.

6 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
Common header file change not applicable to open-vm-tools

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoFix a potentisl memory leak in an error situation; reported by Coverity.
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
Fix a potentisl memory leak in an error situation; reported by Coverity.

6 years agoFix issues of unchecked return value reported by Coverity.
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
Fix issues of unchecked return value reported by Coverity.

CID 80926 (#2 of 2): Unchecked return value (CHECKED_RETURN)
8. check_return: Calling ForkExecAndWaitCommand without checking return value

CID 80934 (#2 of 2): Unchecked return value from library (CHECKED_RETURN)
3. check_return: Calling lseek(pkgFd, 512L, 0) without checking return value.
This library function may fail and return an error code.

CID 80927 (#4 of 4): Unchecked return value from library (CHECKED_RETURN)
5. check_return: Calling fcntl(p->stdoutFd, 4, flags | 0x800) without
checking return value. This library function may fail and return an error
code.

6 years agoUse malloc everywhere in linux deploypkg plugin code
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
Use malloc everywhere in linux deploypkg plugin code

This change is replacing Util_SafeMalloc() by malloc() in Linux
deploypkg plugin code.  Also changing if statement to == NULL
or != NULL for char* type.

6 years agoConfigurable environment for vmtoolsd.
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
Configurable environment for vmtoolsd.

If a user wants to override(*) an environment variable e.g.
TMPDIR for vmtoolsd, the only choices for the user are:
1. Change system environment variable, that may affect more
than vmtoolsd
2. Change vmtoolsd service startup scripts on Linux.
Some of these methods, especially #2 gets overwritten by
upgrades and user is forced to re-apply the change on every
upgrade of VMTools. Also, #2 is somewhat complex due to
different type of VMTools installations and differences
in Linux distros.

We can't override the environment completely from within
service but we can configure the environment to a large
extent once vmtoolsd comes up and reads tools.conf.

*=> "override" term here applies to setting, modifying and/or
unsetting an environment variable.

This is mainly required for system service vmsvc, but
given that vmusr shares code with vmsvc, we can provide
this functionality for both.

Updated example tools.conf with the new configuration.

6 years agoBack out previous change for configurable environment for vmtoolsd.
Oliver Kurth [Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)] 
Back out previous change for configurable environment for vmtoolsd.

Changed checked in with commented code by mistake.
Will re-submit after uncommenting.