]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoInclude vmware/tools/log.h to define g_info.
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Include vmware/tools/log.h to define g_info.

A recent change added a call to g_info from syncManifest.c.  This
in turn is causing open-vm-tools builds to fail because g_info is
not available on SLES 12sp1.

To fix the problem, include vmware/tools/log.h in syncManifest.c.
log.h defines g_info as a macro.

6 years agoCommon header file change not directly applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Common header file change not directly applicable to open-vm-tools.

6 years agoBack out the previous change to remove support for building with
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Back out the previous change to remove support for building with
xml-security-c and xerces-c.

6 years agoRemove support for building with xml-security-c and xerces-c
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Remove support for building with xml-security-c and xerces-c

Remove support for building VMTools with xml-security-c.  Since
xml-security-c is the only requirement for xerces-c, xerces-c
is dropped as well.

There is also some cleanup of the handling of some configure
options related to vgauth, ssl, xmlsec1, and xml2.

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

6 years agoAlways send VMBACKUP_EVENT_GENERIC_MANIFEST during quiesced snapshots.
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Always send VMBACKUP_EVENT_GENERIC_MANIFEST during quiesced snapshots.

vSphere 6.7 added a host-side interface that allows VMTools to send
a "generic" backup manifest during a quiesced snapshot on Linux guests.
VMTools 10.2.0 or later tries to notify the host of the backup manifest
file through a vmbackup event message VMBACKUP_EVENT_GENERIC_MANIFEST.
If the host is unable to field the message, then VMTools logs the
failure and then continues with the quiesced snapshot in the older
fashion, without the backup manifest.

An earlier change attempted to reduce the amount of logging done when
running on older hosts that don't support VMBACKUP_EVENT_GENERIC_MANIFEST
by detecting when sending VMBACKUP_EVENT_GENERIC_MANIFEST fails and
not sending the message again for subsequent quiesced snapshots.
However, subsequent stress testing has uncovered problems with this
approach when running on newer hosts; specifically, errors may sometimes
be encountered on newer hosts when sending VMBACKUP_EVENT_GENERIC_MANIFEST.
Therefore this change backs out that earlier change.

Note that the need to solve the problem that that earlier change was
intended to solve has been reduced because support for
VMBACKUP_EVENT_GENERIC_MANIFEST has been backported to vSphere 6.5
P03, which is available, and vSphere 6.0 P08, which is scheduled for
release later this year.  ESXi 5.5 is out of general support.

This change also addresses an issue that surfaced when testing on a
host without support for VMBACKUP_EVENT_GENERIC_MANIFEST.
If VMTools fails to send VMBACKUP_EVENT_GENERIC_MANIFEST, the quiesced
snapshot operation will be aborted rather than continuing as it should.
To address this, create a new function, VmBackup_SendEventNoAbort,
which does not abort the quiesced snapshot on failure, and call that
function rather than VmBackup_SendEvent when sending
VMBACKUP_EVENT_GENERIC_MANIFEST.

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

6 years agoAdd disk UUID to GuestDiskInfo
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Add disk UUID to GuestDiskInfo

Add UUID/Serial number to the GuestDiskInfo.

6 years agoLinux DeployPkg should provide a configurable timeout for the spanning
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Linux DeployPkg should provide a configurable timeout for the spanning
customization process.  Right now it is hard-coded to 100 seconds.

Sources to provide "timeout" value:
1. Clients such as vCenter and SRM can pack timeout value in cab header
   via API func "DeployPkg_SetProcessTimeout(uint16 timeout)".  this timeout
   value will be implemented during the package deployment process.
2. Package deployment engines:
  - tools deployPkg plugin:
    Add "process-timeout" in tools.conf.  The tools deployPkg plugin will use
    that value to control the time period of the package deployment.
  - linuxDeployPkg:
    Add "-t <timeout>" as optional argument in linuxDeployPkg
    Usage: ./linuxDeployPkg -d <cabfile> -t <timeout> --skip-reboot
