]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
7 years agoIssue: Sometimes, there is a message "The system cannot find the file
Oliver Kurth [Fri, 2 Nov 2018 22:28:20 +0000 (15:28 -0700)] 
Issue: Sometimes, there is a message "The system cannot find the file
       specified" popped up when drag and drop over multiple remote apps.

Root cause:
When drag over multiple remote apps, multiple pairs of dragEnter and
dragLeave messages are sending. The DnD state or the dropSource/dataObject
are messed up when handling the 2nd DragEnter with the 1st DragLeave at
the same time.

Solution:
Besides fixing this issue, fixed several other issues also to enhance the
handling for multiple pairs of messages in the same time:
 1. In DnDController layer, avoid to reset the DnD state when handling the
    message responded from agent for previous sessions.
 2. In agent, only set the DnD state to be Ready when the previous
    DoDragDrop is really cancelled by OLE.
 3. In agent, only response to the button event when the drop is notified.
 4. In agent, add a 2s timeout checking for cancelling process to avoid
    conflicting with another DnDThread to create dropSrouce.
 5. In agent, add a 2s timeout checking for dragBegin process to avoid
    conflicting with previous dragBegin processing.
 6. Add virtual prefix to the method "GetData".

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 2 Nov 2018 22:28:20 +0000 (15:28 -0700)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 2 Nov 2018 22:28:19 +0000 (15:28 -0700)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 2 Nov 2018 22:28:19 +0000 (15:28 -0700)] 
Common header file change not applicable to open-vm-tools.

7 years agoTools hang detector now handles slow guest.
Oliver Kurth [Fri, 2 Nov 2018 22:28:19 +0000 (15:28 -0700)] 
Tools hang detector now handles slow guest.

Tools hang detector can check its own past running history and figure
out whether itself is running slow due to a resource contention inside
the guest.

Tools hang detector shall report a different event to the VMX if the
main thread is not checking in and the tools hang detector itself is
not running frequently enough indicating the guest is running slow due
to a possible resource contention.

7 years agoMore logging improvements
Oliver Kurth [Fri, 2 Nov 2018 22:28:18 +0000 (15:28 -0700)] 
More logging improvements

vSECR doesn't want usernames going to the VMX, so remove them.

Dump cert details when xmlsec fails to add the cert to its keystore.
This can occur when the cert chain in the token has a bad cert,
or one that isn't signed by the root cert in the token's chain.
This can occur if a user has mis-configured an SSO server.

7 years agoSolaris: Synchronize between vmxnet3_tx and vmxnet3
Oliver Kurth [Fri, 2 Nov 2018 22:28:18 +0000 (15:28 -0700)] 
Solaris: Synchronize between vmxnet3_tx and vmxnet3

Vmxnet3 driver on Solaris is not properly synchronized
between vmxnet3_tx and vmxnet3_stop. When the driver
receives a stop event from the device, it doesn't
synchronize with the TX function invoked from the
networking stack before it releases the TXQ resources.
Thus, when the TX function vmxnet3_tx() is executed,
and a stop event/interrupt comes in, the TXQ may
suddenly disappear while vmxnet3_tx is still accessing
the descriptors, thus the guest OS crashes.

7 years agoHgfs FUSE Client: fix attribute caching of folders
Oliver Kurth [Fri, 2 Nov 2018 22:28:18 +0000 (15:28 -0700)] 
Hgfs FUSE Client: fix attribute caching of folders

When a directory is invalidated from the cache due to any change such as
a rename then any cached children of that parent folder should be
invalidated also.  Otherwise the cache holds stale information leading
to incorrect behavior and failing applications.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 2 Nov 2018 22:28:17 +0000 (15:28 -0700)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 2 Nov 2018 22:28:17 +0000 (15:28 -0700)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 2 Nov 2018 22:28:17 +0000 (15:28 -0700)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Fri, 2 Nov 2018 22:28:16 +0000 (15:28 -0700)] 
Common header file change not applicable to open-vm-tools.

7 years agoClear DnDPluginResetTimer on receiving SIGUSR1.
Oliver Kurth [Fri, 26 Oct 2018 17:45:00 +0000 (10:45 -0700)] 
Clear DnDPluginResetTimer on receiving SIGUSR1.

