]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
8 years agoupdate copyright header
Oliver Kurth [Thu, 14 Dec 2017 21:42:36 +0000 (13:42 -0800)] 
update copyright header

8 years agoadd modinfo version
Oliver Kurth [Thu, 14 Dec 2017 21:42:01 +0000 (13:42 -0800)] 
add modinfo version

8 years agoCAF MA Performance Issues
Oliver Kurth [Sat, 9 Dec 2017 02:57:38 +0000 (18:57 -0800)] 
CAF MA Performance Issues

CAF MA Performance Issues

Vmware CAF ManagementAgentHost service was polling every 5 secs to check if Guest Network "Tunnel(port 6672)" was enabled to preconfigure & bring up Vmware CAF CommAmqpListener service.
This resulted in more CPU Utilization as opposed to previous release in CAF & caused regression in vmtools 10.2.0.
We are increasing the Poll rate to 5 mins, which fixed the issue & is giving us the same CPU/memory utilizations as in vmtools 10.1.0.

We were checking for the different stages of listener preconfiguration status from the listenerpreConfigure.txt files in the polling time interval, which caused increased IO operations.
To fix that we have stored the value of listener preconfiguration status from the files into a variable locally & using the same at all places instead of file access.

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Tue, 5 Dec 2017 00:27:21 +0000 (16:27 -0800)] 
Common header file change; not applicable to open-vm-tools.

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Tue, 5 Dec 2017 00:27:21 +0000 (16:27 -0800)] 
Common header file change; not applicable to open-vm-tools.

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Tue, 5 Dec 2017 00:27:21 +0000 (16:27 -0800)] 
Common header file change; not applicable to open-vm-tools.

8 years agoopen-vm-tools: add missing copyright headers
Oliver Kurth [Tue, 5 Dec 2017 00:27:21 +0000 (16:27 -0800)] 
open-vm-tools: add missing copyright headers

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Tue, 5 Dec 2017 00:27:21 +0000 (16:27 -0800)] 
Common header file change; not applicable to open-vm-tools.

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Tue, 5 Dec 2017 00:27:21 +0000 (16:27 -0800)] 
Common header file change; not applicable to open-vm-tools.

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Tue, 5 Dec 2017 00:27:21 +0000 (16:27 -0800)] 
Common header file change; not applicable to open-vm-tools.

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Tue, 5 Dec 2017 00:27:21 +0000 (16:27 -0800)] 
Common header file change; not applicable to open-vm-tools.

8 years agoUpdate the Tools-10.2.0 GA Open Source License Files.
Oliver Kurth [Tue, 5 Dec 2017 00:27:20 +0000 (16:27 -0800)] 
Update the Tools-10.2.0 GA Open Source License Files.

8 years agoRpcVMX: Report driver name and driver version to vmx to store the key-value in
Oliver Kurth [Tue, 5 Dec 2017 00:27:20 +0000 (16:27 -0800)] 
RpcVMX: Report driver name and driver version to vmx to store the key-value in
GuestVars, and write a log in vmware.log using RpcVMX_Log.

8 years agoGuestInfo: skip check for shrinkable disk when gathering disk info
Oliver Kurth [Tue, 5 Dec 2017 00:27:20 +0000 (16:27 -0800)] 
GuestInfo: skip check for shrinkable disk when gathering disk info

Some Linux OSes may have a non-existing device mounted to a filesystem,
for example Photon OS has the root file system mounted from
/dev/root, which does not exist. The wiper library does a check
for a shrinkable disk, and this fails. This change skips the check
when gathering data for diskinfo, but leaves it intact for
other disk wiper purposes. Information from read-only flesystems
will also be reported.

8 years agoFileIO: Add customizable privileged file opener for Apple. The change is
Oliver Kurth [Tue, 5 Dec 2017 00:27:20 +0000 (16:27 -0800)] 
FileIO: Add customizable privileged file opener for Apple.  The change is
not applicable to open-vm-tools.

8 years agoMake AutoCPtr's constructor explicit to make it more obvious when
Oliver Kurth [Tue, 5 Dec 2017 00:27:20 +0000 (16:27 -0800)] 
Make AutoCPtr's constructor explicit to make it more obvious when
pointer ownership is transferred. (This also matches std::auto_ptr.)

8 years agoMake logfiles readable only by admin/root.
Oliver Kurth [Thu, 30 Nov 2017 23:38:04 +0000 (15:38 -0800)] 
Make logfiles readable only by admin/root.

8 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Thu, 30 Nov 2017 23:38:04 +0000 (15:38 -0800)] 
Common header file change not applicable to open-vm-tools.

8 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Thu, 30 Nov 2017 23:38:04 +0000 (15:38 -0800)] 
Common header file change not applicable to open-vm-tools.

8 years agoCommon header files change not applicable to open-vm-tools.
Oliver Kurth [Thu, 30 Nov 2017 23:38:04 +0000 (15:38 -0800)] 
Common header files change not applicable to open-vm-tools.