3. Default value in deployPkg is 100s.  If both the client and package
   deployment engines don't provid this value, then the default value of
   100s will be used.
4. The "timeout" value from clients will overwrite the value from the
   deployment engines when both of them provid this value.

6 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -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, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Common header file change not applicable to open-vm-tools.

6 years agoCommon source file changes not directly applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Common source file changes not directly applicable to open-vm-tools.

6 years agoCommon header file change not directly applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:31 +0000 (12:51 -0800)] 
Common header file change not directly applicable to open-vm-tools.

6 years agoCommon header file change not applicable to open-vm-toold.
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
Common header file change not applicable to open-vm-toold.

6 years agoCommon header file change not directly applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
Common header file change not directly applicable to open-vm-tools.

6 years agoUse the LSB and os-release data to find the best guest identification
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
Use the LSB and os-release data to find the best guest identification

Historically, we have the LSB to describe a Linux distro.  More
recently, the os-release standard was added.  Change our guest
identification code to attempt to use both data - when available - and
make a value judgement as to which is better.

6 years agoSend diskInfo as a json document. Modernize diskInfo RPC.
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
Send diskInfo as a json document.  Modernize diskInfo RPC.

6 years ago[Part 2] GuestLib support for 64bit memory shares.
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
[Part 2] GuestLib support for 64bit memory shares.

MEMSCHED_SHARES_MAX is currently set to MAX_PPN and will not fit in
32-bit soon. 'memshares' property which is currently available in GuestSDK
is an unsigned 32bit value.  Starting from ESX 7.0, this value is available
only if it can be fit in an unsigned 32-bit data type.

'memShares64' is the new unsigned 64-bit property added in GuestSDK for the
memory shares.

Added necessary APIs to retrieve the memshares64 value.  The new API
VMGuestLib_GetMemShares64 will first try to retrieve the memShares64 property.
If the underlying host is an older one, then the API will return the memShares
property.

Updated the vmGuestLibTest code to retrieve and print the new memShares64 value.

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

6 years agoUpdate seamless window's copyright year as 1998-2019
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
Update seamless window's copyright year as 1998-2019

1. Changing the COPYRIGHT_YEARS in vm_legal.h to 1998-2019
2. COPYRIGHT_YEARS is used by UTF8_COPYRIGHT_STRING_BASE and
   UTF16_COPYRIGHT_STRING for win32 UTF-16 version.

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

6 years agoCommon header file change not directly applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
Common header file change not directly applicable to open-vm-tools.

6 years agoCommon header file change not directly applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
Common header file change not directly applicable to open-vm-tools.

6 years ago[Part 1] GuestLib support for 64bit memory shares.
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
[Part 1] GuestLib support for 64bit memory shares.

MEMSCHED_SHARES_MAX is currently set to MAX_PPN and will not fit in 32-bit soon.

Changed the datatype of 'memshares' property to uint64 for the future support.

'memshares' is exposed in GuestLib as unsigned 32-bit value.
Modified the ESX code to set this property only if the vaulue can be fit in
a uint32 type. Else, the value is not set and 'valid' bit set is set to FALSE.

Added a new property "memShares64" (as uint64) in GuestLib for the new
64-bit memory shares.

This CLN implements only the necessary changes on ESX side.

6 years agoChanges to common header files not applicable to open-vm-tools.
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
Changes to common header files not applicable to open-vm-tools.

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

6 years ago[Asyncsocket] Avoid ASSERT failure when removing recv callback if fd has POLL_FLAG_AC...
Oliver Kurth [Tue, 19 Feb 2019 20:51:30 +0000 (12:51 -0800)] 
[Asyncsocket] Avoid ASSERT failure when removing recv callback if fd has POLL_FLAG_ACCEPT_INVALID_FDS flag set.

6 years agoSecurity issue with the intermediate staging directory used for DnD and CnP
Oliver Kurth [Tue, 19 Feb 2019 20:51:29 +0000 (12:51 -0800)] 
Security issue with the intermediate staging directory used for DnD and CnP