DnDPluginResetTimer callback handler DnDPluginResetSent() accesses
the RPC channel managed by the main loop. However, mainloop destroys
this channel on receiving SIGUSR1. So, we need to destroy this timer
as well when SIGUSR1 is received.

There are at least 2 ways to do it:
1. Add Linux specific code in vmCopyPasteDnDWrapper.cpp and any other
places where we need to do similar cleanup.
2. Have main loop generate a signal and do the necessary cleanup as
handling that signal.

In order to keep the code clean and also let other places/future
changes leverage the same solution, approach #2 is used here to
define and generate a new signal TOOLS_CORE_SIG_NO_RPC. Also,
implement a handler for the same in the test plugin (for testing)
and dndcp for this bug.

While there also fixed the log domain for few files that are supposed
to logging under "dndcp" domain.

7 years agoFix memory leak in deployPkg.c
Oliver Kurth [Fri, 26 Oct 2018 17:45:00 +0000 (10:45 -0700)] 
Fix memory leak in deployPkg.c

In function DeployPkg_TcloDeploy, pkgName is not freed if deployPkg failed
to submit to the thread pool.

7 years agoDevelop log APIs to fix security holes in the tools log messages.
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Develop log APIs to fix security holes in the tools log messages.

Security artifacts such as command args on the host should not be logged
in the VMX log files on the host.  This change creates APIs so that
different log messages can be used for host and guest.

Refactored the log plumbing to minimize code duplication when calling
the different implementation of logging to the vmx and logging in guest.

Fixed one instance of security issue in vmbackup, to show how to use
the new APIs.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoClear channel restart timer when RPC channel is destroyed.
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Clear channel restart timer when RPC channel is destroyed.

Vmusr main loop destroys the RPC channel when it receives SIGUSR1.
However, it may have left the restart timer around that would end
up accessing the destroyed channel structure. So, we destroy the
timer along with the RPC channel to be safe.

7 years agoTools Windows Drivers: split header for reporting versions
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Tools Windows Drivers: split header for reporting versions

The rpcvmx.h header file has been split to allow some tools drivers to
report their versions to the VMX while limiting the number of RPC APIs that are exposed to the drivers like VMCI and Csock.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoinclude log.h to workaround missing g_info() in glib
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
include log.h to workaround missing g_info() in glib

Older versions of glib (< 2.40) do not have g_info(). There
is a workaround in vmware/tools/log.h, but it wasn't included in
toolsHangDetector.c.

7 years agoAdd some sanity checks in vgauth/common/certverify.c
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Add some sanity checks in vgauth/common/certverify.c

Add some sanity checks in cert chain verify callback.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:59 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years ago[AsyncSocket] Replace 'Bool safeAccess' parameter with 'DWORD accessType' in AsyncSoc...
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
[AsyncSocket] Replace 'Bool safeAccess' parameter with 'DWORD accessType' in AsyncSocket_CreateNamedPipe.

So that callers can select wanted access control.

7 years agoImplement tools hang detection logic
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
Implement tools hang detection logic

Create a dedicated detector thread. The thread sits in a loop and
wakes up periodically to decrement an atomic counter. Also schedules
a checkin timer with the main loop to reset the counter periodically.

If the counter ever drops to/below zero, the tools hang is detected,
and a tools hang event is generated. Otherwise, if there was a hang,
but the counter has now come back up to positive, a tools recovery
event is generated.

In order to properly create hang and recovery event, previous state
needs to be tracked.

In order to properly handle shutdown, we need a condition variable so
that the detector thread can wake up on it while sleeping. This is
because the toolsd calls the thread pool shutdown function which
in turn calls each thread's terminate function and wait for the threads
to quit. Therefore, our terminate function shall wake up the detector
thread and make it quit. Otherwise, the toolsd shutdown shall hang.

Next change shall implement the new RPCI command to send the
hang/recovery event to VMX.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoCommon header file change not directly applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
Common header file change not directly applicable to open-vm-tools

[ghi messages over MKSControl] Add a new return type for UI -> MKS message.
So that the MKS side can send utf8 string error message to the UI side.

7 years agoUse bitwise AND operation while fetching current IOPL.
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
Use bitwise AND operation while fetching current IOPL.

Iopl_Get() was using logical AND operation which could result
in wrong IOPL value. We should be using bitwise AND instead.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoChanges to common header files not directly applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:58 +0000 (10:44 -0700)] 
Changes to common header files not directly applicable to open-vm-tools

