]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:17 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoBump Tools version to 10.2.0
Oliver Kurth [Fri, 15 Sep 2017 18:23:17 +0000 (11:23 -0700)] 
Bump Tools version to 10.2.0

Bump the Tools version to 10.2.0 for the next feature release.

8 years agoExtern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:17 +0000 (11:23 -0700)] 
Extern "C"

8 years agoMinor cleanup in public/backdoor_def.h
Oliver Kurth [Fri, 15 Sep 2017 18:23:17 +0000 (11:23 -0700)] 
Minor cleanup in public/backdoor_def.h

8 years agoFix build error in message.c
Oliver Kurth [Fri, 15 Sep 2017 18:23:17 +0000 (11:23 -0700)] 
Fix build error in message.c

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:17 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:17 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:17 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoRevert previous commit.
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Revert previous commit.

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agolib/file, lib/misc: style commonization
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
lib/file, lib/misc: style commonization

8 years agolib/file: style commonization
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
lib/file: style commonization

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoHgfs FUSE Client: Improve write error log message
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Hgfs FUSE Client: Improve write error log message

A simple improvement to provide a more complete error message when
an error occurs writing data to the HGFS server.

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agolib/file: style fixes
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
lib/file: style fixes

Some changes were against the style of lib/file. Fix this.

8 years agoRevert previous commit.
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
Revert previous commit.

8 years agoUninline CodeSet_Utf8FindCodePointBoundary
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
Uninline CodeSet_Utf8FindCodePointBoundary

It's a bit too big...

8 years agoHgfs FUSE client: fix broken attribute caching on writes
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
Hgfs FUSE client: fix broken attribute caching on writes

The FUSE write implementation incorrectly invalidated the cache of file
attributes. The return code for the write operation checked for only invalidating
attribute cache if the result was zero. However, this result is negative for
an error (in which case the cached attributes should not be invalidated) and anything
else is the number of bytes written.

The fix for the broken attribute caching on writes is made to check the result
for greater than zero so any success. If no bytes were actually written we take
the conservative approach of still invalidating the cache as so all the files
attributes for that file will be reset in the FUSE client. This should be rare
at best.

8 years agoFix typo in open-vm-tools OSL.
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
Fix typo in open-vm-tools OSL.

8 years agoSet up pid/socket directory earlier
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
Set up pid/socket directory earlier

/var/run/vmware is used for both the sockets and the
pid file.  In fresh open-vm-tools scenarios, it tends
not to exist when we need it for the pid file.  Refactor
the code and make sure it exists soon enough to be used
for the pid file.

8 years agoUse realloc_n instead of realloc
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
Use realloc_n instead of realloc

Now that we have a modern glib, use g_realloc_n() since its a bit safer.

8 years agoUpdate the Open Source License Files for Tools-10.1.0 and open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
Update the Open Source License Files for Tools-10.1.0 and open-vm-tools.

8 years agocodesetBase.c should have no dependencies
Oliver Kurth [Fri, 15 Sep 2017 18:23:15 +0000 (11:23 -0700)] 
codesetBase.c should have no dependencies

These are routines that can be used anywhere without being tied
to the rest of codeset.

8 years agoAdd some missing debug logs in vixTools.c.
Oliver Kurth [Fri, 15 Sep 2017 18:23:14 +0000 (11:23 -0700)] 
Add some missing debug logs in vixTools.c.

Add log messages corresponding to VIX error VIX_E_FILE_NAME_INVALID (=22).

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:14 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoCopyright changes
Oliver Kurth [Fri, 15 Sep 2017 18:23:14 +0000 (11:23 -0700)] 
Copyright changes

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:14 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:14 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoCopyright changes
Oliver Kurth [Fri, 15 Sep 2017 18:23:14 +0000 (11:23 -0700)] 
Copyright changes

8 years agoCopyright changes
Oliver Kurth [Fri, 15 Sep 2017 18:23:13 +0000 (11:23 -0700)] 
Copyright changes

8 years agoCopyright changes
Oliver Kurth [Fri, 15 Sep 2017 18:23:13 +0000 (11:23 -0700)] 
Copyright changes