8 years agoCommon header file change that is not applicable to open-vm-tools.
Oliver Kurth [Thu, 30 Nov 2017 23:38:04 +0000 (15:38 -0800)] 
Common header file change that is not applicable to open-vm-tools.

8 years agoChanges to common header files not directly applicable to open-vm-tools.
Oliver Kurth [Thu, 30 Nov 2017 23:38:04 +0000 (15:38 -0800)] 
Changes to common header files not directly applicable to open-vm-tools.

8 years agoChange to common header file; not applicable to open-vm-tools.
Oliver Kurth [Thu, 30 Nov 2017 23:38:04 +0000 (15:38 -0800)] 
Change to common header file; not applicable to open-vm-tools.

8 years agoTypo correction in common header file comment.
Oliver Kurth [Thu, 30 Nov 2017 23:38:04 +0000 (15:38 -0800)] 
Typo correction in common header file comment.

8 years agoImprove diskinfo debug output
Oliver Kurth [Thu, 30 Nov 2017 23:38:03 +0000 (15:38 -0800)] 
Improve diskinfo debug output

Add more debug information so that it is easier to figure out why some
partitions are not being found.

8 years agoMake VigorPollImpl FD-based callbacks non-periodic (take 3)
Oliver Kurth [Thu, 30 Nov 2017 23:38:03 +0000 (15:38 -0800)] 
Make VigorPollImpl FD-based callbacks non-periodic (take 3)

The previous attempt reveals another pre-existing issue.  An fd that is
closed by AsyncSocket may be reused right away.  The SharedStream for
that fd may still have an outstanding callback that needs to fire
before it would be destroyed.  If the destruction happens after the fd
is re-used and the new owner is using boost asio stream, the Release()
call would cancel the async read/write operation for the new owner.
One simple fix is to dup the fd when creating a SharedStream.  This
means hostd would need 2 fds for each running VM.  The hostd fd limit
is currently 4096 and I was able to power on 1K VMs.  If necessary, the
fd limit can be increased (the system limit is 32K).

Previous description:

The original change has an issue on Linux that is not observed in ESX.
When the read and write callbacks fire in parallel, both would release
the reference to the SharedStream, triggering its destructor.  Later
when the read callback tries to re-register itself, it would hit a
boost exception.  To avoid that, I delayed the reset of
CallbackFD::stream to the end of Invoke so that the SharedStream
object woudl not be destroyed as long as the callback is re-registered.

Original description:

The hard-to-reproduce AsyncSocket leak turns out to be a variation of
PR 1530561.  The fix for that bug only plugs the leak when the race is
between a VigorPollImpl callback that fires with an CanceledException
(which can be triggered by another callback registered on the same fd --
this is the boost behavior) and a thread trying to unregister the same
callback (e.g. upon detection of a disconnect).  There is still a
potential reference leak when the read and write callbacks run in
parallel, if a disconnection happens between the two asyncsocket
callbacks (the asyncsocket callbacks take the asyncsocket lock, so they
are mostly serialized).  The second asyncsocket callback handling the
disconnect error would unregister the first callback while the first
callback would be attempting to re-register itself at the VigorPollImpl
level (to provide the periodic behavior exposed by IVmdbPoll).  If the
unregister wins the race, it would return false because the callback
cannot be cancelled (it is running).  Then ReRegister would not find
the callback in the hash table, so the callback would not fire again,
which means the reference taken when registering the callback is leaked.

Applying the fix for PR 1530561 in the above scenario would not work
because an AsycnSocket callback may unregister itself and in that case
the reference is appropriately released.  Unless we save the thread ID
in Unregister, we would not be able to distinguish when the callback
needs to run in order to release the reference.  After considering
various options, I believe trying to support periodic fd-based
callbacks on top of a multi-threaded poll API is troublesome.  This
change adds a poll flag for one-shot callbacks and used that in
AsyncSocket with IVmdbPoll.  VigorPollImpl only support the one-shot
behavior.  In the long term I would like to retire IVmdbPoll and create
a new poll interface.  For now I would like to minimize churn while
fixing the memory leak.

8 years agoFix memory leak in vmtoolsd.
Oliver Kurth [Thu, 30 Nov 2017 23:38:03 +0000 (15:38 -0800)] 
Fix memory leak in vmtoolsd.

8 years agoTools: GuestInfo: ESX: dynamically load libvmkmemstats.so
Oliver Kurth [Thu, 30 Nov 2017 23:38:03 +0000 (15:38 -0800)] 
Tools: GuestInfo: ESX: dynamically load libvmkmemstats.so

The new version of the vmware tools will be installed on older version
of ESX.  But these older versions do not come with libvmkmemstats.so
and a dynamic linking error occurs.

This patch changes the code to deal with the case where the lib is not
available.  Instead of relying on the linker to dynamically link with
libvmkmemstats.so, g_module_open() is used to open the library, if
available, and gracefully handle any eventual errors.
Before the patch, the whole libguestinfo would stop working and after
the patch only the memory stats are unavailable.

8 years agoCorrecting the few copyright notice added to a few CAF related files bundled in Open...
Oliver Kurth [Thu, 30 Nov 2017 23:38:03 +0000 (15:38 -0800)] 
Correcting the few copyright notice added to a few CAF related files bundled in Open-VM-Tools.