7 years agoHgfs FUSE Client: fix missing pthread_mutex_unlock call
Oliver Kurth [Fri, 26 Oct 2018 17:44:57 +0000 (10:44 -0700)] 
Hgfs FUSE Client: fix missing pthread_mutex_unlock call

Fix missing pthread_mutex_unlock call in HgfsSetAttrCache when
updating the cached attributes on a file and a memory allocation
fails.

7 years agoHgfs Server Linux: fix the share permissions on a file rename or delete
Oliver Kurth [Fri, 26 Oct 2018 17:44:57 +0000 (10:44 -0700)] 
Hgfs Server Linux: fix the share permissions on a file rename or delete

Coverity found that the argumeents to obtain the share permissions
on a file rename were swapped. Even though they are tested together
in an if statement which is not an issue, it could be in the future.

Reverse arguments so the share read and write permissions are correct.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:57 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoUpdate the copyright year for OVT bundled files modified since 10.3.2
Oliver Kurth [Fri, 26 Oct 2018 17:44:57 +0000 (10:44 -0700)] 
Update the copyright year for OVT bundled files modified since 10.3.2

7 years agoHandle Linux kernel /proc FS uint32 type stat overflow when calculating tools rate...
Oliver Kurth [Fri, 26 Oct 2018 17:44:57 +0000 (10:44 -0700)] 
Handle Linux kernel /proc FS uint32 type stat overflow when calculating tools rate stats.

On both 32-bit and 64-bit Linux, tools always parses Linux kernel /proc FS
stats as uint64 values. For rate stats, current - previous can handle uint64
type stat overflow, but not uint32 type.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:57 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoAccomodate kmem_malloc() and kmem_free() changes in FreeBSD 12
Oliver Kurth [Fri, 26 Oct 2018 17:44:57 +0000 (10:44 -0700)] 
Accomodate kmem_malloc() and kmem_free() changes in FreeBSD 12

The kmem_alloc() and kmem_free() APIs have been changed in the
upcoming FreeBSD 12.0 release.   The change was to drop the now
unused arena parameter from both functions.

This fix defines and uses several macros whose definitions are
specific to FreeBSD version 10, 11 and 12 kernel memory API changes.

Github open-vm-tools pull request from Josh Paetzel.
https://github.com/vmware/open-vm-tools/pull/286

7 years agoChanges to common source files not directly applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:57 +0000 (10:44 -0700)] 
Changes to common source files not directly applicable to open-vm-tools

7 years agoAdd some more VMX logging
Oliver Kurth [Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)] 
Add some more VMX logging

Add some more key logging to the VMX; also put [vgauthservice] into
messages for easier grep filtering.

7 years agoCommon source file change not directly applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)] 
Common source file change not directly applicable to open-vm-tools

On ESXi, AF_PACKET family is reported for vmk* interfaces only and its
ifa_flags is reported as 0, so do not check for IFF_UP/IFF_LOOPBACK.

7 years agoCommon header files changes not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)] 
Common header files changes not applicable to open-vm-tools

7 years agoTools: More clean up from the guest mapping changes
Oliver Kurth [Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)] 
Tools: More clean up from the guest mapping changes

A few more places to improve the code.

7 years agoCommon header file change not directly applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)] 
Common header file change not directly applicable to open-vm-tools

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoFix Guest RPC Channel clean up memory leak on the guest side.
Oliver Kurth [Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)] 
Fix Guest RPC Channel clean up memory leak on the guest side.

The RpcChannel_Destroy() is leaking the memory on the outLock.
Refactored the code so that RpcChannel_Shutdown() matches the
RpcChannel_Setup() if invoked, and RpcChannel_Destroy() just calls
RpcChannel_Shutdown()

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoToolsCore_GetVmusrLimit(): use app name from ToolsServiceState struct
Oliver Kurth [Fri, 26 Oct 2018 17:44:55 +0000 (10:44 -0700)] 
ToolsCore_GetVmusrLimit(): use app name from ToolsServiceState struct

The vmusr process on Windows is calling ToolsCore_GetVmusrLimit() early
in the process before ToolsCore_Setup() is called to initialize the
ctx member.  In ToolsCore_GetVmusrLimit(), changing the call to
VMTools_ConfigGetInteger to use "state->name" instead of the
state->ctx.name.