8 years agoCopyright changes
Oliver Kurth [Fri, 15 Sep 2017 18:23:12 +0000 (11:23 -0700)] 
Copyright changes

8 years agoChanges to common header files; not directly applicable to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:12 +0000 (11:23 -0700)] 
Changes to common header files; not directly applicable to open-vm-tools.

8 years agoLog level change in CAF - Changing default log level to ERROR
Oliver Kurth [Fri, 15 Sep 2017 18:23:12 +0000 (11:23 -0700)] 
Log level change in CAF - Changing default log level to ERROR

8 years agoCommon header file change; not applicable to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:12 +0000 (11:23 -0700)] 
Common header file change; not applicable to open-vm-tools.

8 years agovm_atomic needs to have an internal extern "C".
Oliver Kurth [Fri, 15 Sep 2017 18:23:12 +0000 (11:23 -0700)] 
vm_atomic needs to have an internal extern "C".

8 years agoC++ extern clean up issue
Oliver Kurth [Fri, 15 Sep 2017 18:23:12 +0000 (11:23 -0700)] 
C++ extern clean up issue

8 years agoRemove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:12 +0000 (11:23 -0700)] 
Remove extern "C"

8 years agoRemove unnecessary extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Remove unnecessary extern "C"

8 years agoFormatting/indentation fixes to lib/file.
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Formatting/indentation fixes to lib/file.

8 years agoFormatting/indentation fixes to lib/file.
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Formatting/indentation fixes to lib/file.

8 years agoRevert previous commit.
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Revert previous commit.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoConsistent #ifdef style in err.h
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Consistent #ifdef style in err.h

8 years agoRevert previous change
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Revert previous change

8 years agostrerror is not thread safe
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
strerror is not thread safe

Replace with Err_Errno2String.

8 years agoSwitch to Err_Errno2String for thread safety
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Switch to Err_Errno2String for thread safety

Start cleaning up strerror usage.

8 years agoRemove Hostinfo_OSIsSMP
Oliver Kurth [Fri, 15 Sep 2017 18:23:11 +0000 (11:23 -0700)] 
Remove Hostinfo_OSIsSMP

8 years agomake System_GetTimeMonotonic() really monotonic
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
make System_GetTimeMonotonic() really monotonic

Solaris has an issue where times() can return a lower value than it
returned earlier, making it non-monotonic. This change works
around this by saving the last returned value and returning that
if the times() function return a lower value.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoProperly configure xmlsec1 for CentOS
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Properly configure xmlsec1 for CentOS

Some distros build xmlsec1 with dynamic crypto, so do things slightly
differently.

Also work around an issue with the way Redhat & SuSE package xmlsec1.
They built it with -DXMLSEC_NO_SIZE_T, but that flag isn't properly
exposed by xmlsec1-config.  This results in a bunch of xmlsec1 data
structures (anything with an xmlSecSize in it) being different between
the lib and our code, and it tends not to work when our code references
fields in the data structure.  This change always sets -DXMLSEC_NO_SIZE_T.

8 years agoBackout asyncSocket change to not exit recv loop early when SSL_Pending is zero
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Backout asyncSocket change to not exit recv loop early when SSL_Pending is zero

Change being reverted:

After reading some bytes with SSL_Read() and firing any
callbacks, we would make a call to SSL_Pending() and, if that
returned zero, we would break out of the read loop and return.
We would only make a second call to SSL_Read() if Pending()
returned a non-zero value.

There are several problems with this.

Firstly, having bytes buffered up within SSL is a reason to
continue performing SSL_read()s, but not having bytes buffered
is not a reason to stop.

If the socket does not have SSL enabled, for instance,
Pending() always returned zero, so non-SSL sockets would never
actually loop here and every read would bounce back through
Poll.

Even in the case where SSL is enabled, this function returns
only the number of bytes buffered inside the SSL context and
provides no information about whether the socket itself has
bytes available for immediate read.

So, again, if SSL_Pending() is non-zero, we want to keep on
reading data with SSL_Read(), and if it is zero, we *still*
want to keep on reading data the socket itself may have more
data immediately available.

8 years agoUse /etc as default dir for pam instead of sysconfdir
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Use /etc as default dir for pam instead of sysconfdir