Problem:
/tmp/VMwareDnD is a staging directory used for DnD and CnP.  It should be
a regular directory, but malicious code or user may create the /tmp/VMwareDnD
 as a symbolic link which points to the home directory of the current desktop
user before the staging directory is created.  Later when the desktop user
initiates a DnD or CnP operation, the permission of that user's home directory
will be changed allowing the malicious user full access to the desktop user's
home directory.

Solution:
Do not set the permission of the staging directory if that directory already
exists and has the wrong permission.  The permission of the directory will
be 1777 if it is created by VMTools.  If that is not the case, the directory
has been created or modified by malicious code or user; just cancel the host
to guest DnD or CnP operation.

7 years agosync deploypkg files
Oliver Kurth [Thu, 7 Feb 2019 00:47:22 +0000 (16:47 -0800)] 
sync deploypkg files

7 years agoUpdate copyright year to 2019 for OVT 10.3.10 files.
Oliver Kurth [Wed, 6 Feb 2019 01:36:53 +0000 (17:36 -0800)] 
Update copyright year to 2019 for OVT 10.3.10 files.

* Few dnd related files have been modified since 10.3.5 OVT and
we just missed updating the copyright year to 2019.

* Updated the copyright year accordingly.

7 years agoFix CentOS 7.6 detection
Oliver Kurth [Wed, 30 Jan 2019 01:24:44 +0000 (17:24 -0800)] 
Fix CentOS 7.6 detection

The version information in /etc/centos-release has 3 parts,
in particular for CentOS 7.6:

CentOS Linux release 7.6.1810 (Core)

This was misidentified as CentOS 6 because the substring "6."
was matched before matching "7.". This change fixes this by
requiring a space before the major version.

7 years agoInclude vmware/tools/log.h to define g_info.
Oliver Kurth [Wed, 30 Jan 2019 01:24:44 +0000 (17:24 -0800)] 
Include vmware/tools/log.h to define g_info.

A recent change added a call to g_info from syncManifest.c.  This
in turn is causing open-vm-tools builds to fail because g_info is
not available on SLES 12sp1.

To fix the problem, include vmware/tools/log.h in syncManifest.c.
log.h defines g_info as a macro.

7 years agoAlways send VMBACKUP_EVENT_GENERIC_MANIFEST during quiesced snapshots.
Oliver Kurth [Wed, 30 Jan 2019 01:24:44 +0000 (17:24 -0800)] 
Always send VMBACKUP_EVENT_GENERIC_MANIFEST during quiesced snapshots.

vSphere 6.7 added a host-side interface that allows VMTools to send
a "generic" backup manifest during a quiesced snapshot on Linux guests.
VMTools 10.2.0 or later tries to notify the host of the backup manifest
file through a vmbackup event message VMBACKUP_EVENT_GENERIC_MANIFEST.
If the host is unable to field the message, then VMTools logs the
failure and then continues with the quiesced snapshot in the older
fashion, without the backup manifest.

An earlier change attempted to reduce the amount of logging done when
running on older hosts that don't support VMBACKUP_EVENT_GENERIC_MANIFEST
by detecting when sending VMBACKUP_EVENT_GENERIC_MANIFEST fails and
not sending the message again for subsequent quiesced snapshots.
However, subsequent stress testing has uncovered problems with this
approach when running on newer hosts; specifically, errors may sometimes
be encountered on newer hosts when sending VMBACKUP_EVENT_GENERIC_MANIFEST.
Therefore this change backs out that earlier change.

Note that the need to solve the problem that that earlier change was
intended to solve has been reduced because support for
VMBACKUP_EVENT_GENERIC_MANIFEST has been backported to vSphere 6.5
P03, which is available, and vSphere 6.0 P08, which is scheduled for
release later this year.  ESXi 5.5 is out of general support.