7 years agoIncorporate the RpcChannel failure count in the warning message
Oliver Kurth [Fri, 26 Oct 2018 17:44:55 +0000 (10:44 -0700)] 
Incorporate the RpcChannel failure count in the warning message

The RpcChannel failure limit can be adjusted by the user.  Capturing
the failure count reached when a "permanent" channel failure is
being logged.

7 years agoAllow only a single instance of vmusr when multiple users are logged into a VM
Oliver Kurth [Fri, 26 Oct 2018 17:44:55 +0000 (10:44 -0700)] 
Allow only a single instance of vmusr when multiple users are logged into a VM

When a vmusr process gets the "channel conflict" error while attempting
to open the toolbox-dnd channel, a channel reset is triggered.  That
reset results in the channel being restarted and a subsequent conflict
and reset occurs - every second until the channel becomes available.

For *nix guests:
The fix is making use of the repetitive channel resets where the only
RpcIn message received is a "reset" to catch this channel "permanently"
unavailable state.  If other RpcIn messages are received, a channel
is considered to be working and the cumulative error count is cleared..

lib/rpcin/rpcin.c:
- struct RpcIn: Added error status boolean and callback function to
notify the dependent layer that a channel error has been
resolved.
- RpcInLoop(): If a non "reset" message is received, clear any channel
error status.  This will also notify the dependent layer
that the channel is functioning.
- RpcIn_start(): Added additional argument for new callback; NULL if
not needed.

lib/rpcChannel/rpcChannel.c:
- struct rpcChannelInt:
- Renamed "rpcErrorCount" to "rpcResetErrorCount" since it is actually
a count of the consecutive channel reset failures and not a count
of RpcChannel errors.
- Added counter "rpcFailureCount" for the cumulative channel errors.
- Added "rpcFailureCb" for optional callback to notify the app of a
"permanent" channel failure.
- New function RpcChannelClearError() for RpcIn to notify when the
channel is working; to clear the rpcFailureCount .
- RpcChannel_Setup() - added two arguments for (1) an optional function
to be called when there is a channel failure
and (2) a failure count threshold.
These optional values are stored in the
RpcChannel structure being created.
- RpcChannelError(): Added logic to notify the calling app if the error
threshold has been reached and notify the app if a
callback was provided. A zero threshold signifies
the single vmusr limit should not be enforced.
(fix disable switch).

services/vmtoolsd/mainLoop.c:
- New function ToolsCore_GetVmusrLimit() to retrieve the channel error
threshold default or over-ride from tools.conf.

services/vmtoolsd/toolsRpc.c:
- Added ToolsCoreAppChannelFail(): Callback for "permanent" channel
connection failure.  A warning is logged based on whether another
"vmtoolsd -n vmusr" is running or not and the process is terminated.
On Mac OS, the process is terminated with exit(1) as an indication
to launchd that the vmusr process should not automatically be
restarted.

The current implementation uses the error callback only for the vmusr
server on Linux (*nix).
The default channel error limit is 5 (approx. 5 second), but is user
configurable in tools.conf.

[vmusr]
maxChannelAttempts = n    # where allowed n = 0, 3-15

When "maxChannelAttempts = 0" is used, the restriction to a single
running vmusr process is not enforced.   The existing behavior is
restored with all the accompanying VMX log spew.  This is essentially
a user configurable feature disablement switch.

7 years agoCommon source file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:55 +0000 (10:44 -0700)] 
Common source file change not applicable to open-vm-tools

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:55 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoRemove vmxnet and vmxnet3 drivers from FreeBSD builds and open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:55 +0000 (10:44 -0700)] 
Remove vmxnet and vmxnet3 drivers from FreeBSD builds and open-vm-tools

The vmxnet (version 1) network driver is not supported by any currently
supported VMware virtualization platform. Removing the FreeBSD
specific vmxnet source and deleting the vmxnet.ko driver build from
the tools and the open-vm-tools builds.

FreeBSD has their own vmxnet3 network driver based on community source
and has never made use of the vmxnet3 source code or drivers from
VMware.  Removing the unneeded FreeBSD vmxnet3 source and builds