8 years agoAdding copyright notice to a few CAF related files bundled in Open-VM-Tools.
Oliver Kurth [Thu, 30 Nov 2017 23:38:03 +0000 (15:38 -0800)] 
Adding copyright notice to a few CAF related files bundled in Open-VM-Tools.

8 years agoUpdate the Tools-10.2.0 GA Open Source License Files.
Oliver Kurth [Thu, 30 Nov 2017 23:17:27 +0000 (15:17 -0800)] 
Update the Tools-10.2.0 GA Open Source License Files.

8 years agoVGAuth changes:
Oliver Kurth [Thu, 30 Nov 2017 23:17:27 +0000 (15:17 -0800)] 
VGAuth changes:

 - add calling LoadUserProfile()/UnloadUserProfile() in VGAuth
   impersonation/unimpersonation code paths
 - VMTools side code change to use the new VGAuth SDK.

8 years agoVGAuth changes:
Oliver Kurth [Thu, 30 Nov 2017 23:17:27 +0000 (15:17 -0800)] 
VGAuth changes:

 - add calling LoadUserProfile()/UnloadUserProfile() in VGAuth
   impersonation/unimpersonation code paths
 - VGAuth part of code change plus tools vix plugin make file.

8 years agoRemove guestStats that are beyond ESXi 6.0 U1 scope.
Oliver Kurth [Thu, 30 Nov 2017 23:17:27 +0000 (15:17 -0800)] 
Remove guestStats that are beyond ESXi 6.0 U1 scope.

The guestStats in R10 Tools release follow ESXi 6.0 U1 scope.
Remove the guestStats that are not in scope for ESXi 6.0 U1.

8 years agoFix memory leak in vmtoolsd.
Oliver Kurth [Thu, 30 Nov 2017 23:17:27 +0000 (15:17 -0800)] 
Fix memory leak in vmtoolsd.

8 years agoTools: GuestInfo: ESX: dynamically load libvmkmemstats.so
Oliver Kurth [Thu, 30 Nov 2017 23:17:27 +0000 (15:17 -0800)] 
Tools: GuestInfo: ESX: dynamically load libvmkmemstats.so

The new version of the vmware tools will be installed on older version
of ESX.  But these older versions do not come with libvmkmemstats.so
and a dynamic linking error occurs.

This patch changes the code to deal with the case where the lib is not
available.  Instead of relying on the linker to dynamically link with
libvmkmemstats.so, g_module_open() is used to open the library, if
available, and gracefully handle any eventual errors.
Before the patch, the whole libguestinfo would stop working and after
the patch only the memory stats are unavailable.

8 years agoAdding copyright notice to a few CAF related files bundled in Open-VM-Tools.
Oliver Kurth [Thu, 30 Nov 2017 23:17:27 +0000 (15:17 -0800)] 
Adding copyright notice to a few CAF related files bundled in Open-VM-Tools.

8 years agoGuestInfo: add primary-nics and low-priority-nics options
Oliver Kurth [Wed, 15 Nov 2017 21:32:56 +0000 (13:32 -0800)] 
GuestInfo: add primary-nics and low-priority-nics options

Add the options 'primary-nics' and 'low-priority-nics' for GuestInfo.

The options accept a list of comma separated patterns for interface names
which can be considered as 'primary' or 'low priority' network interfaces.
This will cause the NicInfo to be put on top of the list for primary
interfaces, and to the bottom for low priority interfaces.

Example:

primary-nics=eth1

will make sure that the IP address(es) for eth1 will be sorted on
top of the list of IP addresses.

primary-nics=eth*

will make sure that any one of the addresses of all interfaces
matching eth* will be sorted on top of the list of IP addresses,
but won't guarantee which one if there is more than one.

low-priority-nics=eth*

will work analogously, but interfaces will be sorted to the bottom.

In case the limit of the number of interfaces to be reported is reached,
low priority interfaces are the first to be skipped.

8 years agoAdditional 2017 copyright updates.
Oliver Kurth [Wed, 15 Nov 2017 21:32:56 +0000 (13:32 -0800)] 
Additional 2017 copyright updates.

8 years agoUpdate copyright year to 2017 for open-vm-tools 10.2.0.
Oliver Kurth [Wed, 15 Nov 2017 21:32:55 +0000 (13:32 -0800)] 
Update copyright year to 2017 for open-vm-tools 10.2.0.

8 years agoDragNDrop plugin change for VMware Tools on Windows; not applicable to
Oliver Kurth [Wed, 15 Nov 2017 21:32:55 +0000 (13:32 -0800)] 
DragNDrop plugin change for VMware Tools on Windows; not applicable to
open-vm-tools.

8 years agoAdd SUSE Server for SAP Applications to hostinfoPosix.c
Oliver Kurth [Wed, 15 Nov 2017 21:32:55 +0000 (13:32 -0800)] 
Add SUSE Server for SAP Applications to hostinfoPosix.c