sysconfdir evaluates to $(prefix)/etc by default, which evaluates
to /usr/local/etc by default. This is (almost?) never a correct path
for pam config files except for FreeBSD, so set the default to /etc,
with the exception of FreeBSD.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoAdditional AsyncSocket API clean-up.
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Additional AsyncSocket API clean-up.
  - Convert void-returning asyncsocket entrypoints to have an integer
    return type, returning ASOCKERR_*/
  - Do not exit recv loop early when SSL_Pending is zero; the socket
    itself may have more data immediately available.
  - Allow a small number of recursives uses of the send callback.

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

8 years agoBump tools version to 10.0.10
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Bump tools version to 10.0.10

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:10 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoHgfs Linux Kernel Client: Fix RHEL 7 system backports
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Hgfs Linux Kernel Client: Fix RHEL 7 system backports

RHEL 7.3 introduced some backport changes for the Linux kernel
which broke some of the assumptions about wait_on_bit function
arguments.  This fixes the test of wait_on_bit compile which
accidentally tests the function in kernel 3.17.0 which will
always fail instead of intentionally failing with the pragma.

8 years agoHgfs Linux Kernel Client: fix RHEL 7 system backports
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Hgfs Linux Kernel Client: fix RHEL 7 system backports

RHEL 7.3 introduced some backport changes for the Linux kernel which broke
some of the assumptions about wait_on_bit function arguments.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoMove include of rateconv.h in hostinfoPosix
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Move include of rateconv.h in hostinfoPosix

rateconv.h is only needed for the Mac system timer
conversion. Move the include.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoImprove network recovery for Linux Virtual Desktop Infrastructure.
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Improve network recovery for Linux Virtual Desktop Infrastructure.
Client needs to react to an unexpected disconnect and reconnect with a saved session id and path.

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

8 years agoHostinfo_SystemTimerNS
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Hostinfo_SystemTimerNS

On Apple, switch from using floating-point to fixed-point
for nanosecond time conversions on iOS. (Note: x86 is 1:1
so never used floating point). Fixed point is easily faster,
plus uses a 128-bit multiply that avoids overflow. Added
some comments to point out "interesting" cases that show
why we do not use Apple's documented method.

8 years agoFix localization code
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Fix localization code

The code that loads a message catalog attempted to handle
continuation lines.  However, it ended up dropping anything
it decided wasn't a continuation line.

The end result is that any message catalog that had
multiple valid entries without any empty lines
between them would lose valid data.

8 years agoChanges to common header files; not applicable to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Changes to common header files; not applicable to open-vm-tools.

8 years agoRevert the change to add DarwinPre15 to the guest os table.
Oliver Kurth [Fri, 15 Sep 2017 18:23:09 +0000 (11:23 -0700)] 
Revert the change to add DarwinPre15 to the guest os table.

8 years agoHostinfo_SystemTimerNS: Inlining
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
Hostinfo_SystemTimerNS: Inlining

Now that we require glibc-2.5+, we can
also require the glibc-2.4 clock_gettime() call
be implemented. CLOCK_MONOTONIC is required for
all clock_gettime() implementations (per POSIX),
so the implementation here just became Really Easy.
This is intended as a code simplification / standardization;
there is no expected performance impact.

8 years agoAdd linuxDeploymentUtilities to libDeployPkg
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
Add linuxDeploymentUtilities to libDeployPkg

8 years agoRevert previous change.
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
Revert previous change.

8 years agoHostinfo_SystemTimerNS: Inlining
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
Hostinfo_SystemTimerNS: Inlining

Now that we require glibc-2.5+, we can
also require the glibc-2.4 clock_gettime() call
be implemented. CLOCK_MONOTONIC is required for
all clock_gettime() implementations (per POSIX),
so the implementation here just became Really Easy.
This is intended as a code simplification / standardization;
there is no expected performance impact.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoHostinfo_SystemTimerNS: Update Tools build files
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
Hostinfo_SystemTimerNS: Update Tools build files

The tools build files need some light touch-ups to
make librt.so mandatory (Linux and Solaris only).
- configure.ac: Linux already required librt, add
  a Solaris requirement
- vmtoolslib.make: add a Solaris requirement