This change also addresses an issue that surfaced when testing on a
host without support for VMBACKUP_EVENT_GENERIC_MANIFEST.
If VMTools fails to send VMBACKUP_EVENT_GENERIC_MANIFEST, the quiesced
snapshot operation will be aborted rather than continuing as it should.
To address this, create a new function, VmBackup_SendEventNoAbort,
which does not abort the quiesced snapshot on failure, and call that
function rather than VmBackup_SendEvent when sending
VMBACKUP_EVENT_GENERIC_MANIFEST.

7 years agoUpdate copyright year to 2019.
Oliver Kurth [Wed, 30 Jan 2019 01:24:43 +0000 (17:24 -0800)] 
Update copyright year to 2019.

7 years agoFix some bad derefs in primary NIC gather code
Oliver Kurth [Tue, 29 Jan 2019 22:03:19 +0000 (14:03 -0800)] 
Fix some bad derefs in primary NIC gather code

Found by user in https://github.com/vmware/open-vm-tools/issues/272

Debug code tries to access a struct field that may not be init'd.
Pointer deref'd without a sanity check.

7 years agoFix possible security issue with the permissions of the intermediate
Oliver Kurth [Tue, 29 Jan 2019 22:03:19 +0000 (14:03 -0800)] 
Fix possible security issue with the permissions of the intermediate
staging directory and path

/tmp/VMwareDnD is a staging directory used for DnD and CnP.  It should be
a regular directory, but malicious code or user may create the /tmp/VMwareDnD
as a symbolic link which points elsewhere on the system.  This may provide
user access to user B's files.

Do not set the permission of the root directory if the root directory
already exists and has the wrong permission.  The permission of the directory
must be 1777 if it is created by the VMToolsi.  If not, then the directory
has been created or modified by malicious code or user, so just cancel the
host to guest DnD or CnP operation.

7 years agoCONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate().
Oliver Kurth [Tue, 29 Jan 2019 22:03:19 +0000 (14:03 -0800)] 
CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate().

Red Hat ran coverity scan on open-vm-tools and found an occurrence
of CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate().

7 years agoBail out vmtoolsd early when there are RPC errors.
Oliver Kurth [Tue, 29 Jan 2019 22:03:19 +0000 (14:03 -0800)] 
Bail out vmtoolsd early when there are RPC errors.

VMX state machine could give up quiescing operation for various
reasons when vmtoolsd is busy performing necessary state transitions.
Once VMX gives up quiescing operation, there is no point in
vmtoolsd continuing with it. vmtoolsd should also give up the
operation asap. vmtoolsd can detect VMX state machine change
when it gets errors sending VMBACKUP_PROTOCOL_EVENT_SET RPC.

RPC errors are only used as a trigger to abort the operation.
We ignore the RPC errors that might occur after aborting the
operation.

7 years ago[10.3.10] Update copyright year to 2019.
Oliver Kurth [Tue, 29 Jan 2019 22:03:19 +0000 (14:03 -0800)] 
[10.3.10] Update copyright year to 2019.

Update the copyright year to 2019 for ALL open-vm-tools destined files
modified since the release of 10.3.5.

7 years agoDon't send a backup manifest when aborting a Linux quiesced snapshot.
Oliver Kurth [Tue, 29 Jan 2019 22:03:19 +0000 (14:03 -0800)] 
Don't send a backup manifest when aborting a Linux quiesced snapshot.

When taking a Linux quiesced snapshot, communication failures between
VMX and VMTools may result in VMTools sending a genericManifest event
message after the quiesced snapshot operation has been aborted.  If
this happens, VMX will send an error back to VMTools, which in turn
causes VMTools not to send genericManifest messages on subsequent
quiesced snapshots even if the host supports such messages.