On SLES-SP1-SAP the "lsb_release -sd" command returns the string
"SUSE Linux Enterprise Server for SAP Applications 12 SP1".
Parsing in HostinfoGetOSShortName() detects the sub-strings "suse"
and "enterprise" but not "server 12".  STR_OS_SLES is returned
resulting in displaying of "SUSE Linux Enterprise 8/9" in the
summary screen of the vSphere client.  This is wrong.

Instead, search for the sub-string "server for sap applications 12"
and return STR_OS_SLES_12.  SLES11-SAP is not affected.

Please see: github.com/vmware/open-vm-tools/pull/123

8 years ago[Tools] Fix crash issue when stopping vmtoolsd(vmuser)
Oliver Kurth [Wed, 15 Nov 2017 21:32:55 +0000 (13:32 -0800)] 
[Tools] Fix crash issue when stopping vmtoolsd(vmuser)

When stopping vmtoolsd, the code tries to unload all plugins.  The
signal TOOLS_CORE_SIG_CAPABILITIES is emitted before really starting
to unload plugins.  If the plugin should try to call RpcChannel_Send
while processing the signal and the RPC channel has been shutdown, an
ASSERT is triggered.  The fix is to check whether rpc exists and if
unavailable, avoid sending the TOOLS_CORE_SIG_CAPABILITIES signal.

8 years agoopen-vm-tools: make building with gtk3 the default
Oliver Kurth [Wed, 15 Nov 2017 21:32:55 +0000 (13:32 -0800)] 
open-vm-tools: make building with gtk3 the default

This makes building with gtk3 the default, and sets sane
defaults when building with/without gtk2/gtk3.

8 years agoVMware Tools 10.2.0 L10n message updates.
Oliver Kurth [Wed, 15 Nov 2017 21:32:54 +0000 (13:32 -0800)] 
VMware Tools 10.2.0 L10n message updates.

8 years agoAdd new GOS definitions for virtual hardware version 14.
Oliver Kurth [Wed, 15 Nov 2017 21:32:54 +0000 (13:32 -0800)] 
Add new GOS definitions for virtual hardware version 14.

  RHEL 8 64-bit
  CentOS 8 64-bit
  Oracle 8 64_bit
  SLES 15 64-bit
  Asianux 8 64-bit
  Other 4.x Linux Kernel
  Other 4.x Linux Kernel 64-bit
  FreeBSD 12
  FreeBSD 12 64-bit
  Darwin 18 64-bit

8 years agoGuestInfo: enable nic/iproute information for Linux without libdnet
Oliver Kurth [Wed, 15 Nov 2017 21:32:54 +0000 (13:32 -0800)] 
GuestInfo: enable nic/iproute information for Linux without libdnet

Linux glibc (since 2.3) fully supports getting ip addresses using
getifaddrs() for both IPv4 and IPv6. Use of getifaddrs() was already
implemented in nicInfoPosix.c for tools for ESXi. This change
enables that code also for Linux, if libdnet is not used.

The change also enables the iproute information, which does not
depend on libdnet, except by the use of addr_stob(), which can
be replaced easily with the existing function CountNetmaskBits().

8 years agoMake disk free space reporting consistent with Linux 'df' command.
Oliver Kurth [Wed, 15 Nov 2017 21:32:54 +0000 (13:32 -0800)] 
Make disk free space reporting consistent with Linux 'df' command.

On Linux, statfs syscall reports free space in two fields.
From http://man7.org/linux/man-pages/man2/statfs.2.html:
1. f_bfree => Free blocks in filesystem
2. f_bavail => Free blocks available to unprivileged user

For file systems that maintain reserved space for system
activities f_bfree > f_bavail because f_bfree includes the
reserved space in the file system. The reserved space is
typically 5% for 'ext4' file systems. Newer distros like
RHEL 7.x use 'xfs' by default and report same value for
both the fields.

The Linux 'df' command uses f_bavail in its reporting.
Tools reports, conditionally, f_bfree for root and f_bavail
for non-root.  However, since vmtoolsd runs as root, Tools
always reports f_bfree, which is more free space than 'df'
would report (depending on amount of reserved space).

In order to be consistent with Linux 'df' command,
report f_bavail as the disk free space by default. This does
change the behavior a little bit in that Tools will report less
disk free space than before, the difference being the same as
the reserved space on the file system, typically 5%. This
should be OK in general because it makes the space reporting
a bit conservative. If this change in behavior is not desired
for some use cases, the old behavior can be restored by setting
the following newly added configuration in this change:

[guestinfo]
diskinfo-include-reserved=true

The existing callers that are outside the guestInfo plugin
will continue to include reserved space in their space
accounting as before.

Also fixed a few minor stuff/touchups in vmtoolsConfig.c.

8 years agoAdd Str_Strncpy
Oliver Kurth [Wed, 15 Nov 2017 21:32:54 +0000 (13:32 -0800)] 
Add Str_Strncpy

Add a Str_Strncpy function that, unlike strncpy, guarantees
NUL-termination.