8 years agoUpdate glib and pcre for FreeBSD and Solaris
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
Update glib and pcre for FreeBSD and Solaris

Update glib, pcre, and additional libraries they require
for FreeBSD and Solaris.

With this change, a release note will be needed to advise
users to add the following lines to /etc/libmap.conf before
installing vmtools on FreeBSD 6.x:

  [/usr/local/lib/vmware-tools/]
  libpthread.so.2 libthr.so.2
  libpthread.so   libthr.so

The presence of these lines will cause the run-time linker to use
libthr.so.2 whenever it encounter a dependency on libpthread.so.2
in an executable whose path starts with /usr/local/lib/vmware-tools.

The reason for the release note is as follows.  FreeBSD provides
a threads library called libthr.so.2.  In FreeBSD 6.x, this library
is separate from and incompatible with libpthread.so.2.  In FreeBSD
7 or later, libpthread.so.2 is a symlink to libthr.so.2.

vmtoolslib is linked against libthr.so.2, while libgthread-2.0.so.0
and libglib-2.0.so.0 are linked against libpthread.so.2.  On FreeBSD
7 or later, this works fine since libpthread.so.2 is a symlink to
libthr.so.2, as noted above.  However, on FreeBSD 6.x, vmtoolsd
core dumps because libthr.so.2 and libpthread.so.2 are separate
libraries, hence both are loaded and their incomatibility results
in a core dump.

Adding the above lines in /etc/libmap.conf will keep libpthread.so.2
from being loaded, thereby allowing vmtoolsd to run.

8 years agoUpdate the guest OS table for darwinPre15 if the GOS is 10.10 and earlier.
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
Update the guest OS table for darwinPre15 if the GOS is 10.10 and earlier.

8 years agoMore AsyncSocket changes. In AsyncTCPSocketBlockingWork(), do not block
Oliver Kurth [Fri, 15 Sep 2017 18:23:08 +0000 (11:23 -0700)] 
More AsyncSocket changes.  In AsyncTCPSocketBlockingWork(), do not block
necessary.  Reverse the order of the read/write and poll/select opterations.
This reduces latency when the socket is ready for the I/O operation.
This low latency option is "off" be default.

Changes to common header files; not directly applicable to open-vm-tools.

8 years agoUpdate glib and pcre for Tools for Windows, Linux and ESXi.
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
Update glib and pcre for Tools for Windows, Linux and ESXi.

This change adds a new glib.mk whose scope is local to the tools build.
The new version of glib depends upon libpcre, libiconv and libffi.

8 years agoChange to shared header file unrelated to open-vm-tools.
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools.

8 years agoUpdate VGAuth source for compilation with OpenSSL 1.0.x or 1.1.0
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
Update VGAuth source for compilation with OpenSSL 1.0.x or 1.1.0

OpenSSL 1.1.0 is about to released.  With that release comes a number
of changes that include making several types opaque.  Along with this,
new or renamed setter/getter functions appear.   The API changes and
the impact on open-source products is discussed at:
https://wiki.openssl.org/index.php/1.1_API_Changes.  Updated man pages
are available at: https://www.openssl.org/docs/manmaster/

The impact to  open-vm-tools is that the message digest type MD_CTX
has become opague.  Local (stack) MD_CTX objects are not supported.
The required change is to dynamically allocate MD_CTX objects as needed
using the 1.1.0 API xxx_new() and xxx_free() or the pre-1.1.0 functions
xxx_create() and xxx_destroy().

8 years agoAdd string concatenation function to DynBuf
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
Add string concatenation function to DynBuf

The DynBuf code operates on both strings and non-strings.  To add a
string at the end of a DynBuf is easy: DynBuf_AppendString() appends
a copy of the input string, including its NULL-termination.  Sometimes
strings are repeatedly concatenated, such that a version of this
function without NULL-termination is needed.

This change implements DynBuf_ConcatString() which explicitly does not
copy the NULL at the end of a string.

8 years agoRemove AsyncSocket_ConnectProxySocket() declaration from asyncsocket.h.
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
Remove AsyncSocket_ConnectProxySocket() declaration from asyncsocket.h.