One aspect of the implementation that gives rise to this behavior is
the use of the sync provider's snapshotDone function to undo a
quiescing operation.  Specifically, if VMTools aborts a quiesced
snapshot when the file system is quiesced, the quiescing must be
undone.  Currently, this is handled by calling the sync provider's
snapshotDone function.  This is the same function that is called to
complete the quiescing snapshot protocol when it is successful.  In
some respects this makes sense, since in either case snapshotDone
unquiesces the file system.  However, architecturally and conceptually,
it seems useful to distinguish between the action to be taken in the
successful case versus the aborting case.  It's also useful to do so
in practice, because the successful case sends the genericManifest
event to notify the host there is a backup manifest file, while the
aborting case should not do that.

To address the issue, add an "undo" function for the Linux sync
provider.  The undo function is called instead of snapshotDone as
part of aborting a quiesced snapshot in which the file system is
quiesced at the time of the abort.

7 years agoSpecial-case profile loading for StartProgram
Oliver Kurth [Tue, 29 Jan 2019 22:03:18 +0000 (14:03 -0800)] 
Special-case profile loading for StartProgram

Keep the user's profile loaded for the life of the
program, to avoid races where its unloaded too quickly.

7 years agoChanges to common source files not applicable to open-vm-tools.
Oliver Kurth [Tue, 29 Jan 2019 22:03:18 +0000 (14:03 -0800)] 
Changes to common source files not applicable to open-vm-tools.

7 years agoBump up the SYSIMAGE_VERSION for VMware tools 10.3.10
Oliver Kurth [Tue, 29 Jan 2019 22:03:18 +0000 (14:03 -0800)] 
Bump up the SYSIMAGE_VERSION for VMware tools 10.3.10

The last released deploypkg version for 'VMware Tools' 10.3.5 is 8.4.1.
Bumping up the CBS version to 8.4.10.

7 years agoDeploypkg log files of linux should not be world readable.
Oliver Kurth [Tue, 29 Jan 2019 22:03:18 +0000 (14:03 -0800)] 
Deploypkg log files of linux should not be world readable.

7 years agoGeneral code clean-up.
Oliver Kurth [Tue, 29 Jan 2019 22:03:18 +0000 (14:03 -0800)] 
General code clean-up.

bora/lib/misc/posixPosix.c:
  Treat local variables "len" consistently as "size_t" type in
  Posix_Getmntent_r()

bora-vmsoft/apps/toolbox-cmd/toolboxcmd-shrink.c:
  Improve readability of error handling logic in ShrinkDoWipeAndShrink()
  and remove another line of dead code.

bora-vmsoft/lib/procMgr/procMgrPosix.c:
  Recent discussions about setting "errno" to ENOENT when either
  getpwuid_r() or getpwnam_r() return 0 (success) if there is no passwd
  entry for the user have vacillated.

  Since none of the current callers of the routines in procMgrPosix.c
  query the contents of "errno", the current consensus is to simply log
  a warning message along with reason for the failure.

7 years agoFix NULL pointer dereference and remove three lines of dead code.
Oliver Kurth [Tue, 29 Jan 2019 22:03:18 +0000 (14:03 -0800)] 
Fix NULL pointer dereference and remove three lines of dead code.

QbitLogic has run [Code]Ai on the open-vm-tools source code and
and notified VMware of a potential NULL pointer reference and four
pieces of dead code.

See https://github.com/vmware/open-vm-tools/pull/247

bora-vmsoft/services/vmtoolsd/pluginMgr.c
  The proposed fix conditionally emitted a log message.  That fix has
  been reworked to consistently emit a log message with conditional
  content.

bora/lib/misc/posixPosix.c
bora-vmsoft/apps/toolbox-cmd/toolboxcmd-shrink.c
  Remove one line of dead code from each source file.

bora-vmsoft/lib/procMgr/procMgrPosix.c:
  Suggested dead code fix actually pointed to a bug where errno
  was not getting updated as intended.

bora-vmsoft/services/plugins/guestInfo/perfMonLinux.c:
  Suggested dead code is no longer dead; change not applicable.