8 years agoFix a segfault when log file isn't set and conf is reloaded.
Oliver Kurth [Wed, 15 Nov 2017 21:32:54 +0000 (13:32 -0800)] 
Fix a segfault when log file isn't set and conf is reloaded.

When vmsvc.handler=file, but vmsvc.data isn't set, vmtoolsd crashed
on reloading the config file. This was caused by using a NULL value
as an argument to a strcmp().

This change fixes this by using g_strcmp0 which handles NULL pointers
gracefully, and setting confData to a default value before calling
g_strcmp0().

This also fixes a case where a change in the log file would be ignored.

8 years agoguestOS: Uniquely run time identify Photon
Oliver Kurth [Wed, 15 Nov 2017 21:32:53 +0000 (13:32 -0800)] 
guestOS: Uniquely run time identify Photon

Currently VMware Photon 2 is identified at run time as a Linux 4.x kernel.
This is correct, but the Photon distro has an LSB compliant identification
file.

Attempt to check the LSB compliant identification file for Photon. If
present, identify the guest as "vmware-photon".

8 years agoMerge branch 'stable-10.1.x'
Oliver Kurth [Tue, 24 Oct 2017 21:13:33 +0000 (14:13 -0700)] 
Merge branch 'stable-10.1.x'

8 years agoDragNDrop plugin change for VMware Tools on Windows; not applicable to
Oliver Kurth [Tue, 24 Oct 2017 21:07:36 +0000 (14:07 -0700)] 
DragNDrop plugin change for VMware Tools on Windows; not applicable to
open-vm-tools.

8 years agoGuestInfo: add primary-nics and low-priority-nics options
Oliver Kurth [Tue, 24 Oct 2017 21:07:36 +0000 (14:07 -0700)] 
GuestInfo: add primary-nics and low-priority-nics options

Add the options 'primary-nics' and 'low-priority-nics' for GuestInfo.

The options accept a list of comma separated patterns for interface names
which can be considered as 'primary' or 'low priority' network interfaces.
This will cause the NicInfo to be put on top of the list for primary
interfaces, and to the bottom for low priority interfaces.

Example:

primary-nics=eth1

will make sure that the IP address(es) for eth1 will be sorted on
top of the list of IP addresses.

primary-nics=eth*

will make sure that any one of the addresses of all interfaces
matching eth* will be sorted on top of the list of IP addresses,
but won't guarantee which one if there is more than one.

low-priority-nics=eth*

will work analogously, but interfaces will be sorted to the bottom.

In case the limit of the number of interfaces to be reported is reached,
low priority interfaces are the first to be skipped.

8 years agoVGAuth changes:
Oliver Kurth [Tue, 24 Oct 2017 21:07:35 +0000 (14:07 -0700)] 
VGAuth changes:

 - add calling LoadUserProfile()/UnloadUserProfile() in VGAuth
   impersonation/unimpersonation code paths
 - VMTools side code change to use the new VGAuth SDK.

8 years agoVGAuth changes:
Oliver Kurth [Tue, 24 Oct 2017 21:07:35 +0000 (14:07 -0700)] 
VGAuth changes:

 - add calling LoadUserProfile()/UnloadUserProfile() in VGAuth
   impersonation/unimpersonation code paths
 - VGAuth part of code change plus tools vix plugin make file.

8 years ago[Tools] Fix crash issue when stopping vmtoolsd(vmuser)
Oliver Kurth [Tue, 24 Oct 2017 21:07:35 +0000 (14:07 -0700)] 
[Tools] Fix crash issue when stopping vmtoolsd(vmuser)

When stopping vmtoolsd, the code tries to unload all plugins.  The
signal TOOLS_CORE_SIG_CAPABILITIES is emitted before really starting
to unload plugins.  If the plugin should try to call RpcChannel_Send
while processing the signal and the RPC channel has been shutdown, an
ASSERT is triggered.  The fix is to check whether rpc exists and if
unavailable, avoid sending the TOOLS_CORE_SIG_CAPABILITIES signal.

8 years agoUpdate copyright year to 2017 for open-vm-tools 10.2.0.
Oliver Kurth [Tue, 24 Oct 2017 21:07:35 +0000 (14:07 -0700)] 
Update copyright year to 2017 for open-vm-tools 10.2.0.

8 years agoAdd SUSE Server for SAP Applications to hostinfoPosix.c
Oliver Kurth [Tue, 24 Oct 2017 21:07:33 +0000 (14:07 -0700)] 
Add SUSE Server for SAP Applications to hostinfoPosix.c

On SLES-SP1-SAP the "lsb_release -sd" command returns the string
"SUSE Linux Enterprise Server for SAP Applications 12 SP1".
Parsing in HostinfoGetOSShortName() detects the sub-strings "suse"
and "enterprise" but not "server 12".  STR_OS_SLES is returned
resulting in displaying of "SUSE Linux Enterprise 8/9" in the
summary screen of the vSphere client.  This is wrong.

Instead, search for the sub-string "server for sap applications 12"
and return STR_OS_SLES_12.  SLES11-SAP is not affected.

Please see: github.com/vmware/open-vm-tools/pull/123