7 years agoAdd virbr* interfaces on RHEL to default exclude-nics.
Oliver Kurth [Fri, 26 Oct 2018 17:44:54 +0000 (10:44 -0700)] 
Add virbr* interfaces on RHEL to default exclude-nics.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Fri, 26 Oct 2018 17:44:54 +0000 (10:44 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoUse bitwise AND operation while fetching current IOPL.
Oliver Kurth [Fri, 5 Oct 2018 20:55:27 +0000 (13:55 -0700)] 
Use bitwise AND operation while fetching current IOPL.

Iopl_Get() was using logical AND operation which could result
in wrong IOPL value. We should be using bitwise AND instead.

7 years agoOptional override for short and long OS names sent from Tools
Oliver Kurth [Fri, 5 Oct 2018 20:55:27 +0000 (13:55 -0700)] 
Optional override for short and long OS names sent from Tools

Added support for customers to override the returned long and short OS
names through the tools config file. If the setting is present, then names
gathered by hostinfo will be ignored. The user is responsible for setting
the appropriate names.

The override will be ignored if the short-name setting is not present in
tools.conf.

An empty string will be sent for the long OS name if only the short-name
setting is present.

Appropriate warning msg will be generated in both cases.

Example of the conf setting:

[guestosinfo]
short-name = centos6-64
long-name = some long name

7 years agoHgfs Server Linux: fix the share permissions on a file rename or delete
Oliver Kurth [Mon, 17 Sep 2018 23:41:19 +0000 (16:41 -0700)] 
Hgfs Server Linux: fix the share permissions on a file rename or delete

Coverity found that the argumeents to obtain the share permissions
on a file rename were swapped. Even though they are tested together
in an if statement which is not an issue, it could be in the future.

Reverse arguments so the share read and write permissions are correct.

7 years agoHgfs FUSE Client: fix missing pthread_mutex_unlock call
Oliver Kurth [Mon, 17 Sep 2018 23:41:18 +0000 (16:41 -0700)] 
Hgfs FUSE Client: fix missing pthread_mutex_unlock call

Fix missing pthread_mutex_unlock call in HgfsSetAttrCache when
updating the cached attributes on a file and a memory allocation
fails.

7 years agoBump up the SYSIMAGE_VERSION for VMware Tools 10.3.5
Oliver Kurth [Mon, 17 Sep 2018 23:41:18 +0000 (16:41 -0700)] 
Bump up the SYSIMAGE_VERSION for VMware Tools 10.3.5

7 years agoUpdate the copyright year for OVT bundled files modified since 10.3.2
Oliver Kurth [Mon, 17 Sep 2018 23:41:18 +0000 (16:41 -0700)] 
Update the copyright year for OVT bundled files modified since 10.3.2

7 years agoHandle Linux kernel /proc FS uint32 type stat overflow when calculating
Oliver Kurth [Mon, 17 Sep 2018 23:41:18 +0000 (16:41 -0700)] 
Handle Linux kernel /proc FS uint32 type stat overflow when calculating
tools rate stats.

On both 32-bit and 64-bit Linux, tools always parses Linux kernel /proc
FS stats as uint64 values.  For rate stats, current - previous can handle
uint64 type stat overflow, but not uint32 type.

7 years agonicinfo: skip loopback devices
Oliver Kurth [Mon, 17 Sep 2018 23:41:18 +0000 (16:41 -0700)] 
nicinfo: skip loopback devices

When libdnet isn't used, loopback devices were reported. This change
skips these interfaces. Also skip interfaces that are down.

The interface was visible with vim-cmd, but not in the VC or
ESX UI. It did not contain any IP addresses.

7 years agoAllow only a single instance of vmusr when multiple users are logged into a VM
Oliver Kurth [Mon, 17 Sep 2018 23:41:18 +0000 (16:41 -0700)] 
Allow only a single instance of vmusr when multiple users are logged into a VM

When a vmusr process gets the "channel conflict" error while attempting
to open the toolbox-dnd channel, a channel reset is triggered.  That
reset results in the channel being restarted and a subsequent conflict
and reset occurs - every second until the channel becomes available.

For *nix guests:
The fix is making use of the repetitive channel resets where the only
RpcIn message received is a "reset" to catch this channel "permanently"
unavailable state.  If other RpcIn messages are received, a channel
is considered to be working and the cumulative error count is cleared..

lib/rpcin/rpcin.c:
- struct RpcIn: Added error status boolean and callback function to
                notify the dependent layer that a channel error has been
                resolved.
- RpcInLoop(): If a non "reset" message is received, clear any channel
               error status.  This will also notify the dependent layer
               that the channel is functioning.
- RpcIn_start(): Added additional argument for new callback; NULL if
                 not needed.

lib/rpcChannel/rpcChannel.c:
- struct rpcChannelInt:
  - Renamed "rpcErrorCount" to "rpcResetErrorCount" since it is actually
    a count of the consecutive channel reset failures and not a count
    of RpcChannel errors.
  - Added counter "rpcFailureCount" for the cumulative channel errors.
  - Added "rpcFailureCb" for optional callback to notify the app of a
    "permanent" channel failure.
- New function RpcChannelClearError() for RpcIn to notify when the
  channel is working; to clear the rpcFailureCount .
- RpcChannel_Setup() - added two arguments for (1) an optional function
                       to be called when there is a channel failure
                       and (2) a failure count threshold.
                       These optional values are stored in the
                       RpcChannel structure being created.
- RpcChannelError(): Added logic to notify the calling app if the error
                     threshold has been reached and notify the app if a
                     callback was provided. A zero threshold signifies
                     the single vmusr limit should not be enforced.
                     (fix disable switch).

services/vmtoolsd/mainLoop.c:
- New function ToolsCore_GetVmusrLimit() to retrieve the channel error
  threshold default or over-ride from tools.conf.

services/vmtoolsd/toolsRpc.c:
- Added ToolsCoreAppChannelFail(): Callback for "permanent" channel
  connection failure.  A warning is logged based on whether another
  "vmtoolsd -n vmusr" is running or not and the process is terminated.
  On Mac OS, the process is terminated with exit(1) as an indication
  to launchd that the vmusr process should not automatically be
  restarted.

The current implementation uses the error callback only for the vmusr
server on Linux (*nix).
The default channel error limit is 5 (approx. 5 second), but is user
configurable in tools.conf.

   [vmusr]
   maxChannelAttempts = n    # where allowed n = 0, 3-15

When "maxChannelAttempts = 0" is used, the restriction to a single
running vmusr process is not enforced.   The existing behavior is
restored with all the accompanying VMX log spew.  This is essentially
a user configurable feature disablement switch.

7 years agoChanges to common header files not directly applicable to open-vm-tools
Oliver Kurth [Mon, 17 Sep 2018 23:41:17 +0000 (16:41 -0700)] 
Changes to common header files not directly applicable to open-vm-tools

VGAuth Windows: fix file properties product version and file version

Product name of the VGAuth binaries are set to VMware Workstation and
the Product version set to experimental (e.x.p).

Experimental version has the e.x.p build number in the Product Version
field of each of the shipped binaries. Now that we are WHQL signing a DLL too
for security it does make sense for the feature to use an official version.

This changes the Product name and version fields from
Product name -> VMware Workstation
Product version -> e.x.p build-4013326

to
Product name -> VMware Guest Authentication
Product version -> 1.0.0 build-4013326

7 years agoRemove vmxnet and vmxnet3 drivers from FreeBSD builds and open-vm-tools
Oliver Kurth [Fri, 7 Sep 2018 22:53:28 +0000 (15:53 -0700)] 
Remove vmxnet and vmxnet3 drivers from FreeBSD builds and open-vm-tools

The vmxnet (version 1) network driver is not supported by any currently
supported VMware virtualization platform. Removing the FreeBSD
specific vmxnet source and deleting the vmxnet.ko driver build from
the tools and the open-vm-tools builds.

FreeBSD has their own vmxnet3 network driver based on community source
and has never made use of the vmxnet3 source code or drivers from
VMware.  Removing the unneeded FreeBSD vmxnet3 source and builds

7 years agoUpdate SSL configuration with more secure settings.
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Update SSL configuration with more secure settings.

Due to SSL issues in the past, The preference is to have default
settings to be more secure than compatible.  This change mainly
inherits the default settings from ssl.c.

7 years agoAdd virbr* interfaces on RHEL to the default exclude-nics.
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Add virbr* interfaces on RHEL to the default exclude-nics.

7 years agoFix a gcc-8 compiler warning in lib/misc/vthreadBase.c
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Fix a gcc-8 compiler warning in lib/misc/vthreadBase.c

gcc-8 generates a stringop-truncation warning when it's possible
for strncpy to exclude the trailing nul.  The code was fine, we never
touch the last byte in the buffer and it's a static, but explicitly
set a nul at the end of the buffer so gcc sees it.

This is needed for open-vm-tools to build on Suse Tumbleweed.

7 years agoReturn proper vix error code when guest op VIX_COMMAND_DELETE_GUEST_DIRECTORY_EX...
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Return proper vix error code when guest op VIX_COMMAND_DELETE_GUEST_DIRECTORY_EX fails.

7 years agoMake Tools logfiles readable only by owner and root
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Make Tools logfiles readable only by owner and root

7 years agoReduce quiesced snapshot warning messages when running on older hosts.
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Reduce quiesced snapshot warning messages when running on older hosts.

vSphere 6.7 added a new interface on the host side that allows tools
to send a "generic" backup manifest during a quiesced snapshot on
Linux guests. VMTools 10.2.0 or later will try to send the manifest
file and if the host is unable to field it, then VMTools logs this
information and continues with the quiesced snapshot in the older
fashion.  This change reduces the logging that is done in this case.

7 years agoCommon source file change not directly applicable to open-vm-tools
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Common source file change not directly applicable to open-vm-tools

Verify existence of the returned path, retry the guest OP
CreateTemporaryFileInGuest/CreateTemporaryDirectoryInGuest using system
temp folder if the path disappears.

7 years agoFix coverity complaint; not a real bug
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Fix coverity complaint; not a real bug

7 years agoCommon source file change not directly applicable to open-vm-tools.
Oliver Kurth [Fri, 7 Sep 2018 22:53:27 +0000 (15:53 -0700)] 
Common source file change not directly applicable to open-vm-tools.

7 years agoDisable hgfsServer plugin when not running in a VMware VM.
Oliver Kurth [Fri, 7 Sep 2018 22:53:26 +0000 (15:53 -0700)] 
Disable hgfsServer plugin when not running in a VMware VM.

VmCheck_GetVersion() accesses Backdoor in an unsafe manner
which is not expected to work on non-VMware environments
including physical machines. So, we need to make sure that
VmCheck_GetVersion() is called only when we are running in
a VMware VM.

7 years agoExpose more guest stats for vROPS to report the exact physical memory
Oliver Kurth [Fri, 7 Sep 2018 22:53:26 +0000 (15:53 -0700)] 
Expose more guest stats for vROPS to report the exact physical memory
stats as the guest OS UI does.

Windows:
guest.mem.modifiedPages (Win32_PerfRawData_PerfOS_Memory#ModifiedPageListBytes)
guest.mem.standby.core (Win32_PerfRawData_PerfOS_Memory#StandbyCacheCoreBytes)
guest.mem.standby.normal (Win32_PerfRawData_PerfOS_Memory#StandbyCacheNormalPriorityBytes)
guest.mem.standby.reserve (Win32_PerfRawData_PerfOS_Memory#StandbyCacheReserveBytes)

Linux:
guest.mem.total (/proc/meminfo#MemTotal)
guest.mem.buffers (/proc/meminfo#Buffers)
guest.mem.cached (/proc/meminfo#Cached)
guest.mem.slabReclaim (/proc/meminfo#SReclaimable)
guest.mem.available (/proc/meminfo#MemAvailable since Linux 3.14, emulated by VMTools for kernels 2.6.27+)

7 years agoUpdate the tools version to 10.3.5
Oliver Kurth [Fri, 7 Sep 2018 22:53:26 +0000 (15:53 -0700)] 
Update the tools version to 10.3.5

Set the tools version in vm_tools_version.h to be
TOOLS_VERSION_JACKHAMMER_UPDATE1 = 10.3.5.

7 years agonicinfo: skip loopback devices
Oliver Kurth [Tue, 4 Sep 2018 22:41:00 +0000 (15:41 -0700)] 
nicinfo: skip loopback devices

When libdnet isn't used, loopback devices were reported. This change
skips these interfaces. Also skip interfaces that are down.

The interface was visible with vim-cmd, but not in the VC or
ESX UI. It did not contain any IP addresses.

7 years agoCommon header file change not directly applicable to open-vm-tools
Oliver Kurth [Tue, 4 Sep 2018 22:41:00 +0000 (15:41 -0700)] 
Common header file change not directly applicable to open-vm-tools

7 years agoCommom header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)] 
Commom header file change not applicable to open-vm-tools

7 years agoUpdate SSL configuration with more secure settings.
Oliver Kurth [Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)] 
Update SSL configuration with more secure settings.

Due to SSL issues in the past, The preference is to have default
settings to be more secure than compatible.  This change mainly
inherits the default settings from ssl.c.

7 years agoMake Tools logfiles readable only by owner and root
Oliver Kurth [Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)] 
Make Tools logfiles readable only by owner and root

7 years agoReduce quiesced snapshot warning messages when running on older hosts.
Oliver Kurth [Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)] 
Reduce quiesced snapshot warning messages when running on older hosts.

vSphere 6.7 added a new interface on the host side that allows tools
to send a "generic" backup manifest during a quiesced snapshot on
Linux guests. VMTools 10.2.0 or later will try to send the manifest
file and if the host is unable to field it, then VMTools logs this
information and continues with the quiesced snapshot in the older
fashion.  This change reduces the logging that is done in this case.

7 years agoAdd some key VMX debug messages
Oliver Kurth [Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)] 
Add some key VMX debug messages

Add some key debug-to-vmx messages to help debug SAML tokens.
Fix a potential issue in the logging code.
Always use a local version of htonll() since Visual Studio has
changed its mind about its existance in vs2017.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoTools: Clean up more "structured" left overs
Oliver Kurth [Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)] 
Tools: Clean up more "structured" left overs

It's now "detailed data".

7 years agoTools: Symbol name revisions
Oliver Kurth [Tue, 4 Sep 2018 22:40:59 +0000 (15:40 -0700)] 
Tools: Symbol name revisions

Change references to the recently added structured OS data to detailed
OS data.  Replace "Structured" with "DetailedData" in names.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 4 Sep 2018 22:40:58 +0000 (15:40 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoFix a gcc-8 compiler warning in lib/misc/vthreadBase.c
Oliver Kurth [Tue, 4 Sep 2018 22:40:58 +0000 (15:40 -0700)] 
Fix a gcc-8 compiler warning in lib/misc/vthreadBase.c

gcc-8 generates a stringop-truncation warning when it's possible
for strncpy to exclude the trailing nul.  The code was fine, we never
touch the last byte in the buffer and it's a static, but explicitly
set a nul at the end of the buffer so gcc sees it.

This is needed for open-vm-tools to build on SUSE Tumbleweed.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 4 Sep 2018 22:40:58 +0000 (15:40 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoEnd VGAuth impersonation in the case of error.
Oliver Kurth [Tue, 4 Sep 2018 22:40:58 +0000 (15:40 -0700)] 
End VGAuth impersonation in the case of error.

* In GuestAuthPasswordAuthenticateImpersonate():
When VGAuth_UserHandleAccessToken fails, unimpersonation is not
being done. This can cause issues. Fixed it.

* In GuestAuthSAMLAuthenticateAndImpersonate(), fixed the following issues:
The 'newHandle' is not being freed which causes a memory leak.
When VGAuth_UserHandleAccessToken fails, unimpersonation is not
being done.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 4 Sep 2018 22:40:58 +0000 (15:40 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoFix coverity complaint; not a real bug
Oliver Kurth [Tue, 4 Sep 2018 22:40:58 +0000 (15:40 -0700)] 
Fix coverity complaint; not a real bug

7 years agovm_version.h should include vm_tools_version.h only for Tools builds.
Oliver Kurth [Tue, 4 Sep 2018 22:40:58 +0000 (15:40 -0700)] 
vm_version.h should include vm_tools_version.h only for Tools builds.

7 years agoTools: Start using the new structure guest data
Oliver Kurth [Tue, 4 Sep 2018 22:40:58 +0000 (15:40 -0700)] 
Tools: Start using the new structure guest data

Turn on the structured output for guest OS identification.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 4 Sep 2018 22:40:57 +0000 (15:40 -0700)] 
Common header file change not applicable to open-vm-tools

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 4 Sep 2018 22:40:57 +0000 (15:40 -0700)] 
Common header file change not applicable to open-vm-tools