7 years agoBump VMware Tools version to 10.3.10 for the next scheduled update release
Oliver Kurth [Tue, 29 Jan 2019 22:03:18 +0000 (14:03 -0800)] 
Bump VMware Tools version to 10.3.10 for the next scheduled update release

Set the VMware Tools version as TOOLS_VERSION_JACKHAMMER_UPDATE2 = 10.3.10

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:06 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoAdd WarningToHost() and WarningToGuest() functions
Oliver Kurth [Wed, 16 Jan 2019 22:53:06 +0000 (14:53 -0800)] 
Add WarningToHost() and WarningToGuest() functions

This change is needed to address the privacy and security changes that
are required so that vmware library warnings can be forwarded to the
host side selectively.

For instance, if a warning message is sent to VMX, the user name must be
stripped from the message.

7 years agoFix CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate().
Oliver Kurth [Wed, 16 Jan 2019 22:53:05 +0000 (14:53 -0800)] 
Fix CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate().

Red Hat ran coverity scan on open-vm-tools and found an occurrence
of CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate().

7 years ago[10.3.10] Update copyright year to 2019.
Oliver Kurth [Wed, 16 Jan 2019 22:53:05 +0000 (14:53 -0800)] 
[10.3.10] Update copyright year to 2019.

Update the copyright year to 2019 for ALL open-vm-tools destined files
modified since the release of 10.3.5.

7 years agoBail out of vmtoolsd early when there are RPC errors.
Oliver Kurth [Wed, 16 Jan 2019 22:53:05 +0000 (14:53 -0800)] 
Bail out of vmtoolsd early when there are RPC errors.

VMX state machine could give up quiescing operation for various
reasons when vmtoolsd is busy performing necessary state transitions.
Once VMX gives up quiescing operation, there is no point in
vmtoolsd continuing with it. vmtoolsd should also give up the
operation asap. The vmtoolsd process can detect VMX state machine
change when it gets errors sending VMBACKUP_PROTOCOL_EVENT_SET RPC.

RPC errors are only used as a trigger to abort the operation.
We ignore the RPC errors that might occur after aborting the
operation.

7 years agoDon't send a backup manifest when aborting a Linux quiesced snapshot.
Oliver Kurth [Wed, 16 Jan 2019 22:53:05 +0000 (14:53 -0800)] 
Don't send a backup manifest when aborting a Linux quiesced snapshot.

When taking a Linux quiesced snapshot, communication failures between
VMX and VMTools may result in VMTools sending a genericManifest event
message after the quiesced snapshot operation has been aborted.  If
this happens, VMX will send an error back to VMTools, which in turn
causes VMTools not to send genericManifest messages on subsequent
quiesced snapshots even if the host supports such messages.

One aspect of the implementation that gives rise to this behavior is
the use of the sync provider's snapshotDone function to undo a
quiescing operation.  Specifically, if VMTools aborts a quiesced
snapshot when the file system is quiesced, the quiescing must be
undone.  Currently, this is handled by calling the sync provider's
snapshotDone function.  This is the same function that is called to
complete the quiescing snapshot protocol when it is successful.  In
some respects this makes sense, since in either case snapshotDone
unquiesces the file system.  However, architecturally and conceptually,
it seems useful to distinguish between the action to be taken in the
successful case versus the aborting case.  It's also useful to do so
in practice, because the successful case sends the genericManifest
event to notify the host there is a backup manifest file, while the
aborting case should not do that.

To address the issue, add an "undo" function for the Linux sync
provider.  The undo function is called instead of snapshotDone as
part of aborting a quiesced snapshot in which the file system is
quiesced at the time of the abort.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon source file change not applilcable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common source file change not applilcable to open-vm-tools.

7 years agoCommon source file change not directly applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common source file change not directly applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoRecord VMware Tools version 10.3.7 used for a patch.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Record VMware Tools version 10.3.7 used for a patch.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoModernize diskInfo RPC
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Modernize diskInfo RPC