8 years agolib/file: Enhance File_EnsureDirectoryEx to do more checking
Oliver Kurth [Tue, 24 Oct 2017 21:07:33 +0000 (14:07 -0700)] 
lib/file: Enhance File_EnsureDirectoryEx to do more checking

When creating a directory, distinguish whether an EEXIST error is
because the directory already exists or because there is a file with
that path name.  Return the appropriate error.

8 years agoVMware Tools 10.2.0 L10n changes for VGAuth.
Oliver Kurth [Tue, 24 Oct 2017 21:07:33 +0000 (14:07 -0700)] 
VMware Tools 10.2.0 L10n changes for VGAuth.

8 years agoCommon header file changed; not applicable to open-vm-tools.
Oliver Kurth [Tue, 24 Oct 2017 21:07:33 +0000 (14:07 -0700)] 
Common header file changed; not applicable to open-vm-tools.

8 years agolib/file: Reduce the create directory spam
Oliver Kurth [Tue, 24 Oct 2017 21:07:33 +0000 (14:07 -0700)] 
lib/file: Reduce the create directory spam

The lib/file primitives (e.g. create file, create directory) may fail -
but they also return errno/GetLastError. The caller should inspect a
failure and decide what to do (or log). The lib/file primitives should
not log. The client should do that. The primitives are the high
performance path and failure isn't necessarily a failure, only the
client can decide.

The lib/file primitives (e.g. create file, create directory) may fail -
but they also return errno/GetLastError. The caller should inspect a
failure and decide what to do (or log). The lib/file primitives should
not log. The client should do that. The primitives are the high
performance path and failure isn't necessarily a failure, only the
client can decide.

8 years agoMisc GuestOS ID fixes.
Oliver Kurth [Tue, 24 Oct 2017 21:07:33 +0000 (14:07 -0700)] 
Misc GuestOS ID fixes.

- Centos8 64bit guest will have linux 4.x. Moved Centos8-64 guest id
  from all3xlinux64 to all4xlinux64 guest list.
- oracle8_64 is missing in the list. Added it to all4xlinux64 guest list.
- Photon has linux 4.x. Moved photon from all3xlinux64 to all4xlinux64
  guest list.

- Changed the HostinfoOSData() function to return other4xlinux for
  the distros where the version cannot be determined.

8 years agoBump imgcust version to 8.4.0.xxxx
Oliver Kurth [Tue, 24 Oct 2017 21:07:33 +0000 (14:07 -0700)] 
Bump imgcust version to 8.4.0.xxxx

8 years agoBack out commit d2c18c44...: Make VigorPollImpl FD-based callbacks non-periodic
Oliver Kurth [Tue, 24 Oct 2017 21:07:33 +0000 (14:07 -0700)] 
Back out commit d2c18c44...: Make VigorPollImpl FD-based callbacks non-periodic

Yet another issue is exposed by the change.  This is a clean backout
but keeping the cleanupOnError fix in SharedStreamFactory::Get.

8 years agoopen-vm-tools: make building with gtk3 the default
Oliver Kurth [Tue, 24 Oct 2017 21:07:32 +0000 (14:07 -0700)] 
open-vm-tools: make building with gtk3 the default

This makes building with gtk3 the default, and sets sane
defaults when building with/without gtk2/gtk3.

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Tue, 24 Oct 2017 21:07:32 +0000 (14:07 -0700)] 
Common header file change; not applicable to open-vm-tools.

8 years agoCommon header file change; not directly applicable to open-vm-tools
Oliver Kurth [Tue, 24 Oct 2017 21:07:32 +0000 (14:07 -0700)] 
Common header file change; not directly applicable to open-vm-tools

8 years agoGuestInfo: enable nic/iproute information for Linux without libdnet
Oliver Kurth [Mon, 23 Oct 2017 21:21:23 +0000 (14:21 -0700)] 
GuestInfo: enable nic/iproute information for Linux without libdnet

Linux glibc (since 2.3) fully supports getting ip addresses using
getifaddrs() for both IPv4 and IPv6. Use of getifaddrs() was already
implemented in nicInfoPosix.c for tools for ESXi. This change
enables that code also for Linux, if libdnet is not used.

The change also enables the iproute information, which does not
depend on libdnet, except by the use of addr_stob(), which can
be replaced easily with the existing function CountNetmaskBits().

8 years agoMake disk free space reporting consistent with Linux 'df' command.
Oliver Kurth [Mon, 23 Oct 2017 21:21:22 +0000 (14:21 -0700)] 
Make disk free space reporting consistent with Linux 'df' command.

On Linux, statfs syscall reports free space in two fields.
From http://man7.org/linux/man-pages/man2/statfs.2.html:
1. f_bfree => Free blocks in filesystem
2. f_bavail => Free blocks available to unprivileged user

For file systems that maintain reserved space for system
activities f_bfree > f_bavail because f_bfree includes the
reserved space in the file system. The reserved space is
typically 5% for 'ext4' file systems. Newer distros like
RHEL 7.x use 'xfs' by default and report same value for
both the fields.