8 years agoPOSIX FileIOErrno2Result should not log when it is called
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
POSIX FileIOErrno2Result should not log when it is called

POSIX FileIOErrno2Result logs when an errno doesn't map well. This can
cause callers to have unexpected logging. In fact, the Log Facility
got caught by this. Log write errors generated more logs!

This has, at times, lead to spew in the logs. Logging could occur on
each I/O failure!

If an error needs to be logged, the caller should check the error
status and react accordingly. They can use Err_Errno to get the
native error in a platform independent way.

Remove the logging in FileIOErrno2Result; Add logging for open
failures that are from "unusual" errors; remove logging from I/O
errors.

8 years agolib/file: Explcitly catch EIO in fileIOPosix.c
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
lib/file: Explcitly catch EIO in fileIOPosix.c

No need to log as EIO is a known possibility.

8 years agoMore remove extern "C"
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
More remove extern "C"

8 years agoChange to shared header file unrelated to open-vm-tools
Oliver Kurth [Fri, 15 Sep 2017 18:23:07 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools

8 years agoVThreadBase: missing typecast on mac
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
VThreadBase: missing typecast on mac

Seems the mac tools compiler is a wee bit picker, and needs
an implicit typecast instead of implicit. Obvious fix.

8 years agoVThreadBase signal counting: remove malloc
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
VThreadBase signal counting: remove malloc

This is the easy first half of rewriting VThreadBase to not malloc
within signal handlers. The second half is still under construction.

The core problem is that malloc() inside a signal handler can
deadlock; consider especially the case of malloc() detecting
heap corruption -> SEGV -> signal handler -> malloc() and
self-deadlocking. Thus, the overall plan is to stop malloc()ing
and instead use TLS variables ... as the new comment points out,
we can now count on good TLS behavior since Linux and Windows
minimum OS versions bumped.

In the signal handler case this is easy: if __thread is available
we can just use that as a counter. Life is a little more tricky
without __thread (see: macOS and Android), where we need to use
pthread_{get,set}specific() calls. Use a constructor/destructor
to manage the TLS keys, which is a strategy dependent on the
TLS destructor being NULL. (Specifically, on library unload
the destructor function can remove the TLS key but cannot fire
the TLS destructor on all threads, which would leak).
One small note, the use of an atomic is not needed here because
only the current thread can set the value and, if interrupted by
a signal, the stack preserves the correct value.

Two other minor things deserve mention: first, remove the TID
parameter from VThreadBase_SetIsInSignal(); it was only used for
self. Second, re-ordered setting is-in-signal and the first
VThread_CurID() in the signal handler; this means the VThread_CurID()
implementation can check whether we are in a signal handler, a
feature that will matter in a future change.

Net result: the signal counting part can now run without any memory
allocations whatsoever. Memory allocation is thus needed only for
the thread ID and name. Stay tuned for TID/name in a future change.

8 years agoReorganization of the AsyncSocket API layer into an interface dispatch
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
Reorganization of the AsyncSocket API layer into an interface dispatch
layer and separate disjoint socket implementations.

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

8 years agoFinal cleanup of xmlsec1 work
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
Final cleanup of xmlsec1 work

Do a final cleanup pass

8 years agoRestore AC_VMW_DEFAULT_FLAGS([XERCES])
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
Restore AC_VMW_DEFAULT_FLAGS([XERCES])

The command AC_VMW_DEFAULT_FLAGS([XERCES]) was lost with
a prior change. Restore it.

8 years agoChange to shared header file unrelated to open-vm-tools
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools

8 years agoChange to shared header file unrelated to open-vm-tools
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
Change to shared header file unrelated to open-vm-tools

8 years agolink resolution plugins with -ldl
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
link resolution plugins with -ldl

8 years agoMinor dead code removal
Oliver Kurth [Fri, 15 Sep 2017 18:23:06 +0000 (11:23 -0700)] 
Minor dead code removal

Hostinfo_GetPCFrequency: function has no callsites. And
now that Windows Hostinfo_SystemTimerNS is Really Fast(tm),
amortizing ticks-to-nanosecond conversions doesn't make sense.

Util_TokenHasInteractPriv: has only one callsite, used in
a log message. Delete.