Rewrite diskInfo RPC to allow it to be backwards and forwards compatible.
step 1 -- re-org existing code.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoSpecial-case profile loading for StartProgram
Oliver Kurth [Wed, 16 Jan 2019 22:53:04 +0000 (14:53 -0800)] 
Special-case profile loading for StartProgram

Keep the user's profile loaded for the life of the
program, to avoid races where its unloaded too quickly.

7 years agoSwitch some stringxx headers to use angle brackets instead of double quotes
Oliver Kurth [Wed, 16 Jan 2019 22:53:03 +0000 (14:53 -0800)] 
Switch some stringxx headers to use angle brackets instead of double quotes

7 years agoCode clean-up - bora-vmsoft/lib/procMgr/procMgrPosix.c
Oliver Kurth [Wed, 16 Jan 2019 22:53:03 +0000 (14:53 -0800)] 
Code clean-up - bora-vmsoft/lib/procMgr/procMgrPosix.c

Recent discussions about setting "errno" to ENOENT when either
getpwuid_r() or getpwnam_r() return 0 (success) if there is no passwd
entry for the user have vacillated.

Since none of the current callers of the routines in procMgrPosix.c
query the contents of "errno", the current consensus is to simply log
a warning message along with reason for the failure.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:03 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:03 +0000 (14:53 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoChanges to common header files not directly appilcable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:03 +0000 (14:53 -0800)] 
Changes to common header files not directly appilcable to open-vm-tools.

7 years agoStyle: Fix parameter alignment.
Oliver Kurth [Wed, 16 Jan 2019 22:53:03 +0000 (14:53 -0800)] 
Style: Fix parameter alignment.

7 years agoChanges to common header files not applicable to open-vm-tools.
Oliver Kurth [Wed, 16 Jan 2019 22:53:02 +0000 (14:53 -0800)] 
Changes to common header files not applicable to open-vm-tools.

7 years agoUpdates to the DeployPkg guest customization source code.
Oliver Kurth [Tue, 18 Dec 2018 22:12:19 +0000 (14:12 -0800)] 
Updates to the DeployPkg guest customization source code.

7 years agoChanges to common header files; not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Changes to common header files; not applicable to open-vm-tools.

7 years agoChanges to common header files not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Changes to common header files not applicable to open-vm-tools.

7 years agoHeader file guestcust-events.h moved to a new location.
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Header file guestcust-events.h moved to a new location.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoGeneral code clean-up.
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
General code clean-up.

bora/lib/misc/posixPosix.c:
Treat local variables "len" consistently as "size_t" type in
Posix_Getmntent_r()

bora-vmsoft/apps/toolbox-cmd/toolboxcmd-shrink.c:
Improve readability of error handling logic in ShrinkDoWipeAndShrink()
and remove another line of dead code.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoRecord VMware Tools version 10.3.10 as TOOLS_VERSION_JACKHAMMER_UPDATE2
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Record VMware Tools version 10.3.10 as TOOLS_VERSION_JACKHAMMER_UPDATE2

7 years agoBack out previous change to plugins/vix/vixTools.c.
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Back out previous change to plugins/vix/vixTools.c.

Too many subtle issues to trust this one without more testing.

7 years agoCleanup -Wno-incompatible-pointer-types-discards-qualifiers
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Cleanup -Wno-incompatible-pointer-types-discards-qualifiers

Details

Both gcc and clang (on Mac) warn for pointer-incompatible
assignments.  It appears that gcc's -Wwarn-strings isn't working
properly, because it produces no warnings for the following
assignment:

char *potentialSegV = ".rodata-based string";

However, clang does.

This change addresses three problems in bora/lib that produce build
failures when -Wincompatible-pointer-types-discards-qualifiers is
enabled when using clang (one wonders how many other such potential
problems exist?)

o bsd_vsnprintf.c

The 'cp' pointer is assigned the address of a constant string.
Since there are writes through 'cp', the quickest solution is to
declare a local, non-const, array variable that holds the string
"(null)".

o unicodeSimpleTypes.c