The Linux 'df' command uses f_bavail in its reporting.
Tools reports, conditionally, f_bfree for root and f_bavail
for non-root.  However, since vmtoolsd runs as root, Tools
always reports f_bfree, which is more free space than 'df'
would report (depending on amount of reserved space).

In order to be consistent with Linux 'df' command,
report f_bavail as the disk free space by default. This does
change the behavior a little bit in that Tools will report less
disk free space than before, the difference being the same as
the reserved space on the file system, typically 5%. This
should be OK in general because it makes the space reporting
a bit conservative. If this change in behavior is not desired
for some use cases, the old behavior can be restored by setting
the following newly added configuration in this change:

[guestinfo]
diskinfo-include-reserved=true

The existing callers that are outside the guestInfo plugin
will continue to include reserved space in their space
accounting as before.

Also fixed a few minor stuff/touchups in vmtoolsConfig.c.

8 years agoPorting some common code to another architecture; not applicable to
Oliver Kurth [Mon, 23 Oct 2017 21:21:22 +0000 (14:21 -0700)] 
Porting some common code to another architecture; not applicable to
open-vm-tools.

8 years agoAdd support to tools timeSync to issue w32tm resync in Windows guests.
Oliver Kurth [Mon, 23 Oct 2017 21:21:22 +0000 (14:21 -0700)] 
Add support to tools timeSync to issue w32tm resync in Windows guests.

This change adds support to issue a w32tm resync command from within
VMware tools timeSync in order to reconfigure w32time configuration
parameters. This forces guest time to be resynchronized to external
time server.

8 years agoAdd a poll flag for one-shot callbacks in AsyncSocket
Oliver Kurth [Mon, 23 Oct 2017 21:21:22 +0000 (14:21 -0700)] 
Add a poll flag for one-shot callbacks in AsyncSocket

The original change had an issue.  When the read and write callbacks
fire in parallel, both would release the reference to the SharedStream,
triggering its destructor.  Later when the read callback tried to
re-register itself, it would hit a boost exception.  To avoid that,
delay the reset of CallbackFD::stream to the end of Invoke so that the
SharedStream object will not be destroyed as long as the callback is
re-registered.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Mon, 23 Oct 2017 21:21:22 +0000 (14:21 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoHostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.
Oliver Kurth [Mon, 23 Oct 2017 21:21:22 +0000 (14:21 -0700)] 
HostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.

8 years agoRevert - HostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.
Oliver Kurth [Mon, 23 Oct 2017 21:21:22 +0000 (14:21 -0700)] 
Revert - HostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.

8 years agoHostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
HostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.

8 years agoFix a segfault when log file isn't set and conf is reloaded.
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
Fix a segfault when log file isn't set and conf is reloaded.

When vmsvc.handler=file, but vmsvc.data isn't set, vmtoolsd crashed
on reloading the config file. This was caused by using a NULL value
as an argument to a strcmp().

This change fixes this by using g_strcmp0 which handles NULL pointers
gracefully, and setting confData to a default value before calling
g_strcmp0().

This also fixes a case where a change in the log file would be ignored.

8 years agoRevert - HostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
Revert - HostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.

8 years agoChanges to header files vmnet_defs.h and vmxnet3_defs.h needed to
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
Changes to header files vmnet_defs.h and vmxnet3_defs.h needed to
integrate ENS capabilities into existing Uplink capabilities.
The changes are not directly applicable to open-vm-tools.

8 years agoHostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
HostDiskMacos: Migrate macOS host disk functions from file and user to hostDisk.

8 years agoUpdate file version for imgcust deliverables
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
Update file version for imgcust deliverables

8 years agoRevert change to add a poll flag for one-shot callbacks.
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
Revert change to add a poll flag for one-shot callbacks.

8 years agostrutil.c: Add a case-insensitive version of StrUtil_EndsWith.
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
strutil.c: Add a case-insensitive version of StrUtil_EndsWith.

Common header file change; not applicable to open-vm-tools.

8 years agoUpdate of a product version in a shared header file; not applicable to
Oliver Kurth [Mon, 23 Oct 2017 21:21:21 +0000 (14:21 -0700)] 
Update of a product version in a shared header file; not applicable to
open-vm-tools.

8 years agoAsyncSocket: Fix DoOneMsg's inBlockingRecv bookkeeping
Oliver Kurth [Mon, 23 Oct 2017 21:21:20 +0000 (14:21 -0700)] 
AsyncSocket: Fix DoOneMsg's inBlockingRecv bookkeeping

For the I[Vmdb]Poll support in AsyncTCPSocket, inBlockingRecv has been
used to avoid conflict with AsyncSocketDoOneMsg.  There is an issue
with where inBlocking Recv is decremented, which is right after poll,
where the thread would drop the lock.  The lock may also be dropped
during AsyncTCPSocketFillRecvBuffer, and for that there is a separate
inDoOneMsg flag.  This change unifies the two flags and makes
inBlockingRecv cover both functions that may drop the lock.  This fixes
the race that would allow AsyncTCPSocketRecvCallback to run when
AsyncTCPSocketDoOneMsg is in progress.  A couple places where we
previously checked inBlockingRecv to report an error now have to also
check inRecvLoop (TRUE during AsyncTCPSocketFillRecvBuffer) -- those
checks cannot be enforced during FillRecvBuffer because the client
callback is allowed to change the callback or cancel it.  The lone
usage of inDoOneMsg is switched to inBlockingRecv.

8 years agoSet the Tools version to 10.3.0
Oliver Kurth [Mon, 23 Oct 2017 21:21:20 +0000 (14:21 -0700)] 
Set the Tools version to 10.3.0

8 years agoguestOS: Uniquely run time identify Photon
Oliver Kurth [Mon, 23 Oct 2017 21:21:20 +0000 (14:21 -0700)] 
guestOS: Uniquely run time identify Photon

Currently VMware Photon 2 is identified at run time as a Linux 4.x kernel.
This is correct, but the Photon distro has an LSB compliant identification
file.

Attempt to check the LSB compliant identification file for Photon. If
present, identify the guest as "vmware-photon".

8 years agoAdd new GOS definitions in HWV=14
Oliver Kurth [Mon, 23 Oct 2017 21:21:20 +0000 (14:21 -0700)] 
Add new GOS definitions in HWV=14

8 years agoFix ASSERT of registering the same callback twice (take 2)
Oliver Kurth [Mon, 23 Oct 2017 21:21:20 +0000 (14:21 -0700)] 
Fix ASSERT of registering the same callback twice (take 2)

Re-check the condition of inBlockingRecv after the lock
may have been dropped.

8 years agoFix ASSERT of registering the same callback twice
Oliver Kurth [Mon, 23 Oct 2017 21:21:20 +0000 (14:21 -0700)] 
Fix ASSERT of registering the same callback twice

The previous change for Poll introduced a bug in AsyncSocket.
When re-registering the recv callback, it needs to check whether
there is a concurrent blocking recv (which means the send callback
has detected a disconnection and is draining the pipe).  The recv
callback should act like a no-op in that case (other than to
release the reference).

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Mon, 23 Oct 2017 21:21:19 +0000 (14:21 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoHgfs Protocol: clean up the Hgfs protocol operation capabilities
Oliver Kurth [Mon, 23 Oct 2017 21:21:19 +0000 (14:21 -0700)] 
Hgfs Protocol: clean up the Hgfs protocol operation capabilities

This change cleans up the operation capability and its flags which
currently are not clearly associated with the type to which they refer.
The name doesn't help in that regard either.

The capability and flags are used in the Hgfs session creation by
both the server and client to dictate the protocol operation versions
to be used during the lifetime of that session. The flags denote
which operations are currently used and how they are expected to be
used.

8 years agoUpdate the Tools-10.2.0-Beta Open Source License Files.
Oliver Kurth [Mon, 23 Oct 2017 21:21:19 +0000 (14:21 -0700)] 
Update the Tools-10.2.0-Beta Open Source License Files.

8 years agohosted file locking: An upper bound on creating the lock directory
Oliver Kurth [Mon, 23 Oct 2017 21:21:19 +0000 (14:21 -0700)] 
hosted file locking: An upper bound on creating the lock directory

There is currently no upper bound on how long we wait to enter a hosted
file lock (create lock directory and the direct entry (the "D")). Fix
this.

8 years agoAdd Str_Strncpy
Oliver Kurth [Mon, 23 Oct 2017 21:21:19 +0000 (14:21 -0700)] 
Add Str_Strncpy

Add a Str_Strncpy function that, unlike strncpy, guarantees
NUL-termination.

8 years agolib/file: Hosted file locking code robustness improvement
Oliver Kurth [Mon, 23 Oct 2017 21:21:19 +0000 (14:21 -0700)] 
lib/file: Hosted file locking code robustness improvement

The hosted file locking code tosses a random number generator and
creates an directory name (D name) and member name (M name) that both
use the random number.

If the D name cannot be created we try again until we can create one.
The assumption is other lockers are racing with the code. The random
number generator makes the chance of collisons small and soon we get
a D name.

Once a D name can be created, we check if the M name exists. If it
does, we remove the D name and try again until we get a unique D and
M name. Once the M name is created, the D name is discarded.

If we're unable to remove the D name, we could land up filling the
locking directory with garbage that cannot be cleaned up. Fail if
we're unable to remove the D entry.

8 years agoAdd a poll flag for one-shot callbacks in AsyncSocket.
Oliver Kurth [Mon, 23 Oct 2017 21:21:19 +0000 (14:21 -0700)] 
Add a poll flag for one-shot callbacks in AsyncSocket.

8 years agoDisable lib/string wprintf functions for non-Windows builds
Oliver Kurth [Mon, 23 Oct 2017 21:21:19 +0000 (14:21 -0700)] 
Disable lib/string wprintf functions for non-Windows builds

The lib/string wprintf functions currently are enabled only
for Windows and Linux builds, but Windows is the only
platform that uses them.  Disable them for Linux, too.

This also means HAS_BSD_WPRINTF can be removed.