This change, the easiest of the three, marks the 'char *' field as
'const'.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:48 +0000 (13:19 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoBackout previous change to vm_basic_asm.h; not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Backout previous change to vm_basic_asm.h; not applicable to open-vm-tools.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
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, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoRevert previous change to vmci_sockets.h.
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Revert previous change to vmci_sockets.h.

7 years agoFix NULL pointer dereference and remove three lines of dead code.
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Fix NULL pointer dereference and remove three lines of dead code.

QbitLogic has run [Code]Ai on the open-vm-tools source code and
and notified VMware of a potential NULL pointer reference and four
pieces of dead code.

See https://github.com/vmware/open-vm-tools/pull/247

bora-vmsoft/services/vmtoolsd/pluginMgr.c
The proposed fix conditionally emitted a log message.  That fix has
been reworked to consistently emit a log message with conditional
content.

bora/lib/misc/posixPosix.c
bora-vmsoft/apps/toolbox-cmd/toolboxcmd-shrink.c
Remove one line of dead code from each source file.

bora-vmsoft/lib/procMgr/procMgrPosix.c:
Suggested dead code fix actually pointed to a bug where errno
was not getting updated as intended.

bora-vmsoft/services/plugins/guestInfo/perfMonLinux.c:
Suggested dead code is no longer dead; change not applicable.

7 years agoRemove erroneous defines of __FreeBSD__ & __VMKTCPIP__ from vmci_sockets.h
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Remove erroneous defines of __FreeBSD__ & __VMKTCPIP__ from vmci_sockets.h

7 years agoAdd VMware Tools version 10.3.6 to vm_tools_version.h
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Add VMware Tools version 10.3.6 to vm_tools_version.h

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agospecial case profile loading for StartProgram
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
special case profile loading for StartProgram

For StartProgram, we need to be sure there's no race in the profile
unloading.  So keep it open through the life of the started program.

See related vgauth change.

7 years agoCommon header file change not applicable to open-vm-tools
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Common header file change not applicable to open-vm-tools

7 years agoFix the issue that Deploypkg log files of linux should not be world readable.
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Fix the issue that Deploypkg log files of linux should not be world readable.

7 years agolib/file: Memory leak in File_ListDirectory when directory is empty
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
lib/file: Memory leak in File_ListDirectory when directory is empty

If the directory is empty, calloc of zero still succeeds and a memory
leak results.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:47 +0000 (13:19 -0800)] 
Common header file change not applicable to open-vm-tools.

7 years agoChanges to common source files not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:46 +0000 (13:19 -0800)] 
Changes to common source files not applicable to open-vm-tools.

7 years agolib/file: Improve File_ListDirectory and File_WalkDirectory*
Oliver Kurth [Tue, 18 Dec 2018 21:19:46 +0000 (13:19 -0800)] 
lib/file: Improve File_ListDirectory and File_WalkDirectory*

The File_WalkDirectory implementation has an initial latency (before
file names are available) that is unnecessary.  Using the unicode
library, when not necessary, adds a huge amount of memory usage and
wastes CPU time.

These routines duplicate quite a bit of code.

Rewrite File_ListDirectory to use File_WalkDirectory*.

Rewrite File_WalkDirectory*:
 - Return files as they are discovered, not after the entire directory
   contents are parsed. If one decides to stop early, they don't have
   to pay the price for the entire directory contents.
 - Preserve the protection from duplicate file names.  While Windows
   locks a directory during a content tranverse, POSIXen does nott. Code
   is here in the lib/file for quite some time so that the numerous
   callers do not have to handle dealing with dups.
 - Avoid using the unicode library on platforms where we can, this avoid
   most of the eggregious memory usage.
 - Don't use Dynbuf... Handling things directly is more efficient.

7 years agoCommon header file change not applicable to open-vm-tools.
Oliver Kurth [Tue, 18 Dec 2018 21:19:46 +0000 (13:19 -0800)] 
Common header file change not applicable to open-vm-tools.