diff -Nru open-vm-tools-12.2.5/debian/changelog open-vm-tools-12.3.0/debian/changelog --- open-vm-tools-12.2.5/debian/changelog 2023-09-11 18:43:03.000000000 +0000 +++ open-vm-tools-12.3.0/debian/changelog 2023-09-06 07:00:51.000000000 +0000 @@ -1,12 +1,15 @@ -open-vm-tools (2:12.2.5-1ubuntu1) mantic; urgency=medium +open-vm-tools (2:12.3.0-1) unstable; urgency=high - * SECURITY UPDATE: SAML token signature bypass vulnerability - - debian/patches/CVE-2023-20900.patch: Allow only X509 certs to verify - the SAML token signature in - open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c. - - CVE-2023-20900 + * [4ed4be4] New upstream version 12.3.0 + (Closes: #1050972) + CVE-2023-20900 + Adressing this CVE also Closes: #1050970 + There are no new features in the open-vm-tools 12.3.0 release. This is + primarily a maintenance release, details can be found at + https://github.com/vmware/open-vm-tools/blob/stable-12.3.0/ReleaseNotes.md + * [779d338] drop d/p/debian/grpc_1.51: no more needed - -- Marc Deslauriers Mon, 11 Sep 2023 14:43:03 -0400 + -- Christian Ehrhardt Wed, 06 Sep 2023 09:00:51 +0200 open-vm-tools (2:12.2.5-1) unstable; urgency=medium diff -Nru open-vm-tools-12.2.5/debian/control open-vm-tools-12.3.0/debian/control --- open-vm-tools-12.2.5/debian/control 2023-09-11 18:43:03.000000000 +0000 +++ open-vm-tools-12.3.0/debian/control 2023-09-06 06:56:32.000000000 +0000 @@ -1,8 +1,7 @@ Source: open-vm-tools Section: admin Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Bernd Zeimetz +Maintainer: Bernd Zeimetz Uploaders: Christian Ehrhardt Build-Depends: debhelper-compat (= 13), doxygen, libcunit1-dev, diff -Nru open-vm-tools-12.2.5/debian/patches/CVE-2023-20900.patch open-vm-tools-12.3.0/debian/patches/CVE-2023-20900.patch --- open-vm-tools-12.2.5/debian/patches/CVE-2023-20900.patch 2023-09-11 18:43:01.000000000 +0000 +++ open-vm-tools-12.3.0/debian/patches/CVE-2023-20900.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From 74b6d0d9000eda1a2c8f31c40c725fb0b8520b16 Mon Sep 17 00:00:00 2001 -From: Katy Feng -Date: Fri, 25 Aug 2023 11:58:48 -0700 -Subject: [PATCH] Allow only X509 certs to verify the SAML token signature. - ---- - open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - ---- a/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c -+++ b/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c -@@ -1335,7 +1335,14 @@ VerifySignature(xmlDocPtr doc, - */ - bRet = RegisterID(xmlDocGetRootElement(doc), "ID"); - if (bRet == FALSE) { -- g_warning("failed to register ID\n"); -+ g_warning("Failed to register ID\n"); -+ goto done; -+ } -+ -+ /* Use only X509 certs to validate the signature */ -+ if (xmlSecPtrListAdd(&(dsigCtx->keyInfoReadCtx.enabledKeyData), -+ BAD_CAST xmlSecKeyDataX509Id) < 0) { -+ g_warning("Failed to limit allowed key data\n"); - goto done; - } - diff -Nru open-vm-tools-12.2.5/debian/patches/debian/grpc_1.51 open-vm-tools-12.3.0/debian/patches/debian/grpc_1.51 --- open-vm-tools-12.2.5/debian/patches/debian/grpc_1.51 2023-07-11 11:22:07.000000000 +0000 +++ open-vm-tools-12.3.0/debian/patches/debian/grpc_1.51 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Description: Fix building with gRPC 1.51+ -Forwarded: https://github.com/vmware/open-vm-tools/issues/676 -Author: László Böszörményi (GCS) -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1025491 -Last-Update: 2023-12-23 - -Index: pkg-open-vm-tools/open-vm-tools/services/plugins/containerInfo/Makefile.am -=================================================================== ---- pkg-open-vm-tools.orig/open-vm-tools/services/plugins/containerInfo/Makefile.am -+++ pkg-open-vm-tools/open-vm-tools/services/plugins/containerInfo/Makefile.am -@@ -63,6 +63,8 @@ libcontainerInfo_la_SOURCES += container - libcontainerInfo_la_CPPFLAGS += @GRPC_CPPFLAGS@ - libcontainerInfo_la_LDFLAGS += -lprotobuf - libcontainerInfo_la_LDFLAGS += -lgrpc++ -+libcontainerInfo_la_LDFLAGS += -lgpr -+libcontainerInfo_la_LDFLAGS += -labsl_synchronization - - tasks.grpc.pb.cc containers.grpc.pb.cc: %.grpc.pb.cc : %.proto %.pb.cc - $(PROTOC) -I. -I$(GOGO_PROTOPATH) \ diff -Nru open-vm-tools-12.2.5/debian/patches/series open-vm-tools-12.3.0/debian/patches/series --- open-vm-tools-12.2.5/debian/patches/series 2023-09-11 18:42:54.000000000 +0000 +++ open-vm-tools-12.3.0/debian/patches/series 2023-09-06 07:00:51.000000000 +0000 @@ -1,4 +1,2 @@ use-debian-pam debian/scsi-udev-rule -debian/grpc_1.51 -CVE-2023-20900.patch diff -Nru open-vm-tools-12.2.5/open-vm-tools/AUTHORS open-vm-tools-12.3.0/open-vm-tools/AUTHORS --- open-vm-tools-12.2.5/open-vm-tools/AUTHORS 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/AUTHORS 2023-08-31 14:38:59.000000000 +0000 @@ -88,3 +88,6 @@ Dirk Mueller Detect the proto files for containerd grpc client on SUSE like systems - https://github.com/vmware/open-vm-tools/pull/626 + +Jan Engelhardt Fix build problems with grpc (at least) 1.54 + - https://github.com/vmware/open-vm-tools/pull/664 diff -Nru open-vm-tools-12.2.5/open-vm-tools/ChangeLog open-vm-tools-12.3.0/open-vm-tools/ChangeLog --- open-vm-tools-12.2.5/open-vm-tools/ChangeLog 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/ChangeLog 2023-08-31 14:38:59.000000000 +0000 @@ -1,72 +1,897 @@ -commit 3b61a0b7145de1eb58bd9c463dcac8241ef185e4 -Author: John Wolfe -Date: Mon Jun 12 16:07:56 2023 -0700 - - ================================================= - open-vm-tools 12.2.5 released at this point. - ================================================= +commit 4fe4b1be1d7139aa571a6431f26904e6f0b77883 +Author: Katy Feng +Date: Thu Aug 31 07:32:27 2023 -0700 + + ================================================= + open-vm-tools 12.3.0 released at this point. + ================================================= + Update of the ChangeLog with the final changes in preparation for - the open-vm-tools 12.2.5 release. + the open-vm-tools 12.3.0 release. + +commit 93e8fb7c1e4423493337661b1b8d39f09a4bbc9d +Author: Katy Feng +Date: Thu Aug 31 07:26:02 2023 -0700 + + open-vm-tools 12.3.0 Release Notes. + +commit 2e0e2d7d9da0e2def013558e583465ebd07d2589 +Author: Katy Feng +Date: Tue Aug 29 07:26:13 2023 -0700 + + Preparing for the open-vm-tools 12.3.0 release. + Syncing the tools version, build number and product build number with + the internal official build of VMware Tools / open-vm-tools 12.3.0. + +commit 7eed1add1249a815763d597adf6d78eda170e3c4 +Author: Katy Feng +Date: Fri Aug 25 12:04:52 2023 -0700 + + Update of the ChangeLog with granular push from the 12.3.0 tools + product branch. + +commit 74b6d0d9000eda1a2c8f31c40c725fb0b8520b16 +Author: Katy Feng +Date: Fri Aug 25 11:58:48 2023 -0700 + + Allow only X509 certs to verify the SAML token signature. + +commit d089aa2d835f93e9c4ce988596a4754a0de68a24 +Author: Katy Feng +Date: Fri Aug 25 11:58:48 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 8681def032026c3cdef872e34bf18e7934ff0145 +Author: Katy Feng +Date: Fri Aug 25 11:58:48 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 8e2c1ae33923b700cd26a8e17c2d74bb355d39dd +Author: Katy Feng +Date: Fri Aug 25 11:58:48 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 96cd002a39a3ec1fd97f1773fb6e8a6ac7dad919 +Author: Katy Feng +Date: Fri Aug 25 11:58:47 2023 -0700 -commit 15c979c79cfc31a8d0cc77ecad1eb9b5369d90b3 -Author: John Wolfe -Date: Mon Jun 12 15:36:15 2023 -0700 + Changes to common source files not applicable to open-vm-tools. - Update the ReleaseNotes.md for the 12.2.5 open-vm-tools release. +commit 641e13fc05118ff8215f9461df424e277cba73dc +Author: Katy Feng +Date: Fri Aug 25 11:58:47 2023 -0700 + + Changes to common source files not applicable to open-vm-tools. + +commit 52e164c04beb853179f3429d69623f988485402d +Author: Katy Feng +Date: Fri Aug 25 11:58:47 2023 -0700 + + Changes to common source files not applicable to open-vm-tools. + +commit 106c96ed660c89262ba71d32becaf3137622160d +Author: Katy Feng +Date: Fri Aug 25 11:58:47 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 75507219d4c87c4e3c805059242f3fb1a8b999b4 +Author: Katy Feng +Date: Fri Aug 25 11:58:47 2023 -0700 + + Allow pre-Windows 2000 style user logon for Linux Guests. + + With this change, applications that requires user/password type + authentication/authorization (done by VGAuth service) for guestOps + can now use pre-windows 2000 style user logon for Linux Guests too. + + Github Issue: https://github.com/vmware/open-vm-tools/issues/641 -commit 941b26d6e012c5fd2184242ae24d5e5559b60c98 -Author: John Wolfe -Date: Mon Jun 12 15:03:03 2023 -0700 +commit 9fdd875b81dded9d33b844ad1fcb2e5d0bd67c65 +Author: Katy Feng +Date: Fri Aug 25 11:58:47 2023 -0700 + + Changes to common source files not applicable to open-vm-tools. + +commit 1335787e74fc86752984c81ea7b0bd1b0065ce89 +Author: Katy Feng +Date: Fri Aug 25 11:57:15 2023 -0700 - Prepare for the open-vm-tools 12.2.0 release. - - Update the tools version in the configure.ac file. - - Update the build numbers in the buildNumber.h header. + ChangeLog update of Aug. 25, 2023. -commit 9da8095daaec2f9d12a47b69bc5fa141782ba86d -Author: John Wolfe -Date: Mon Jun 12 14:53:47 2023 -0700 +commit 518a77a39a30d39c4397d2533bae57880f44ec6e +Author: Katy Feng +Date: Fri Aug 25 11:51:12 2023 -0700 + + ==================================================================== + The "stable-12.3.x" branch was created from the "devel" branch here. + ==================================================================== + + Update ChangeLog with the granular push of Aug. 22, 2023. + - plus ChangeLog update of Apr. 24, 2023. - Change open-vm-tools version to 12.2.5. +commit 14dfd9c00b5321bafc012f678ef1cd2129e03a73 +Author: Katy Feng +Date: Tue Aug 22 15:51:19 2023 -0700 + + Fix build problems with grpc + + Updating Makefiles to put -l specifiers into LIBADD and not LDFLAGS. + Use the grpc++ pkgconfig (.pc file) if it exists to retrieve flags + and libraries for linking. + + Pull request: https://github.com/vmware/open-vm-tools/pull/664 + +commit 6584bcaa8c25da5ef0f20c7f6a17e6b173a25f2d +Author: Katy Feng +Date: Tue Aug 22 15:51:19 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit a1f318dfb992cfee9555a747207fce6721313e2c +Author: Katy Feng +Date: Tue Aug 22 15:51:19 2023 -0700 + + Changes to common source files not applicable to open-vm-tools. + +commit f584dca10f4cc7e0a0733ac5dc8844aac65af7ae +Author: Katy Feng +Date: Tue Aug 22 15:37:45 2023 -0700 + + Enable hostVerfied SAML token feature in Tools. + +commit 4463b84006034879cb1d8cba8ae43f9509c6d0ac +Author: Katy Feng +Date: Tue Aug 22 11:11:43 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 6430649b834da00a81410f7c1d87ca4e67409ada +Author: Katy Feng +Date: Tue Aug 22 11:11:43 2023 -0700 + + Changes to common header files not applicable to open-vm-tools. + +commit 6489b7c0bc4d8fb603cf11ff4605a5d2a975daa8 +Author: Katy Feng +Date: Tue Aug 22 11:11:43 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 447f17dfb33a69a43a6d4ad1b5e486a6b20a6f77 +Author: Katy Feng +Date: Tue Aug 22 11:11:43 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit dfc6ee8aa66b3bfcdefe8020639f2b2ef03c215d +Author: Katy Feng +Date: Tue Aug 22 11:11:43 2023 -0700 + + Changes to common header files not applicable to open-vm-tools. + +commit 859849c55f34a777e6ac2a4e38aab30028b5207a +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 759613baeb1377708123772be1fe70da341b1707 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 972d10eab23dda4d219f919685fbcd2651a57165 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 6852459279251412d01b073de977c1848119918c +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 8a3103cfb7d68f7e501c16f8ddb4cc998a68ad20 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Changes to common header files not applicable to open-vm-tools. + +commit 8047bc8787d3bf04748fb3435c1731cc03f30405 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Fix VThreadBase_ForgetSelf using wrong format specifier for VThread_CurID. + +commit c3eb0c034c53a80d92acbdc1cb8699c4d9a724df +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 1a27960f1761ad9f9e5bb7e5eb952f51e2fa0a60 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 901511c7de7a1d870725eeeb5f660f8728dd119d +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 8205b35f6b29c10a6e12616785f65c18b0c5204b +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 -commit c66f38194f91f8b733caa0beb6310871ac629690 -Author: John Wolfe -Date: Mon Jun 12 14:53:47 2023 -0700 + Changes to common header files not applicable to open-vm-tools. + +commit 17543c6584bdd41ff75d1ea85b4cf61c7b39f65e +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 89831b1c249ba89d683d74b3624efe77ad3f3e53 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + svtminion scripts v1.6 fixes for salt-minion release 3006.0 + + Fix output of getent group, so don't make noise on Linux. + +commit eabbaf9bca1320b45fb7ad46cf48f5fbf49e958f +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 60c3a80ddc2b400366ed05169e16a6bed6501da2 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Provide alternate method to allow (expected) pre-frozen filesystems + when taking a quiesced snapshot. + + Effective with open-vm-tools 12.2.0, Linux quiesced snapshots will fail if + any filesystem(s) have been prefrozen by other than the vmtoolsd process. + This has been done to assure that filesystems are inactive while the + snapshots are being taken. Some existing prefreeze scripts may be freezing + some filesystem(s). In these cases, the vmtoolsd process must be informed of + anticipated pre-frozen filesystems by providing an "excludedFileSystem" list in + the [vmbackup] section of the tools.conf file. + + This change provides a new switch in the tools.conf file to allow pre-frozen + filesystems to be encountered and accepted when doing a quiesced snapshot + operation. With the default value of "false", the "ignoreFrozenFileSystems" + can be configured with a setting of "true" to notify the quiesced snapshot + operation that pre-frozen filesystems are allowed. + +commit baf812a3d942e9f1a6fe9774ddc5e514b976f059 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit b3c23d050ffab46ae24d6fc8e98851a07863dd2a +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 99ee819329e6b1b51affcf15673c2020bfe4e059 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit dcc090563d12ba436c7137bb3861b2966fc372cd +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit c0116f300bfe2d37919fb333d63fd401dc228e5b +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 3f4dd03d969efe60c6c77002a3b8c8ddfd325ab3 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 6aa05e8959408d0981c18ed8dfc29513b71c98a8 +Author: Katy Feng +Date: Tue Aug 22 11:11:42 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit f6c27bbe691ba06f535d9b5d5dbabd4d4d5e3b1b +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 01d4788e191d1a846dbe7220442e25bba2cb545c +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 9d8054800e10cabeed6911a5b8ac85d612565fe6 +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 0bc0f8e68339c1bae63e9d8734d4d10c8d4b5fa9 +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 549f04fabbba57a33b8983e02064e216b8393485 +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Changes to common header files not applicable to open-vm-tools. + +commit 508933ad4fb97cde6d19544d13005c88eaa9362f +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 9f1c97526ba6414bfbc342fcf0f8a83118dbee8d +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 016fa52e6bcbf868a08b5dbac0fdb8f19ab14c9a +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Removing appUtil library from open-vm-tools. + + Several Linux distributions have deprecated the use of gdk-pixbuf-xlib library + and many may follow suit in future. Remove the appUtil library, which was + required by Unity but is no longer supported on Linux guests. + + Github Issue: https://github.com/vmware/open-vm-tools/issues/658 + +commit 55d4f25e7ad27b77268bf5f2d61e75336890dacc +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Changes to common source files not applicable to open-vm-tools. + +commit 2a770fead82a86a8b67107c40fa8e5986fd39416 +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit bea8dba7af41c6988a76bf6cbc47efd1d35761f3 +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 Remove some dead code. + +commit 3a897d916ed6e69ebcede282ee36757808ee29af +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + svtminion scripts update for salt 3006 release - Remove some authentication types which were deprecated long - ago and are no longer in use. + Scripts Ver. 1.5, support for status 106 code feature. -commit 83bb95f6b33b476069b04067f4d78bbb6ad758c3 -Author: John Wolfe -Date: Mon Jun 12 14:53:47 2023 -0700 - - Setting the VMware Tools version to 12.2.1. - -commit e5b380eee080a6a3f18644a3d784e4e538b6af41 -Author: John Wolfe -Date: Tue Mar 7 14:57:07 2023 -0800 - - ================================================= - open-vm-tools 12.2.0 released at this point. - ================================================= - Update of the ChangeLog with the final changes in preparation for - the open-vm-tools 12.2.0 release. +commit 5cf3023cf9981a97cd65f3600d03dc4714b4cc5e +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 8b940e736ed25a7e7bad47a476f6e0db154620aa +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit eb771586d88bd46fc38853b4f63cc01262a168b1 +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Introduce the new CAP_HOST_VERIFIED_SAML_TOKEN capability. + +commit 2793302b6d4bcd427a6e4b70263b4ce8069fdd00 +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 0b24b9b517c939059535aae8bfcd2ad70acaced1 +Author: Katy Feng +Date: Tue Aug 22 11:11:41 2023 -0700 + + Modify the comment for the CONFNAME_DEPLOYPKG_PROCESSTIMEOUT value range. + +commit a353e69b9438ca149a185a2249d076c951d945fe +Author: Katy Feng +Date: Thu Jun 1 10:22:47 2023 -0700 + + Copyright symbol updates. + +commit a15a0bda093255eadb3768fb845b96a185ac6af9 +Author: Katy Feng +Date: Mon Apr 24 12:46:20 2023 -0700 + + Update ChangeLog with the granular push of Apr 24, 2023. + - plus ChangeLog update of Apr 6, 2023. + +commit b4ecba012795fd6e227a36f9da43ae390f8ac121 +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit a5eb9f3ce90f3c9ac79673db7e21486fcc8b434d +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 5321737607c4779936ea7d1ca4eb7cc02f0ba452 +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 68b465af17e333d04776fc606088fc39b2a3dcdc +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Changes to common header files not applicable to open-vm-tools. + +commit 68107d0bd5e7f900c2af5946ef560fdcd5454534 +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 27ea45d66f2358c1dcc8400a600f5e4ed8a419a1 +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 8c7bbf28197c254d6859ac6727ab88355b2cb7f8 +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit c66fb5c9ec87167f82d8b72c611a2df35af514a9 +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 0fb50371215f5a6924103309980e565eebff08a6 +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common header file not applicable to open-vm-tools at this time. + +commit a480533a0a2bbeb9701f305cf3f78278e1279347 +Author: Katy Feng +Date: Mon Apr 24 12:30:14 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 87eb9ad7ed9ded840ac577cad2c027c3eaf9b49f +Author: Katy Feng +Date: Thu Apr 6 11:36:37 2023 -0700 + + Update ChangeLog with the granular push of Apr 6, 2023. + - plus ChangeLog update of Mar 24, 2023. + +commit 0c15d1214d340893719c9eaaee7a071318bd7399 +Author: Katy Feng +Date: Thu Apr 6 11:33:31 2023 -0700 + + Correct missed 2023 copyright update. + +commit 41f7e48c7570673bf84938bdf243dd78ad66c608 +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Update the AUTHORS file in open-vm-tools. + +commit 377f82a668c6c02a3fa15ad3f2da3a5b7849f39a +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Changes to common header files not applicable to open-vm-tools. + +commit d65cdcb30a38f8de7f127f9b6c8bf78e8c987b98 +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Changes to common source files not applicable to open-vm-tools. + +commit 06081ea162cb73754b9bcb6574db78cba6db5aa7 +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 215d87b455bc630f33c22f67d362a6e530fdd1db +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 0365b80e3a5c67ecedd3dcc312e425ef4b2ec9dc +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Changes to common source files not applicable to open-vm-tools. + +commit 9c861f7feade19ef863a46f5ddd59c44d98a7b83 +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Changes to common header files not applicable to open-vm-tools. + +commit 8ee7744f7716467185c2a7abda8776ea10387f5f +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 241b8eefe7090086a8fc8bab5b9504578731eaf1 +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 3a16728979d86ed78009817f1940a3ddc40b9103 +Author: Katy Feng +Date: Thu Apr 6 11:27:41 2023 -0700 + + Improve POSIX guest identification + + Many Linux distros do not provide LSB information. Instead, + they rely exclusively on the the os-release standard information. + + We previously used a ranking system that rates the LSB data + (if present) against the os-release data (if present). + With the LSB data install much more rare than before, perform + a quick check for the LSB before attempting expensive operations. + + This is in response to these GitHub issues: + + https://github.com/vmware/open-vm-tools/issues/647 + https://github.com/vmware/open-vm-tools/issues/648 + + Note that we cannot look just for the os-release data. In older + Linux releases, there are mistakes or differences between the + os-release and LSB data. We must continue to do what we do now + or risk changing the identification of older releases. + + This optimization is very effective. + +commit b9da6af8a561b911c6d59cfffb5b96cd5af3b6f7 +Author: Katy Feng +Date: Fri Mar 24 13:48:17 2023 -0700 + + Update ChangeLog with the granular push of Mar 24, 2023. + - plus ChangeLog update of Mar 6, 2023. + +commit dfe0aa7ef53ea6051d31cc69f406e746e8d0f80c +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Change to common source file not applicable to open-vm-tools. + +commit 5e28e7e7577b35c585d4c45e053a162615bdbb1b +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 2a9a730985ff05bcb808e68e4526856bb77a4c17 +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit acff74d7fa4e4f3bb70c575a287cac2762cfdaec +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Record the usage of VMware Tools version 12.2.5 in vm_tools_version.h + + Adding tools TOOLS_VERSION_BANDSAW_UPDATE1 for 12.2.5 into the + vm_tools_version.h header file. + +commit c30e8e66dcc41fd6e869c3a87d712ab29a90df8a +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Record the GA release of VMware Tools 12.2.0. + + Adding the "_RELEASE" suffix to the tools 12.2.0 tagname in vm_tools_version.h. + +commit a1a29b2358c8ca022d5116ee199c02337ec6a4a9 +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Add UNMANAGED InstallStatus value for components + + The UNMANAGED InstallStatus is returned from components operations to indicate + that the component is installed (detected) but is not to be managed by the + Component Manager. The Component Manager will not take actions (except + checkStatus) until the UNMANAGED status for the component gets resolved + (externally). + + The Salt Minion (salt_minion) component returns code 106 ("ExternalInstall") + is equivalent to UNMANAGED. + +commit 62dc9fe959f8cc6fee64a716cc1de2dee0f0d0ef +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + lib/file: Fix timetools breakage to use memset + + GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119) wrongly + complains about using the zero initializer in some circumstances. + +commit f26fad0849a5107018bbcc0b4687b460432e6d3c +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Change to common source files not applicable to open-vm-tools. + +commit ab7a609bd52b57e74946a58f9a989845128555d3 +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 12cc8ad99a9cd8faaf990d03010d511d50f88ee2 +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit 425df45b9551383ec393d44926782f3d64603d83 +Author: Katy Feng +Date: Fri Mar 24 13:29:28 2023 -0700 + + Change to common header file not applicable to open-vm-tools. + +commit e0cec2ba3f7fcf0958077d6209a58951f5a6d275 +Author: Katy Feng +Date: Mon Mar 6 10:42:40 2023 -0800 + + Update Changelog with the granular push of Mar 6, 2023. + - plus ChangeLog update of Feb 23, 2023. + +commit 813d8531e739f6a12a4e3c92f18786e10f46eacc +Author: Katy Feng +Date: Mon Mar 6 10:32:39 2023 -0800 + + Add antrea and calico interface pattern to GUESTINFO_DEFAULT_IFACE_EXCLUDES. + + Since k8s are more popular nowadays and their CNI also has IPs for pods, + we should also exclude the IP assigned by popular CNI. + + Fixes issue: https://github.com/vmware/open-vm-tools/issues/638 + + Pull request: https://github.com/vmware/open-vm-tools/pull/639 + +commit b822932f2b0ea864fdc85005e6ed7bf34c4b2a75 +Author: Katy Feng +Date: Mon Mar 6 10:32:39 2023 -0800 + + Change to common source files not applicable to open-vm-tools. + +commit 11141b784b66a941a98cb8d781125837bbcb267b +Author: Katy Feng +Date: Mon Mar 6 10:32:39 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 43cab44867c952b67255d92acfda43bb89ce7cbf +Author: Katy Feng +Date: Thu Feb 23 11:55:53 2023 -0800 + + Update Changelog with the granular push of Feb 23, 2023. + - plus ChangeLog update of Feb 3, 2023. + +commit a9e42290898d7077f73cda7fceeab046f0164388 +Author: Katy Feng +Date: Thu Feb 23 11:52:12 2023 -0800 + + Correct missed 2023 copyright update. + +commit e4d5478f95dc0e38b4e152278b30e49960784be9 +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + lib/file: Improve File_SetTimes + + There is a new system call for setting times that removes race conditions. + Use it when it is available. + +commit 2e8ac3a7963a5ba98808c2b0748773140da6be86 +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 7173a629c81bd6acf45cb07dbb169fda5ab73adf +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Change to common source file not applicable to open-vm-tools. + +commit 202c4939446da2e251ded55a9566c54d0d9f655a +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Inclusive terminology - "sanity check" + Address uses of the term "sanity check" in some files used by open-vm-tools. + +commit e530a014e677213e5660106c75eddb72d151016b +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 076aa3f0276010daaae95a95b2c3d4aea56b55bd +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Remove SSL_NewContext() declaration from sslDirect.h + +commit 8d7402b5b309275a4ef0c609966afed086d91e13 +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 7ab29ed5a2ec3b80f0d5e69a437e48e667bca8ec +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 6927da94f892ce3a9acae9cb297842c4f7852b16 +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Change to common source file not applicable to open-vm-tools. + +commit 355ea8ce3cd4b5038fb79e0a6ca10777ec4fdf79 +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 62b3b42fa69fc7a7fc8fdda9d1a8cd158244c819 +Author: Katy Feng +Date: Thu Feb 23 11:27:13 2023 -0800 + + Change to common source file not applicable to open-vm-tools. + +commit 830e9031f64d614c7bfe0acab022a9c33da9da2a +Author: Katy Feng +Date: Fri Feb 3 09:57:46 2023 -0800 + + ChangeLog update of Feb. 3, 2023. + +commit 632a516d8c4b64025ed0f7b0ee890ebb36a99a15 +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit d0346245ddb589e8d35e02650321682987c60f09 +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit b2acb8fb61dd2b3888ee58e78313ee29581c41fb +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 33b542fff5ecb78a0f1da4a005b09d11853f7026 +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common source file not applicable to open-vm-tools. + +commit 007203173890d75171db2c450bcaf37eb23c6a1d +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit e470e09b81a417e9f0c123793e3b4f0bfc1cd0cc +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit b40e6808fd6bb6483cef741cd80c3ab58f4094c8 +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 58580a5d5bd3f8a0661408031dca52ac5c70183a +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 82379efe344790ee4ab58927a194a55d6931bc3d +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Inclusive terminology - "sanity check" + + "sanity check" clean-up: + + - Rename functions: + - ./scripts/linux/network -> Renamed "sanity_check" to "confidence_check". + - ./vgauth/lib/proto.c -> Renamed "Proto_SanityCheckReply" to + "Proto_ConfidenceCheckReply". + + - Replace "sanity check" with "confidence check" in comments. + +commit 556f27f7011927d27283923b6b86dd446fd2ff17 +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Bump the VMware Tools version to 12.3.0 in the "devel" branch. + + Setting the development VMware Tools version to 12.3.0. + Adding the tag "BANDSAW" to the 12.2.0 version. + +commit 3232ed80db1af22c9906d78d12804681dc23fbfd +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit afc98393dfefae36bb26c9018b9d6e2d149688ad +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 + + Change to common header file not applicable to open-vm-tools. + +commit 486ca6223aad2474e356b0651476db53d4917a49 +Author: Katy Feng +Date: Fri Feb 3 09:41:08 2023 -0800 -commit 970d0d7d1eee353c93943704ee909523aa1ba71d -Author: John Wolfe -Date: Tue Mar 7 14:53:12 2023 -0800 - - Update the ReleaseNotes.md for the 12.2.0 open-vm-tools release. -====================================================================== -====================================================================== -commit 6b72d107c925d71e7dfe89fa9bc4dc9d848e285a -Author: John Wolfe -Date: Tue Mar 7 08:33:18 2023 -0800 - - Prepare for the open-vm-tools 12.2.0 release. - - Update the tools version in the configure.ac. Update the build numbers - buldNumber.h. + Changes to common header files not applicable to open-vm-tools. commit 3bc128aa58770d400de28f899cd867804f8aefb3 Author: Katy Feng diff -Nru open-vm-tools-12.2.5/open-vm-tools/checkvm/checkvm.c open-vm-tools-12.3.0/open-vm-tools/checkvm/checkvm.c --- open-vm-tools-12.2.5/open-vm-tools/checkvm/checkvm.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/checkvm/checkvm.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2007-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/configure.ac open-vm-tools-12.3.0/open-vm-tools/configure.ac --- open-vm-tools-12.2.5/open-vm-tools/configure.ac 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/configure.ac 2023-08-31 14:38:59.000000000 +0000 @@ -35,10 +35,10 @@ ### Initialization ### -TOOLS_VERSION="12.2.5" +TOOLS_VERSION="12.3.0" AC_INIT( [open-vm-tools], - [12.2.5], + [12.3.0], [open-vm-tools-devel@lists.sourceforge.net]) # In order to make this configure script auto-detect situations where @@ -720,7 +720,7 @@ [1.3.2], [grpc++/grpc++.h], [], - [], + [PKG_CHECK_MODULES([grpcxx], [grpc++ >= 1.3.2])], [AC_VMW_CONTAINERINFO_MSG(["grpc++ >= 1.3.2"])]) # @@ -1065,16 +1065,6 @@ have_xcomposite="yes" fi - AC_VMW_CHECK_LIB([gdk_pixbuf_xlib-2.0], - [GDK_PIXBUF_XLIB2], - [gdk-pixbuf-xlib-2.0], - [], - [2.21.0], - [gdk-pixbuf-xlib/gdk-pixbuf-xlib.h], - [gdk_pixbuf_xlib_init], - [], - [AC_MSG_ERROR([gdk-pixbuf-xlib-2.0 not found. Please configure without X11 (using --without-x) or install the gdk-pixbuf-xlib-2.0 devel package.])]) - # Check whether we have gtk+ 3.0. if test "$with_gtk3" != "no"; then # gdk_display_get_default_group (added in gtk+ 2.4.0) is function currently @@ -1839,7 +1829,6 @@ AC_CONFIG_FILES([ \ Makefile \ lib/Makefile \ - lib/appUtil/Makefile \ lib/auth/Makefile \ lib/backdoor/Makefile \ lib/asyncsocket/Makefile \ @@ -1953,6 +1942,15 @@ + + +AM_CONDITIONAL([VMTOOLS_FS_VGAUTH_HOST_VERIFICATION],[true]) +if test "$enable_vgauth" = "yes"; then + echo "Enabling vgauth host verification" + CPPFLAGS="$CPPFLAGS -DVMTOOLS_FS_VGAUTH_HOST_VERIFICATION" +fi + + ### ### Output ### diff -Nru open-vm-tools-12.2.5/open-vm-tools/hgfsclient/hgfsclient.c open-vm-tools-12.3.0/open-vm-tools/hgfsclient/hgfsclient.c --- open-vm-tools-12.2.5/open-vm-tools/hgfsclient/hgfsclient.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/hgfsclient/hgfsclient.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2019,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2019,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/appUtil/appUtil.c open-vm-tools-12.3.0/open-vm-tools/lib/appUtil/appUtil.c --- open-vm-tools-12.2.5/open-vm-tools/lib/appUtil/appUtil.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/appUtil/appUtil.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -/********************************************************* - * Copyright (C) 2008-2019 VMware, Inc. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation version 2.1 and no later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - *********************************************************/ - -/* - * appUtil.c -- - * - * Utility functions for guest applications. - */ - - -#include -#include - -#include "appUtil.h" -#include "debug.h" -#include "rpcout.h" -#include "str.h" - - -/* - *---------------------------------------------------------------------------- - * - * AppUtil_SendGuestCaps -- - * - * Send a list of guest capabilities to the host. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -void -AppUtil_SendGuestCaps(const GuestCapabilities *caps, // IN: array of capabilities - size_t numCaps, // IN: number of capabilities - Bool enabled) // IN: capabilities status -{ - char *capsStr; - size_t capIdx; - - ASSERT(caps); - ASSERT(numCaps > 0); - - capsStr = strdup(GUEST_CAP_FEATURES); - for (capIdx = 0; capIdx < numCaps; capIdx++) { - char *capsTemp; - if (!capsStr) { - Debug("%s: Not enough memory to create capabilities string\n", __FUNCTION__); - return; - } - capsTemp = Str_Asprintf(NULL, - "%s %d=%d", - capsStr, - caps[capIdx], - (int)enabled); - free(capsStr); - capsStr = capsTemp; - } - - if (!RpcOut_sendOne(NULL, NULL, capsStr)) { - Debug("%s: could not set capabilities: older vmx?\n", __FUNCTION__); - } - - free(capsStr); -} diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/appUtil/appUtilX11.c open-vm-tools-12.3.0/open-vm-tools/lib/appUtil/appUtilX11.c --- open-vm-tools-12.2.5/open-vm-tools/lib/appUtil/appUtilX11.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/appUtil/appUtilX11.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,838 +0,0 @@ -/********************************************************* - * Copyright (C) 2008-2019,2022 VMware, Inc. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation version 2.1 and no later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - *********************************************************/ - -/* - * appUtilX11.c -- - * - * Utility functions to retrieve application icons. - */ - -#define _GNU_SOURCE 1 -#include -#include -#include - -#include "vmware.h" -#include "str.h" -#include "posix.h" -#include "debug.h" - -#include -#include -#include -#include -#include -#include -#include - -#if GTK_MAJOR_VERSION < 2 -#error "Gtk 2.0 or 3.0 is required" -#endif - - -/* - *----------------------------------------------------------------------------- - * - * AppUtilIconThemeReallyHasIcon -- - * - * Utility function to detect whether an icon is really available. This is necessary - * because sometimes gtk_icon_theme_has_icon() lies to us... - * - * Results: - * TRUE if the icon theme really has a usable icon, FALSE otherwise. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static Bool -AppUtilIconThemeReallyHasIcon(GtkIconTheme *iconTheme, // IN - const char *iconName) // IN -{ - gint *iconSizes; - Bool retval; - - if (!gtk_icon_theme_has_icon(iconTheme, iconName)) { - return FALSE; - } - - iconSizes = gtk_icon_theme_get_icon_sizes(iconTheme, iconName); - retval = iconSizes && iconSizes[0]; - g_free(iconSizes); - - return retval; -} - - -/* - *----------------------------------------------------------------------------- - * - * AppUtilCollectNamedIcons -- - * - * Tries to find icons with a particular name (which may be a full filesystem path, - * a filename with extension, or just an abstract app name). - * - * Results: - * None. - * - * Side effects: - * May add icons into 'pixbufs' - * - *----------------------------------------------------------------------------- - */ - -static void -AppUtilCollectNamedIcons(GPtrArray *pixbufs, // IN/OUT - const char *iconName) // IN -{ - char *myIconName = NULL; - char *baseIconName; - /* - * Use the GtkIconTheme to track down any available icons for this app. - */ - GtkIconTheme *iconTheme = NULL; - char *ctmp2; - Bool foundItInTheme = FALSE; // Did we find this icon in the GtkIconTheme? - Bool foundItInFile = FALSE; // Did we find this icon directly in a file? - static const char *extraIconPaths[] = { - "/usr/share/icons", - "/usr/share/pixmaps", - "/usr/local/share/pixmaps", - "/usr/local/share/icons", - "/opt/kde3/share/icons", - "/opt/kde3/share/pixmaps", - "/opt/kde4/share/icons", - "/opt/kde4/share/pixmaps", - "/opt/gnome/share/icons", - "/opt/gnome/share/pixmaps" - }; - int iconNameLen; - - ASSERT(iconName); - - Debug("Collecting icons named %s\n", iconName); - - iconNameLen = strlen(iconName) + 1; - baseIconName = g_alloca(iconNameLen); // We need to modify the name sometimes - Str_Strcpy(baseIconName, iconName, iconNameLen); - - ctmp2 = strrchr(baseIconName, '.'); - if (*baseIconName != '/' && ctmp2 && strlen(ctmp2) <= 5) { - /* - * If it's a plain filename that we could possibly feed into GtkIconTheme as an - * icon ID, trim the file extension to turn it into an icon ID string and make - * GtkIconTheme happy. - */ - *ctmp2 = '\0'; - } - - iconTheme = gtk_icon_theme_get_default(); - g_object_ref(G_OBJECT(iconTheme)); - foundItInTheme = AppUtilIconThemeReallyHasIcon(iconTheme, baseIconName); - - if (!foundItInTheme) { - /* - * Try looking for it as a non-GtkIconTheme managed file, to deal with older - * systems. - */ - if (iconName[0] != '/') { - gchar *iconSearchName; - gsize iconSearchNameSize; - gboolean triedOtherExts = FALSE; - - char *ctmp2; - int i; - - static const char *iconExtensions[] = { - "", // MUST be first entry. - ".png", - ".xpm", - ".gif", - ".svg", - }; - - /* - * Make a local copy of iconName in case we need to search for icons with - * alternate extensions. - */ - iconSearchNameSize = strlen(iconName) + 1; - iconSearchName = g_alloca(iconSearchNameSize); - - /* Ignore return, returns length of the source string */ - /* coverity[check_return] */ - g_strlcpy(iconSearchName, iconName, iconSearchNameSize); - - myIconName = NULL; - - ctmp2 = g_alloca(PATH_MAX); -tryingOtherExts: - for (i = 0; !myIconName && i < ARRAYSIZE(extraIconPaths); i++) { - int j; - - if (!extraIconPaths[i]) { - continue; - } - - /* - * Per Desktop Entry Specification and Icon Theme Specification, I don't - * believe that the iconName, unless it's an absolute path, should include - * the file extension. - * - * However, empirical evidence shows that -many- applications ignore that - * and may specify an icon of, for example, "foo.png". We'll also handle - * those special cases here. - */ - for (j = 0; !myIconName && j < ARRAYSIZE(iconExtensions); j++) { - g_snprintf(ctmp2, PATH_MAX, "%s/%s%s", extraIconPaths[i], iconSearchName, - iconExtensions[j]); - if (!g_file_test(ctmp2, G_FILE_TEST_EXISTS)) { - continue; - } - - if (j != 0) { - /* - * Case 1: We located an icon by appending an image extension to - * IconName. Success! - */ - myIconName = ctmp2; // Will break "i" loop. - foundItInFile = TRUE; - break; - } else { - /* - * Case 2: We found an icon without appending an extension. Verify - * that the filename contains a valid image extension. - */ - int k; - char *ctmpext = strrchr(ctmp2, '.'); - for (k = 1; ctmpext && k < ARRAYSIZE(iconExtensions); k++) { - if (strcmp(ctmpext, iconExtensions[k]) == 0) { - myIconName = ctmp2; // Will break "i" loop. - foundItInFile = TRUE; - break; - } - } - } - } - } - - /* - * No dice. But we won't give up hope just yet! In some cases, icon-foo.png - * may not exist while icon-foo.xpm does. (Ex: Ubuntu 8.04's hwtest.) We'll - * try once more by searching for an icon with an alternate extension. - */ - if (!foundItInFile && !triedOtherExts) { - int extIndex; - - triedOtherExts = TRUE; - - /* - * Look to see if iconSearchName contains any of the known extensions - * listed above. If so, chop it off, then reattempt the search. - */ - for (extIndex = 1; extIndex < ARRAYSIZE(iconExtensions); extIndex++) { - if (g_str_has_suffix(iconSearchName, iconExtensions[extIndex])) { - gchar *extension; - extension = g_strrstr(iconSearchName, iconExtensions[extIndex]); - *extension = '\0'; - goto tryingOtherExts; - } - } - } - } else { - myIconName = g_alloca(iconNameLen + 1); - Str_Strcpy(myIconName, iconName, iconNameLen); - foundItInFile = TRUE; - } - } - - if (!foundItInTheme && !foundItInFile) { - /* - * Try looking through some auxiliary icon themes. - */ - int i; - static const char *extraThemes[] = { - /* - * Some other icon themes to try. - */ - "hicolor", - "Bluecurve", - "HighContrast-SVG", - "HighContrastLargePrint", - "crystalsvg", - "slick", - NULL - }; - g_object_unref(G_OBJECT(iconTheme)); - iconTheme = gtk_icon_theme_new(); - for (i = 0; i < ARRAYSIZE(extraIconPaths); i++) { - if (extraIconPaths[i]) { - if (g_file_test(extraIconPaths[i], G_FILE_TEST_EXISTS)) { - gtk_icon_theme_append_search_path(iconTheme, extraIconPaths[i]); - } else { - extraIconPaths[i] = NULL; - } - } - } - - for (i = 0; extraThemes[i]; i++) { - gtk_icon_theme_set_custom_theme(iconTheme, extraThemes[i]); - foundItInTheme = AppUtilIconThemeReallyHasIcon(iconTheme, baseIconName); - if (foundItInTheme) { - break; - } - } - } - - if (foundItInTheme) { - /* - * If we know this icon can be loaded via GtkIconTheme, do so. - */ - gint *iconSizes; - int i; - Bool needToUseScalable; - - iconSizes = gtk_icon_theme_get_icon_sizes(iconTheme, baseIconName); - Debug("Loading icon %s from iconTheme\n", baseIconName); - - ASSERT(iconSizes); - needToUseScalable = (iconSizes[0] == -1 && iconSizes[1] == 0); - - /* - * Before we try to actually dump the icons out to the host, count how many we - * actually can load. - */ - for (i = 0; iconSizes[i]; i++) { - GdkPixbuf *pixbuf; - GtkIconInfo *iconInfo; - gint thisSize; - - thisSize = iconSizes[i]; - if (thisSize == -1 && !needToUseScalable) { - continue; // Skip scalable icons if we have prerendered versions - } - - if (thisSize == -1) { - thisSize = 64; // Render SVG icons to 64x64 - } - - iconInfo = gtk_icon_theme_lookup_icon(iconTheme, baseIconName, thisSize, 0); - - if (!iconInfo) { - Debug("Couldn't find %s icon for size %d\n", baseIconName, thisSize); - continue; - } - - pixbuf = gtk_icon_info_load_icon(iconInfo, NULL); - - if (!pixbuf) { -#if GTK_MAJOR_VERSION == 3 -G_GNUC_BEGIN_IGNORE_DEPRECATIONS -#endif - pixbuf = gtk_icon_info_get_builtin_pixbuf(iconInfo); -#if GTK_MAJOR_VERSION == 3 -G_GNUC_END_IGNORE_DEPRECATIONS -#endif - } - - if (pixbuf) { - g_ptr_array_add(pixbufs, pixbuf); - } else { - Debug("WARNING: Not even a built-in pixbuf for icon %s\n", baseIconName); - } -#if GTK_MAJOR_VERSION == 3 - if (iconInfo) { - g_object_unref(iconInfo); - } -#else - gtk_icon_info_free(iconInfo); -#endif - } - - g_free(iconSizes); - - } else if (foundItInFile && myIconName && myIconName[0] == '/') { - GdkPixbuf *pixbuf; - Debug("Loading icon %s from file\n", myIconName); - pixbuf = gdk_pixbuf_new_from_file(myIconName, NULL); - if (pixbuf) { - g_ptr_array_add(pixbufs, pixbuf); - } - } - - if (iconTheme) { - g_object_unref(G_OBJECT(iconTheme)); - } -} - - -/* - *----------------------------------------------------------------------------- - * - * AppUtilComparePixbufSizes -- - * - * Compares two GdkPixbufs to sort them by image dimensions - * - * Results: - * -1 if A is larger than B, 0 if equal, 1 if A is smaller than B - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static gint -AppUtilComparePixbufSizes(gconstpointer a, // IN - gconstpointer b) // IN -{ - GdkPixbuf *pba; - GdkPixbuf *pbb; - int asize; - int bsize; - - if (a && !b) { - return -1; - } else if (!a && b) { - return 1; - } else if (!a && !b) { - return 0; - } - - pba = GDK_PIXBUF(*(gconstpointer *)a); - asize = gdk_pixbuf_get_width(pba) * gdk_pixbuf_get_height(pba); - - pbb = GDK_PIXBUF(*(gconstpointer *)b); - bsize = gdk_pixbuf_get_width(pbb) * gdk_pixbuf_get_height(pbb); - - if (asize > bsize) { - return -1; - } else if (asize < bsize) { - return 1; - } - - return 0; -} - - -/* - *----------------------------------------------------------------------------- - * - * AppUtil_CollectIconArray -- - * - * Given a variety of information about an application (its icon name, X window ID, - * etc.), return an array of GdkPixbufs that represent the icons for that - * application. - * - * Results: - * GPtrArray of GdkPixbufs, or NULL on failure. The returned array may have zero - * elements. The array will be sorted by icon size, largest to smallest. - * - * Side effects: - * Caller becomes owner of the array and pixbufs that are allocated during this - * function. - * - *----------------------------------------------------------------------------- - */ - -GPtrArray * -AppUtil_CollectIconArray(const char *iconName, // IN - unsigned long windowID) // IN -{ - GPtrArray *pixbufs; - - pixbufs = g_ptr_array_new(); - - if (iconName) { - AppUtilCollectNamedIcons(pixbufs, iconName); - } - - if (!pixbufs->len && windowID != None) { - /* - * Try loading the icon from the X Window's _NET_WM_ICON/WM_HINTS property. - */ - Display *dpy; - XWMHints *wmh; - Atom actualType = None; - int actualFormat; - unsigned long nitems = 0; - unsigned long bytesLeft; - XID *value; - XTextProperty wmIconName; - - dpy = gdk_x11_get_default_xdisplay(); - XGetWindowProperty(dpy, windowID, XInternAtom(dpy, "_NET_WM_ICON", FALSE), - 0, LONG_MAX, False, XA_CARDINAL, - &actualType, &actualFormat, &nitems, - &bytesLeft, (unsigned char **)&value); - - if (nitems) { - /* - * _NET_WM_ICON: Transform ARGB data into pixbufs... - */ - int i; - - for (i = 0; i < nitems; ) { - GdkPixbuf *pixbuf; - int width; - int height; - - ASSERT((nitems - i) >= 2); - width = value[i]; - height = value[i + 1]; - i += 2; - pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); - if (pixbuf) { - int x; - int y; - int rowstride = gdk_pixbuf_get_rowstride(pixbuf); - guchar *pixels = gdk_pixbuf_get_pixels(pixbuf); - - for (y = 0; y < height; y++) { - for (x = 0; x < width && i < nitems; x++, i++) { - guchar *pixel = &pixels[y * rowstride + x * 4]; - XID currentValue = value[i]; - - /* - * Input data: BGRA data (high byte is A, low byte is B - - * freedesktop calls this ARGB, but that's not correct). - * - * Output data: RGBA data. - */ - *pixel = (currentValue >> 16) & 0xFF; - *(pixel + 1) = (currentValue >> 8) & 0xFF; - *(pixel + 2) = currentValue & 0xFF; - *(pixel + 3) = (currentValue >> 24) & 0xFF; - } - } - - g_ptr_array_add(pixbufs, pixbuf); - } else { - Debug("gdk_pixbuf_new failed when decoding _NET_WM_ICON\n"); - break; - } - } - XFree(value); - } - nitems = 0; - if (!pixbufs->len && - XGetWindowProperty(dpy, windowID, XInternAtom(dpy, "_NET_WM_ICON_NAME", FALSE), - 0, LONG_MAX, False, XInternAtom(dpy, "UTF8_STRING", FALSE), - &actualType, &actualFormat, &nitems, - &bytesLeft, (unsigned char **)&value) == Success - && nitems) { - /* - * _NET_WM_ICON_NAME - */ - AppUtilCollectNamedIcons(pixbufs, (char *)value); - XFree(value); - } - - if (!pixbufs->len && XGetWMIconName(dpy, windowID, &wmIconName)) { - /* - * WM_ICON_NAME - */ - AppUtilCollectNamedIcons(pixbufs, wmIconName.value); - XFree(wmIconName.value); - } - - if (!pixbufs->len && (wmh = XGetWMHints(dpy, windowID))) { - /* - * WM_HINTS - */ - if (wmh->flags & IconPixmapHint) { - Window dummyWin; - int x; - int y; - unsigned int width; - unsigned int height; - unsigned int border; - unsigned int depth; - GdkPixbuf *pixbuf = NULL; - - if (XGetGeometry(dpy, wmh->icon_pixmap, &dummyWin, - &x, &y, &width, &height, &border, &depth)) { - - pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); - - if (!gdk_pixbuf_xlib_get_from_drawable (pixbuf, wmh->icon_pixmap, - DefaultColormap(dpy, 0), - DefaultVisual(dpy, 0), - 0, 0, 0, 0, width, height)) { - g_object_unref(G_OBJECT(pixbuf)); - pixbuf = NULL; - } - - if (pixbuf && (wmh->flags & IconMaskHint)) { - /* - * Apply the X bitmap mask. - */ - GdkPixbuf *pixbuf_mask; - - pixbuf_mask = - gdk_pixbuf_xlib_get_from_drawable(pixbuf, - wmh->icon_mask, - DefaultColormap(dpy, 0), - DefaultVisual(dpy, 0), - 0, 0, 0, 0, - width, height); - if (pixbuf_mask) { - int x; - int y; - int rowstride; - int rowstride_mask; - guchar *pixels; - guchar *pixels_mask; - int depth_mask; - int n_channels_mask; - - pixels = gdk_pixbuf_get_pixels(pixbuf); - pixels_mask = gdk_pixbuf_get_pixels(pixbuf_mask); - rowstride = gdk_pixbuf_get_rowstride(pixbuf); - rowstride_mask = gdk_pixbuf_get_rowstride(pixbuf_mask); - depth_mask = gdk_pixbuf_get_bits_per_sample(pixbuf_mask); - ASSERT(gdk_pixbuf_get_bits_per_sample(pixbuf) == 8); - n_channels_mask = gdk_pixbuf_get_n_channels(pixbuf_mask); - - for (y = 0; y < height; y++) { - guchar *thisrow_mask = pixels_mask + y * rowstride_mask; - guchar *thisrow = pixels + y * rowstride; - for (x = 0; x < width; x++) { - guchar newAlpha = 0xFF; - switch(depth_mask) { - case 1: - newAlpha = thisrow_mask[x * n_channels_mask / 8]; - newAlpha >>= (x % 8); - newAlpha = newAlpha ? 0xFF : 0; - break; - case 8: - /* - * For some reason, gdk-pixbuf-xlib turns a monochrome - * bitmap into 0/1 values in the blue channel of an RGBA - * pixmap. - */ - newAlpha = (thisrow_mask[x * n_channels_mask + 2]) - ? 0xFF : 0; - break; - default: - NOT_REACHED(); - break; - } - - thisrow[x * 4 + 3] = newAlpha; - } - } - } - } - - if (pixbuf) { - g_ptr_array_add(pixbufs, pixbuf); - } - } - } - - XFree(wmh); - } - - if (!pixbufs->len) { - /* - * Last resort - try using the WM_CLASS as an icon name - */ - - XClassHint hints; - - if (XGetClassHint(dpy, windowID, &hints)) { - if (hints.res_name) { - AppUtilCollectNamedIcons(pixbufs, hints.res_name); - } - - XFree(hints.res_name); - XFree(hints.res_class); - } - } - } - - /* - * In order to make it easy for AppUtil users to pick the icon they want, we sort them - * largest-to-smallest. - */ - g_ptr_array_sort(pixbufs, AppUtilComparePixbufSizes); - - if (!pixbufs->len) { - Debug("WARNING: No icons found for %s / %#lx\n", iconName, windowID); - } - - return pixbufs; -} - - -/* - *----------------------------------------------------------------------------- - * - * AppUtil_FreeIconArray -- - * - * Frees the result of AppUtil_CollectIconArray - * - * Results: - * None. - * - * Side effects: - * Array and its contents are destroyed - * - *----------------------------------------------------------------------------- - */ - -void -AppUtil_FreeIconArray(GPtrArray *pixbufs) // IN -{ - int i; - - if (!pixbufs) { - return; - } - - for (i = 0; i < pixbufs->len; i++) { - g_object_unref(G_OBJECT(g_ptr_array_index(pixbufs, i))); - } - - g_ptr_array_free(pixbufs, TRUE); -} -/* - *----------------------------------------------------------------------------- - * - * AppUtil_AppIsSkippable -- - * - * Can an executable be ignored for the purposes of determining the path to run an - * app with? Usually true for interpreters and the like, for which the script path - * should be used instead. - * - * Results: - * TRUE if the app should be ignored, FALSE otherwise. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -Bool -AppUtil_AppIsSkippable(const char *appName) -{ - static const char *skipAppsList[] = { - "python", - "python2.5", - "python2.4", - "python2.3", - "python2.2", - "perl", - "sh", - "bash", - }; - char cbuf[PATH_MAX]; - int i; - char *ctmp; - - Str_Strcpy(cbuf, appName, sizeof cbuf); - ctmp = basename(cbuf); - - for (i = 0; i < ARRAYSIZE(skipAppsList); i++) { - if (!strcmp(ctmp, skipAppsList[i])) { - return TRUE; - } - } - - return FALSE; -} - - -/* - *----------------------------------------------------------------------------- - * - * AppUtil_CanonicalizeAppName -- - * - * Turns the app name (or path) into a full path for the executable. - * - * Results: - * Path, or NULL if not available - * - * Side effects: - * Allocated memory is returned - * - *----------------------------------------------------------------------------- - */ - -char * -AppUtil_CanonicalizeAppName(const char *appName, // IN - const char *cwd) // IN -{ - char *ctmp; - ASSERT(appName); - - if (appName[0] == '/') { - ctmp = g_strdup(appName); - goto exit; - } - - ctmp = g_find_program_in_path(appName); - if (ctmp) { - goto exit; - } - - /* - * It's probably safe to assume that cwd is an absolute path (at the time of - * writing, it is derived from /proc), but let's check to be sure. - */ - if (cwd && cwd[0] == '/') { - - /* Don't add any unnecessary path separators. */ - char *cbuf = Str_Asprintf(NULL, "%s%s%s", cwd, - cwd[strlen(cwd) - 1] == '/' ? "" : "/", - appName); - if (cbuf) { - ctmp = Posix_RealPath(cbuf); - free(cbuf); - } - } - - exit: - return ctmp; -} - - -/* - *----------------------------------------------------------------------------- - * - * AppUtil_Init -- - * - * Initializes the AppUtil library for subsequent use. - * - * Results: - * None. - * - * Side effects: - * Internal state is initialized. Currently this is just gdk-pixbuf-xlib. - * - *----------------------------------------------------------------------------- - */ - -void -AppUtil_Init(void) -{ - gdk_pixbuf_xlib_init(gdk_x11_get_default_xdisplay(), 0); -} diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/appUtil/Makefile.am open-vm-tools-12.3.0/open-vm-tools/lib/appUtil/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/lib/appUtil/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/appUtil/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -################################################################################ -### Copyright (C) 2008-2016,2020 VMware, Inc. All rights reserved. -### -### This program is free software; you can redistribute it and/or modify -### it under the terms of version 2 of the GNU General Public License as -### published by the Free Software Foundation. -### -### This program is distributed in the hope that it will be useful, -### but WITHOUT ANY WARRANTY; without even the implied warranty of -### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -### GNU General Public License for more details. -### -### You should have received a copy of the GNU General Public License -### along with this program; if not, write to the Free Software -### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -################################################################################ - -noinst_LTLIBRARIES = libAppUtil.la - -libAppUtil_la_SOURCES = -libAppUtil_la_SOURCES += appUtil.c -libAppUtil_la_SOURCES += appUtilX11.c - -AM_CFLAGS = -AM_CFLAGS += @GTK_CPPFLAGS@ -AM_CFLAGS += @GDK_PIXBUF_XLIB2_CPPFLAGS@ - diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/asyncsocket/asyncsocket.c open-vm-tools-12.3.0/open-vm-tools/lib/asyncsocket/asyncsocket.c --- open-vm-tools-12.2.5/open-vm-tools/lib/asyncsocket/asyncsocket.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/asyncsocket/asyncsocket.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2003-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -6159,7 +6159,7 @@ ASSERT(asock); if (sslContext == NULL) { - sslContext = SSL_DefaultContext(); + sslContext = SSL_DefaultClientContext(); } return SSL_ConnectAndVerifyWithContext(asock->sslSock, verifyParam, @@ -6772,8 +6772,6 @@ addr.sun_family = AF_UNIX; Str_Strcpy(addr.sun_path, pipeName, sizeof addr.sun_path); - Log(ASOCKPREFIX "creating new socket listening on %s\n", pipeName); - asock = AsyncTCPSocketListenImpl((struct sockaddr_storage *)&addr, sizeof addr, connectFn, clientData, pollParams, &tempError); diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/asyncsocket/asyncSocketVTable.h open-vm-tools-12.3.0/open-vm-tools/lib/asyncsocket/asyncSocketVTable.h --- open-vm-tools-12.2.5/open-vm-tools/lib/asyncsocket/asyncSocketVTable.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/asyncsocket/asyncSocketVTable.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011,2014-2017,2019-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2011,2014-2017,2019-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/dataMap/dataMap.c open-vm-tools-12.3.0/open-vm-tools/lib/dataMap/dataMap.c --- open-vm-tools-12.2.5/open-vm-tools/lib/dataMap/dataMap.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/dataMap/dataMap.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2012-2017,2019 VMware, Inc. All rights reserved. + * Copyright (c) 2012-2017,2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -1403,7 +1403,7 @@ ASSERT(0); /* we do not expect this to happen */ } - /* Update left buffer size so we can do a sanity check at the end */ + /* Update left buffer size so we can do a confidence check at the end. */ clientData->buffLen -= (clientData->buffer - buffPtrOrig); } @@ -1812,7 +1812,7 @@ HashMap_Iterate(that->map, HashMapSerializeEntryCb, FALSE, &clientData); - /* sanity check, make sure the buffer size is just used up*/ + /* confidence check, make sure the buffer size is just used up. */ ASSERT(clientData.buffLen == 0); if (clientData.result != DMERR_SUCCESS) { @@ -2494,7 +2494,7 @@ ToBufferString(&clientData, "--> End.\n"); - /* sanity check, make sure the buffer is not overflown. */ + /* confidence check, make sure the buffer is not overflown. */ ASSERT(clientData.buffLen >= 0); ASSERT(buffPtr + maxBuffSize >= clientData.buffer); diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/file/fileLockPrimitive.c open-vm-tools-12.3.0/open-vm-tools/lib/file/fileLockPrimitive.c --- open-vm-tools-12.2.5/open-vm-tools/lib/file/fileLockPrimitive.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/file/fileLockPrimitive.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2007-2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -753,8 +753,10 @@ /* Pass 2: Handle the 'M' entries */ for (i = 0, err = 0; i < numEntries; i++) { LockValues *ptr; - Bool myLockFile; + Bool myLockFile; LockValues memberValues; + char buffer[FILELOCK_DATA_SIZE]; // Must be near memberValues, + // as it will be pointed by it if ((fileList[i] == NULL) || (*fileList[i] == 'E')) { continue; @@ -767,7 +769,6 @@ /* It's me! No need to read or validate anything. */ ptr = myValues; } else { - char buffer[FILELOCK_DATA_SIZE]; /* It's not me! Attempt to extract the member values. */ err = FileLockMemberValues(lockDir, fileList[i], buffer, FILELOCK_DATA_SIZE, &memberValues); diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/file/filePosix.c open-vm-tools-12.3.0/open-vm-tools/lib/file/filePosix.c --- open-vm-tools-12.2.5/open-vm-tools/lib/file/filePosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/file/filePosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2021, 2023 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -44,15 +44,17 @@ #endif #include #include +#include +#if !defined(__USE_ATFILE) +#define __USE_ATFILE +#endif +#include /* Definition of AT_* constants */ #include #include -#include -#include #include #if defined(__linux__) # include #endif - #if defined(__APPLE__) #include #endif @@ -71,9 +73,12 @@ #include "hostType.h" #include "vmfs.h" #include "hashTable.h" +#include "hostinfo.h" +#include "log.h" #ifdef VMX86_SERVER #include "fs_public.h" +#include "fs3Layout.h" #endif #define LOGLEVEL_MODULE main @@ -837,13 +842,14 @@ /* *---------------------------------------------------------------------- * - * File_SetTimes -- + * FileSetTimes -- * - * Set the date and time that a file was created, last accessed, or - * last modified. + * Set the date and time that a file was last accessed or last + * modified. * * Results: - * TRUE if succeed or FALSE if error. + * TRUE Success + * FALSE Failure * * Side effects: * If fileName is a symlink, target's timestamps will be updated. @@ -852,37 +858,40 @@ *---------------------------------------------------------------------- */ -Bool -File_SetTimes(const char *pathName, // IN: - VmTimeType createTime, // IN: ignored - VmTimeType accessTime, // IN: Windows NT time format - VmTimeType writeTime, // IN: Windows NT time format - VmTimeType attrChangeTime) // IN: ignored +static Bool +FileSetTimes(const char *path, // IN: + VmTimeType accessTime, // IN: Windows NT time format + VmTimeType writeTime) // IN: Windows NT time format +#if defined(UTIME_NOW) && defined(UTIME_OMIT) { - struct timeval times[2]; - struct timeval *aTime, *wTime; - struct stat statBuf; - char *path; - int err; + struct timespec times[2]; - if (pathName == NULL) { - return FALSE; + if (accessTime > 0) { + TimeUtil_NtTimeToUnixTime(×[0], accessTime); + } else { + times[0].tv_sec = 0; + times[0].tv_nsec = UTIME_OMIT; } - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - if (path == NULL) { - Log(LGPFX" %s: failed to convert \"%s\" to current encoding\n", - __FUNCTION__, pathName); - - return FALSE; + if (writeTime > 0) { + TimeUtil_NtTimeToUnixTime(×[1], writeTime); + } else { + times[1].tv_sec = 0; + times[1].tv_nsec = UTIME_OMIT; } - err = (lstat(path, &statBuf) == -1) ? errno : 0; + return utimensat(0, path, times, 0) == 0 ? TRUE : FALSE; +} +#else +{ + struct stat statBuf; + struct timeval times[2]; + struct timeval *aTime, *wTime; + int err = (lstat(path, &statBuf) == -1) ? errno : 0; if (err != 0) { Log(LGPFX" %s: error stating file \"%s\": %s\n", __FUNCTION__, - pathName, Err_Errno2String(err)); - Posix_Free(path); + path, Err_Errno2String(err)); return FALSE; } @@ -904,6 +913,7 @@ struct timespec ts; TimeUtil_NtTimeToUnixTime(&ts, accessTime); + aTime->tv_sec = ts.tv_sec; aTime->tv_usec = ts.tv_nsec / 1000; } @@ -912,23 +922,87 @@ struct timespec ts; TimeUtil_NtTimeToUnixTime(&ts, writeTime); + wTime->tv_sec = ts.tv_sec; wTime->tv_usec = ts.tv_nsec / 1000; } err = (utimes(path, times) == -1) ? errno : 0; - Posix_Free(path); - if (err != 0) { Log(LGPFX" %s: utimes error on file \"%s\": %s\n", __FUNCTION__, - pathName, Err_Errno2String(err)); + path, Err_Errno2String(err)); return FALSE; } return TRUE; } +#endif + + +/* + *---------------------------------------------------------------------- + * + * File_SetTimes -- + * + * Set the date and time that a file was last accessed or last + * modified. + * + * Results: + * TRUE Success + * FALSE Failure + * + * Side effects: + * If fileName is a symlink, target's timestamps will be updated. + * Symlink itself's timestamps will not be changed. + * + *---------------------------------------------------------------------- + */ + +Bool +File_SetTimes(const char *pathName, // IN: + VmTimeType createTime, // IN: ignored + VmTimeType accessTime, // IN: Windows NT time format + VmTimeType writeTime, // IN: Windows NT time format + VmTimeType attrChangeTime) // IN: ignored +{ + char *path; + Bool success; + char *fullPath; + + if (pathName == NULL) { + errno = EINVAL; // Invalid parameter + return FALSE; + } + + if ((accessTime == 0) && (writeTime == 0)) { + return TRUE; + } + + fullPath = File_FullPath(pathName); + + if (fullPath == NULL) { + return FALSE; + } + + path = Unicode_GetAllocBytes(fullPath, STRING_ENCODING_DEFAULT); + + Posix_Free(fullPath); + + if (path == NULL) { + Log(LGPFX" %s: failed to convert \"%s\" to current encoding\n", + __FUNCTION__, pathName); + + return FALSE; + } + + success = FileSetTimes(path, accessTime, writeTime); + + Posix_Free(path); + + return success; +} /* @@ -1455,7 +1529,133 @@ return ret; } -#endif + + +/* + *---------------------------------------------------------------------- + * + * File_GetVMFSLockInfo -- + * + * Get lock information about a file that has probably caused a + * locking conflict. + * + * If the file is locked by a process local to the current host, + * FS open flags, world ID, and world name will be returned (or + * 0/NULL if not). + * + * If the file is on VMFS, the owner MAC address and lock mode of + * the on-disk lock will be provided (or 0/NULL if not). + * + * (It's possible for a file to be on a non-VMFS shared datastore + * like NFS/VVol/VSAN and be locked by another host. In that + * case, this function might not return any information.) + * + * Results: + * 0 on success (and see above), -1 otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +File_GetVMFSLockInfo(const char *path, // IN + uint32 *outOpenFlags, // OUT: + uint32 *outWorldID, // OUT: + char **outWorldName, // OUT: + char **outVMFSMacAddr, // OUT: + uint32 *outVMFSLockMode) // OUT: +{ + int ret = -1; + int ioctlRet; + int fd = -1; + FS_GetFileLockInfoArgs lockArgs; + FS_DumpFDData dumpArgs; + char *dir = NULL; + char *fileName = NULL; + + *outOpenFlags = 0; + *outWorldID = INVALID_WORLD_ID; + *outWorldName = NULL; + *outVMFSMacAddr = NULL; + *outVMFSLockMode = 0; + + memset(&lockArgs, 0, sizeof lockArgs); + memset(&dumpArgs, 0, sizeof dumpArgs); + File_SplitName(path, NULL, &dir, &fileName); + + fd = Posix_Open(dir, O_RDONLY, 0); + if (fd == -1) { + Log(LGPFX" %s: could not open directory \"%s\": %s\n", __FUNCTION__, dir, + Err_Errno2String(errno)); + goto exit; + } + + Str_Strncpy(lockArgs.fileName, sizeof lockArgs.fileName, fileName, + strlen(fileName)); + ioctlRet = ioctl(fd, IOCTLCMD_GETFILELOCKINFO, (char *)&lockArgs); + /* If this fails, it might be open only on another machine. */ + if (ioctlRet != -1) { + *outOpenFlags = lockArgs.openFlags; + *outWorldID = lockArgs.worldID; + *outWorldName = Util_SafeStrdup(lockArgs.worldName); + } + + Str_Strncpy(dumpArgs.args.fileName, sizeof dumpArgs.args.fileName, + fileName, strlen(fileName)); + ioctlRet = ioctl(fd, IOCTLCMD_VMFS_DUMP_METADATA, (char *)&dumpArgs); + /* If this fails, it probably isn't on VMFS. */ + if (ioctlRet != -1) { + FS3_FileDescriptor *fileDesc = + (FS3_FileDescriptor *)&dumpArgs.result.descriptor; + FS3_DiskLock *diskLock = FS3_DISKLOCK(&fileDesc->lockBlock); + if (dumpArgs.result.descriptorLength < sizeof(FS3_FileDescriptor)) { + /* This should not happen. */ + Log(LGPFX" %s: VMFS file descriptor size %u too small (need " + "%"FMTSZ"u) for file \"%s\"\n", __FUNCTION__, + dumpArgs.result.descriptorLength, sizeof(FS3_FileDescriptor), + path); + goto exit; + } + + *outVMFSLockMode = diskLock->mode; + + if (diskLock->mode != FS3_LC_FREE && + diskLock->mode != FS3_LC_EXCLUSIVE) { + /* + * This is a non-exclusive lock. Thus it can have multiple holders. + * For now, return only the first. + */ + if (diskLock->numHolders > FS3_MAX_LOCK_HOLDERS) { + Log(LGPFX" %s: Corrupt VMFS disk lock found for file \"%s\", " + "invalid number of holders %u.\n", __FUNCTION__, path, + diskLock->numHolders); + goto exit; + } + + *outVMFSMacAddr = Str_SafeAsprintf(NULL, FS_UUID_FMTSTR, + FS_UUID_VAARGS(diskLock->numHolders == 0 ? + &diskLock->owner : &diskLock->holders[0].uid)); + } else { + /* Exclusive lock, so there is only one owner. */ + *outVMFSMacAddr = Str_SafeAsprintf(NULL, FS_UUID_FMTSTR, + FS_UUID_VAARGS(&diskLock->owner)); + } + } + + ret = 0; + + exit: + if (fd != -1) { + close(fd); + } + free(dir); + free(fileName); + return ret; +} + +#endif // VMX86_SERVER /* @@ -2560,7 +2760,7 @@ if (fsAttrs->versionNumber == 3) { maxFileSize = (VMFS3CONST * (uint64) fsAttrs->fileBlockSize * 1024); } else if (fsAttrs->versionNumber >= 5) { - /* Get ready for 64 TB on VMFS5 and perform sanity check on version */ + /* Get ready for 64 TB on VMFS5 and perform confidence check on version */ maxFileSize = (uint64) 0x400000000000ULL; } else { Log(LGPFX" %s: Unsupported filesystem version, %u\n", __func__, diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/file/fileTempPosix.c open-vm-tools-12.3.0/open-vm-tools/lib/file/fileTempPosix.c --- open-vm-tools-12.2.5/open-vm-tools/lib/file/fileTempPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/file/fileTempPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2004-2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -36,6 +36,10 @@ # include #endif +#if defined(__APPLE__) && defined(TARGET_MAC_OS) +#include +#endif + #include "vmware.h" #include "file.h" #include "fileInt.h" @@ -92,6 +96,95 @@ } +#if defined(__APPLE__) && defined(TARGET_MAC_OS) +/* + *---------------------------------------------------------------------- + * + * FileExecutablePath -- + * + * Return the path of the executable running this code. + * + * Results: + * !NULL Success. The executable path. Must be freed by caller. + * NULL Failure + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static char * +FileExecutablePath(void) +{ + char *path = Util_SafeMalloc((size_t) PROC_PIDPATHINFO_MAXSIZE); + + if (proc_pidpath(getpid(), path, PROC_PIDPATHINFO_MAXSIZE) <= 0) { + Warning("%s: proc_pidpath failure %d\n", __FUNCTION__, errno); + + free(path); + path = NULL; + } + + return path; +} +#endif + + +/* + *---------------------------------------------------------------------- + * + * FileTmpDirOk -- + * + * Is it OK to query the TMPDIR environment variable? + * + * Results: + * TRUE Yes + * FALSE No + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static Bool +FileTmpDirOk(void) +{ +#if defined(__APPLE__) && defined(TARGET_MAC_OS) + /* No setuid on IOS, MacOS only */ + int err; + Bool ok; + struct stat statBuf; + char *path = FileExecutablePath(); + + if (path == NULL) { + return FALSE; // Err on the side of caution + } + + LOG_ONCE("%s: executable path '%s'\n", __FUNCTION__, path); + + err = Posix_Stat(path, &statBuf); + + free(path); + + if (err == -1) { + Warning("%s: Stat failed on '%s'\n", __FUNCTION__, path); + + return FALSE; // Err on the side of caution + } + + ok = ((statBuf.st_mode & S_ISUID) == 0); // Only when setuid not present + + LOG_ONCE("%s: TMPDIR ok %d\n", __FUNCTION__, ok); + + return ok; +#else + return TRUE; +#endif +} + + /* *---------------------------------------------------------------------- * @@ -120,7 +213,7 @@ /* Make several attempts to find a good temporary directory candidate */ if (useConf) { - dirName = (char *)LocalConfig_GetString(NULL, "tmpDirectory"); + dirName = (char *) LocalConfig_GetString(NULL, "tmpDirectory"); edirName = FileTryDir(dirName); Posix_Free(dirName); if (edirName != NULL) { @@ -128,10 +221,12 @@ } } - /* Posix_Getenv string must _not_ be freed */ - edirName = FileTryDir(Posix_Getenv("TMPDIR")); - if (edirName != NULL) { - return edirName; + if (FileTmpDirOk()) { + /* Posix_Getenv string must _not_ be freed */ + edirName = FileTryDir(Posix_Getenv("TMPDIR")); + if (edirName != NULL) { + return edirName; + } } /* P_tmpdir is usually defined in */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/foundryMsg/foundryMsg.c open-vm-tools-12.3.0/open-vm-tools/lib/foundryMsg/foundryMsg.c --- open-vm-tools-12.2.5/open-vm-tools/lib/foundryMsg/foundryMsg.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/foundryMsg/foundryMsg.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2016, 2019, 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2004-2016, 2019, 2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -637,7 +637,8 @@ || (VIX_USER_CREDENTIAL_HOST_CONFIG_HASHED_SECRET == credentialType) || (VIX_USER_CREDENTIAL_TICKETED_SESSION == credentialType) || (VIX_USER_CREDENTIAL_SSPI == credentialType) - || (VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN == credentialType)) { + || (VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN == credentialType) + || (VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN_HOST_VERIFIED == credentialType)) { /* * All of these are optional. */ @@ -690,7 +691,8 @@ || (VIX_USER_CREDENTIAL_HOST_CONFIG_HASHED_SECRET == credentialType) || (VIX_USER_CREDENTIAL_TICKETED_SESSION == credentialType) || (VIX_USER_CREDENTIAL_SSPI == credentialType) - || (VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN == credentialType)) { + || (VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN == credentialType) + || (VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN_HOST_VERIFIED == credentialType)) { char *destPtr = (char *) commandRequest; destPtr += commandRequest->commonHeader.headerLength; @@ -732,7 +734,7 @@ } /* - * Sanity check the header. + * Confidence check the header. * Some basic rules: All the length values in the VixMsgHeader * struct are uint32. The headerLength must be large enough to * accomodate the base header: VixMsgHeader. The bodyLength and @@ -788,7 +790,7 @@ } /* - * Sanity check the parts of the header that are specific to requests. + * Confidence check the parts of the header that are specific to requests. */ message = vMsg; if (message->commonHeader.headerLength < sizeof(VixCommandRequestHeader)) { @@ -848,7 +850,7 @@ } /* - * Sanity check the parts of the header that are specific to responses. + * Confidence check the parts of the header that are specific to responses. */ message = vMsg; if (message->commonHeader.headerLength < sizeof(VixCommandResponseHeader)) { diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/globalConfig/globalConfig.c open-vm-tools-12.3.0/open-vm-tools/lib/globalConfig/globalConfig.c --- open-vm-tools-12.2.5/open-vm-tools/lib/globalConfig/globalConfig.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/globalConfig/globalConfig.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/guestApp/guestApp.c open-vm-tools-12.3.0/open-vm-tools/lib/guestApp/guestApp.c --- open-vm-tools-12.2.5/open-vm-tools/lib/guestApp/guestApp.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/guestApp/guestApp.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2019 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -142,7 +142,18 @@ DWORD temp = 0; PWCHAR data = NULL; - rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, TOOLS_KEY_NAME, 0, KEY_READ, &key); + /* + * We need to access the WOW3264Node Registry node for arm64 windows tools, + * since the arm64 installer is currently built with x86 emulation mode. + * + * TODO: REMOVE the the KEY_WOW64_32KEY once the msi installer is running + * in native arm64. + */ + REGSAM samDesired = KEY_READ; +#ifdef TOOLS_ARM64 + samDesired |= KEY_WOW64_32KEY; +#endif + rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, TOOLS_KEY_NAME, 0, samDesired, &key); if (ERROR_SUCCESS != rc) { Debug("%s: Couldn't open key \"%S\".\n", __FUNCTION__, TOOLS_KEY_NAME); Debug("%s: RegOpenKeyExW error 0x%x.\n", __FUNCTION__, GetLastError()); diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/guestStoreClientHelper/guestStoreClient.c open-vm-tools-12.3.0/open-vm-tools/lib/guestStoreClientHelper/guestStoreClient.c --- open-vm-tools-12.2.5/open-vm-tools/lib/guestStoreClientHelper/guestStoreClient.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/guestStoreClientHelper/guestStoreClient.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/hgfs/cpName.c open-vm-tools-12.3.0/open-vm-tools/lib/hgfs/cpName.c --- open-vm-tools-12.2.5/open-vm-tools/lib/hgfs/cpName.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/hgfs/cpName.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2016,2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2016,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/hgfs/hgfsEscape.c open-vm-tools-12.3.0/open-vm-tools/lib/hgfs/hgfsEscape.c --- open-vm-tools-12.2.5/open-vm-tools/lib/hgfs/hgfsEscape.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/hgfs/hgfsEscape.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2019,2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2019,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/hgfs/hgfsUtil.c open-vm-tools-12.3.0/open-vm-tools/lib/hgfs/hgfsUtil.c --- open-vm-tools-12.2.5/open-vm-tools/lib/hgfs/hgfsUtil.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/hgfs/hgfsUtil.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2016,2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2016,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/hgfsServer/hgfsServer.c open-vm-tools-12.3.0/open-vm-tools/lib/hgfsServer/hgfsServer.c --- open-vm-tools-12.2.5/open-vm-tools/lib/hgfsServer/hgfsServer.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/hgfsServer/hgfsServer.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -56,6 +56,10 @@ #include "vm_basic_asm.h" #include "unicodeOperations.h" +#ifndef VM_X86_ANY +#include "random.h" +#endif + #if defined(_WIN32) #include #define HGFS_PARENT_DIR "..\\" @@ -4159,7 +4163,16 @@ static uint64 HgfsGenerateSessionId(void) { +#ifdef VM_X86_ANY return RDTSC(); +#else + uint64 sessionId; + rqContext *rCtx = Random_QuickSeed((uint32)time(NULL)); + sessionId = (uint64)Random_Quick(rCtx) << 32; + sessionId |= Random_Quick(rCtx); + free(rCtx); + return sessionId; +#endif } @@ -5568,7 +5581,7 @@ Wiper_Init(NULL); /* - * Sanity checks. If length is good, assume well-formed drive path + * Confidence checks. If length is good, assume well-formed drive path * (i.e. "C:\..." or "\\abc..."). Note that we throw out shares that * exactly equal p.mountPoint's size because we won't have room for a null * delimiter on copy. Allow 0 length drives so that hidden feature "" can @@ -8711,7 +8724,7 @@ * * HgfsServerValidateOpenParameters -- * - * Performs sanity check of the input parameters. + * Performs confidence check of the input parameters. * * Results: * HGFS_ERROR_SUCCESS if the parameters are valid. diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/hgfsServer/hgfsServerOplockMonitor.c open-vm-tools-12.3.0/open-vm-tools/lib/hgfsServer/hgfsServerOplockMonitor.c --- open-vm-tools-12.2.5/open-vm-tools/lib/hgfsServer/hgfsServerOplockMonitor.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/hgfsServer/hgfsServerOplockMonitor.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/appUtil.h open-vm-tools-12.3.0/open-vm-tools/lib/include/appUtil.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/appUtil.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/appUtil.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,183 +0,0 @@ -/********************************************************* - * Copyright (C) 2008-2019 VMware, Inc. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation version 2.1 and no later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - *********************************************************/ - -/* - * appUtil.h -- - * - * Utility functions for guest applications. - */ - -#ifndef _APP_UTIL_H_ -#define _APP_UTIL_H_ - -#ifdef _WIN32 -#include -#endif - -#include "vmware.h" - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus -#include "vmware/guestrpc/capabilities.h" - -#ifdef __cplusplus -}; -#endif // __cplusplus - -/* - * Platform-agnostic bitmask of types of handlers to include. - * Used by the AppUtil file type functions. - */ -typedef enum { - FILE_TYPE_INCLUDE_NONE = 0, - FILE_TYPE_INCLUDE_URI = 1, // Include URI handlers - FILE_TYPE_INCLUDE_PERCEIVED_HANDLERS = 1 << 1, // Include perceived type handlers - // (see bug 1440812). - FILE_TYPE_INCLUDE_ALL = FILE_TYPE_INCLUDE_URI | - FILE_TYPE_INCLUDE_PERCEIVED_HANDLERS -} FileTypeInclusions; - -#ifdef _WIN32 - -/* The maximum number of icons that can be retrieved in a single query. */ -#define APPUTIL_MAX_NUM_ICONS 16 - -/* Predefined (N x N pixels) icon sizes */ -#define APPUTIL_ICON_SMALL 16 -#define APPUTIL_ICON_BIG 32 - -typedef struct AppUtilIconEntry { - uint32 width; // width of icon in pixels - uint32 height; // height of icon in pixels - uint32 widthBytes; // width of one row in bytes, including padding - uint32 dataLength; // length of bgra data, in bytes - unsigned char *dataBGRA; // pointer to bgra data -} AppUtilIconEntry; - -typedef struct AppUtilIconInfo { - uint32 numEntries; - AppUtilIconEntry *iconList; -} AppUtilIconInfo; - -typedef enum { - APPUTIL_UPPER_LEFT_DIB = -1, // the origin is the upper-left corner of the bitmap - APPUTIL_LOWER_LEFT_DIB = 1, // the origin is the lower-left corner of the bitmap -} AppUtilBitmapOrigin; - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -Bool AppUtil_GetIconDataByHandle(HICON hIcon, - AppUtilBitmapOrigin origin, - AppUtilIconEntry *icon); - -Bool AppUtil_GetDIBitsAlloc(HDC hdc, - HBITMAP hbmp, - UINT uStartScan, - UINT cScanLines, - LPBITMAPINFO lpbi, - UINT uUsage, - char **bits); - -HICON AppUtil_GetWindowIcon(HWND hwnd, - uint32 iconSize); - -void AppUtil_BuildGlobalApplicationList(FileTypeInclusions inclusions); - -wchar_t* AppUtil_SanitizeCommandLine(const wchar_t *commandLineUtf16); -char *AppUtil_ActionURIForCommandLine(const WCHAR *commandLineUtf16); -Bool AppUtil_CommandLineForShellCommandURI(const char *shellCommandURI, - char **executablePath, - char **commandLine); - -Bool AppUtil_GetLinkIconData(const TCHAR *path, - AppUtilIconInfo *iconInfo, - AppUtilBitmapOrigin dibOrientation); - -Bool AppUtil_GetAppIconData(const TCHAR *path, - AppUtilIconInfo *iconInfo, - AppUtilBitmapOrigin dibOrientation); - -Bool AppUtil_LoadIcon(HMODULE module, - LPCWSTR resID, - AppUtilBitmapOrigin origin, - AppUtilIconInfo *icon); - -Bool AppUtil_CopyIcon(const AppUtilIconInfo *srcIcon, AppUtilIconInfo *dstIcon); - -void AppUtil_DestroyIcon(AppUtilIconInfo *icon); - -Bool AppUtil_GetIconIndexAndLocationForShortcut(const TCHAR *shortcut, - int maxLen, - TCHAR *iconFile, - int *iconIndex); - -PISECURITY_DESCRIPTOR AppUtil_AllocateLowIntegritySD(void); - -LPSTR AppUtil_ToLowerUtf8(LPCSTR s); -LPWSTR AppUtil_ToLowerUtf16(LPCWSTR s); - -Bool AppUtil_IsHorizonVDIAppRemotingMode(); -Bool AppUtil_IsHorizonUWPEnabled(); - -#ifdef __cplusplus -}; -#endif // __cplusplus - -#else // not _WIN32 - -#include - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -void AppUtil_Init(void); -GPtrArray *AppUtil_CollectIconArray(const char *iconName, - unsigned long windowID); -void AppUtil_FreeIconArray(GPtrArray *pixbufs); - -Bool AppUtil_AppIsSkippable(const char *appName); -char *AppUtil_CanonicalizeAppName(const char *appName, - const char *cwd); - -#ifdef __cplusplus -}; -#endif // __cplusplus - -#endif - -/* - * Platform-independent functions. - */ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -void AppUtil_SendGuestCaps(const GuestCapabilities *caps, - size_t numCaps, - Bool enabled); - -#ifdef __cplusplus -}; -#endif // __cplusplus - -#endif // _APP_UTIL_H_ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/asyncsocket.h open-vm-tools-12.3.0/open-vm-tools/lib/include/asyncsocket.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/asyncsocket.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/asyncsocket.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2022 VMware, Inc. All rights reserved. + * Copyright (C) 2003-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -103,6 +103,7 @@ #define ASOCK_EHOSTUNREACH WSAEHOSTUNREACH #define ASOCK_ETIMEDOUT WSAETIMEDOUT #define ASOCK_ECONNREFUSED WSAECONNREFUSED +#define ASOCK_EACCES WSAEACCES #else #define ASOCK_ENOTCONN ENOTCONN #define ASOCK_ENOTSOCK ENOTSOCK @@ -111,11 +112,12 @@ #define ASOCK_EWOULDBLOCK EWOULDBLOCK #define ASOCK_ENETUNREACH ENETUNREACH #define ASOCK_ECONNRESET ECONNRESET -#define ASOCK_ETIMEDOUT ETIMEDOUT -#define ASOCK_ECONNREFUSED ECONNREFUSED #define ASOCK_ECONNABORTED ECONNABORTED #define ASOCK_EPIPE EPIPE #define ASOCK_EHOSTUNREACH EHOSTUNREACH +#define ASOCK_ETIMEDOUT ETIMEDOUT +#define ASOCK_ECONNREFUSED ECONNREFUSED +#define ASOCK_EACCES EACCES #endif /* diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/backdoor_def.h open-vm-tools-12.3.0/open-vm-tools/lib/include/backdoor_def.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/backdoor_def.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/backdoor_def.h 2023-08-31 14:38:59.000000000 +0000 @@ -188,7 +188,7 @@ # define BDOOR_CMD_FE_EXCEPTION 1 # define BDOOR_CMD_FE_SGX 2 # define BDOOR_CMD_FE_PCI_MMIO 3 -# define BDOOR_CMD_FE_GMM 4 +//#define BDOOR_CMD_FE_GMM 4 /* GMM is deprecated. */ #define BDOOR_CMD_VMK_INFO 72 #define BDOOR_CMD_EFI_BOOT_CONFIG 73 /* CPL 0 only. */ # define BDOOR_CMD_EBC_LEGACYBOOT_ENABLED 0 @@ -215,29 +215,7 @@ # define BDOOR_CMD_MKSGS_ADD_PPN 1 # define BDOOR_CMD_MKSGS_REMOVE_PPN 2 #define BDOOR_CMD_ABSPOINTER_RESTRICT 86 -#define BDOOR_CMD_GUEST_INTEGRITY 87 -# define BDOOR_CMD_GI_GET_CAPABILITIES 0 -# define BDOOR_CMD_GI_SETUP_ENTRY_POINT 1 -# define BDOOR_CMD_GI_SETUP_ALERTS 2 -# define BDOOR_CMD_GI_SETUP_STORE 3 -# define BDOOR_CMD_GI_SETUP_EVENT_RING 4 -# define BDOOR_CMD_GI_SETUP_NON_FAULT_READ 5 -# define BDOOR_CMD_GI_ENTER_INTEGRITY_MODE 6 -# define BDOOR_CMD_GI_EXIT_INTEGRITY_MODE 7 -# define BDOOR_CMD_GI_RESET_INTEGRITY_MODE 8 -# define BDOOR_CMD_GI_GET_EVENT_RING_STATE 9 -# define BDOOR_CMD_GI_CONSUME_RING_EVENTS 10 -# define BDOOR_CMD_GI_WATCH_MAPPINGS_START 11 -# define BDOOR_CMD_GI_WATCH_MAPPINGS_STOP 12 -# define BDOOR_CMD_GI_CHECK_MAPPINGS_NOW 13 -# define BDOOR_CMD_GI_WATCH_PPNS_START 14 -# define BDOOR_CMD_GI_WATCH_PPNS_STOP 15 -# define BDOOR_CMD_GI_SEND_MSG 16 -# define BDOOR_CMD_GI_TEST_READ_MOB 128 -# define BDOOR_CMD_GI_TEST_ADD_EVENT 129 -# define BDOOR_CMD_GI_TEST_MAPPING 130 -# define BDOOR_CMD_GI_TEST_PPN 131 -# define BDOOR_CMD_GI_MAX 131 +//#define BDOOR_CMD_GUEST_INTEGRITY 87 /* GI is deprecated. */ #define BDOOR_CMD_MKSTEST 88 /* Devel only. */ # define BDOOR_CMD_MKSTEST_STATS_START 0 # define BDOOR_CMD_MKSTEST_STATS_STOP 1 @@ -257,16 +235,7 @@ # define BDOOR_CMD_FUZZER_INIT 0 # define BDOOR_CMD_FUZZER_NEXT 1 #define BDOOR_CMD_PUTCHR12 95 -#define BDOOR_CMD_GMM 96 -# define BDOOR_CMD_GMM_GET_SIZE 0 /* Depends on firmware. */ -# define BDOOR_CMD_GMM_MAP_MEMORY 1 /* Depends on firmware. */ -# define BDOOR_CMD_GMM_ENTER 2 -# define BDOOR_CMD_GMM_ONESHOT_TIMER 3 -# define BDOOR_CMD_GMM_WATCH_PPNS_START 4 -# define BDOOR_CMD_GMM_WATCH_PPNS_STOP 5 -# define BDOOR_CMD_GMM_RESYNC_RUNTIME_INFO 6 -# define BDOOR_CMD_GMM_INVS_BRK_POINT 7 -# define BDOOR_CMD_GMM_GET_CAPABILITY 8 +//#define BDOOR_CMD_GMM 96 /* GMM is deprecated. */ #define BDOOR_CMD_PRECISIONCLOCK 97 # define BDOOR_CMD_PRECISIONCLOCK_GETTIME 0 # define BDOOR_CMD_PRECISIONCLOCK_SETTIME 1 diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/buildNumber.h open-vm-tools-12.3.0/open-vm-tools/lib/include/buildNumber.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/buildNumber.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/buildNumber.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,12 +1,12 @@ #define BUILD_NUMBER \ - "build-21855600" + "build-22234872" #define BUILD_NUMBER_NUMERIC \ - 21855600 + 22234872 #define BUILD_NUMBER_NUMERIC_STRING \ - "21855600" + "22234872" #define PRODUCT_BUILD_NUMBER \ - "product-build-43614" + "product-build-44994" #define PRODUCT_BUILD_NUMBER_NUMERIC \ - 43614 + 44994 #define PRODUCT_BUILD_NUMBER_NUMERIC_STRING \ - "43614" + "44994" diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/compat/compat_stdarg.h open-vm-tools-12.3.0/open-vm-tools/lib/include/compat/compat_stdarg.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/compat/compat_stdarg.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/compat/compat_stdarg.h 2023-08-31 14:38:59.000000000 +0000 @@ -36,10 +36,13 @@ * Compatibility defines for systems that need the stdarg features. If your program * needs va_init, va_copy, va_end, etc. then include this file instead of including * stdarg.h directly. + * + * Note that the header guard for this file does not follow typical naming + * convention as _COMPAT_STDARG_H conflicts with emscripten's compat/stdarg.h */ -#ifndef _COMPAT_STDARG_H -#define _COMPAT_STDARG_H 1 +#ifndef _VMWARE_COMPAT_STDARG_H +#define _VMWARE_COMPAT_STDARG_H 1 #define INCLUDE_ALLOW_USERLEVEL @@ -66,4 +69,4 @@ # endif #endif -#endif /* _COMPAT_STDARG_H */ +#endif /* _VMWARE_COMPAT_STDARG_H */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/conf.h open-vm-tools-12.3.0/open-vm-tools/lib/include/conf.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/conf.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/conf.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2002-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2002-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -567,7 +567,7 @@ /** * Lets users configure the process timeout value in deployPkg - * Valid value range: 0x01 ~ 0xFF + * Valid value range: 1 ~ 3600 */ #define CONFNAME_DEPLOYPKG_PROCESSTIMEOUT "process-timeout" diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/deployPkg/deployPkgFormat.h open-vm-tools-12.3.0/open-vm-tools/lib/include/deployPkg/deployPkgFormat.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/deployPkg/deployPkgFormat.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/deployPkg/deployPkgFormat.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/deployPkg/linuxDeployment.h open-vm-tools-12.3.0/open-vm-tools/lib/include/deployPkg/linuxDeployment.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/deployPkg/linuxDeployment.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/deployPkg/linuxDeployment.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2019, 2022 VMware, Inc. All rights reserved. + * Copyright (c) 2009-2019, 2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/file.h open-vm-tools-12.3.0/open-vm-tools/lib/include/file.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/file.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/file.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2020 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2020,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -116,6 +116,13 @@ char **remoteIP, char **remoteMountPoint, char **localMountPoint); + +int File_GetVMFSLockInfo(const char *path, + uint32 *outOpenFlags, + uint32 *outWorldID, + char **outWorldName, + char **outVMFSMacAddr, + uint32 *outVMFSLockMode); #endif Bool File_SupportsZeroedThick(const char *pathName); @@ -367,6 +374,8 @@ char *File_GetSafeRandomTmpDir(Bool useConf); +char *File_GetUacSafeRandomTmpDir(Bool useConf); + int File_MakeSafeTemp(const char *tag, char **presult); diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/fileIO.h open-vm-tools-12.3.0/open-vm-tools/lib/include/fileIO.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/fileIO.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/fileIO.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2018, 2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2018, 2021-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/ghIntegrationCommon.h open-vm-tools-12.3.0/open-vm-tools/lib/include/ghIntegrationCommon.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/ghIntegrationCommon.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/ghIntegrationCommon.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -56,7 +56,8 @@ #define GHI_CHANNEL_VIEW_SDR 9 // Handled by View SDR #define GHI_CHANNEL_VIEW_WHFB_REDIRECTION 10 // WhfbRedirectionMKSControl module in // View RMKS -#define GHI_CHANNEL_COUNT 11 +#define GHI_CHANNEL_VIEW_SCREEN_CAPTURE 11 // ScreenCapture in View RMKS +#define GHI_CHANNEL_COUNT 12 typedef uint32 GHIChannelType; @@ -222,5 +223,21 @@ #define GHI_CHANNEL_VIEW_SDR_BITS GHI_GUEST_CHANNEL_BITS(GHI_CHANNEL_VIEW_SDR) #define GHI_VIEW_SDR_VDP_CONNECTED (GHI_CHANNEL_VIEW_SDR_BITS | 0x000001) #define GHI_VIEW_SDR_VDP_DISCONNECTED (GHI_CHANNEL_VIEW_SDR_BITS | 0x000002) +#define GHI_VIEW_SDR_VDP_SDRPOLICY (GHI_CHANNEL_VIEW_SDR_BITS | 0x000003) + + +/* + * UI->MKS messages over GHI_CHANNEL_VIEW_SCREEN_CAPTURE + */ +#define GHI_VIEW_SCREEN_CAPTURE_TAKE_SNAPSHOT "ghi.view.screen.capture.take.snapshot" +#define GHI_VIEW_SCREEN_CAPTURE_ENUM_TOPOLOGY "ghi.view.screen.capture.enum.topology" + +/* + * MKS->UI messages over GHI_CHANNEL_VIEW_SCREEN_CAPTURE. + */ +#define GHI_CHANNEL_VIEW_SCREEN_CAPTURE_BITS \ + GHI_GUEST_CHANNEL_BITS(GHI_CHANNEL_VIEW_SCREEN_CAPTURE) +#define GHI_GUEST_SCREEN_CAPTURE_FUNC_READY (GHI_CHANNEL_VIEW_SCREEN_CAPTURE_BITS | 0x000001) +#define GHI_GUEST_SCREEN_CAPTURE_TOPOLOGY (GHI_CHANNEL_VIEW_SCREEN_CAPTURE_BITS | 0x000002) #endif // ifndef _GHINTEGRATIONCOMMON_H_ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/glibUtils.h open-vm-tools-12.3.0/open-vm-tools/lib/include/glibUtils.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/glibUtils.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/glibUtils.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2017,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2017,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/globalConfig.h open-vm-tools-12.3.0/open-vm-tools/lib/include/globalConfig.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/globalConfig.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/globalConfig.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,8 @@ #ifndef _GLOBAL_CONFIG_H_ #define _GLOBAL_CONFIG_H_ -#if defined(_WIN32) || (defined(__linux__) && !defined(USERWORLD)) +#if (defined(_WIN32) && !defined(_ARM64_)) || \ + (defined(__linux__) && !defined(USERWORLD)) #define GLOBALCONFIG_SUPPORTED 1 diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/guest_msg_def.h open-vm-tools-12.3.0/open-vm-tools/lib/include/guest_msg_def.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/guest_msg_def.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/guest_msg_def.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2016,2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2016,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/guest_os.h open-vm-tools-12.3.0/open-vm-tools/lib/include/guest_os.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/guest_os.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/guest_os.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2021 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -86,12 +86,13 @@ #define ALLFREEBSD32 BS(FREEBSD), BS(FREEBSD11), \ BS(FREEBSD12), BS(FREEBSD13), \ - BS(FREEBSD14) + BS(FREEBSD14), BS(FREEBSD15) #define ALLFREEBSD64 BS(FREEBSD_64), \ BS(FREEBSD11_64), BS(FREEBSD12_64), \ BS(FREEBSD13_64), BS(FREEBSD13_ARM_64), \ - BS(FREEBSD14_64), BS(FREEBSD14_ARM_64) + BS(FREEBSD14_64), BS(FREEBSD14_ARM_64), \ + BS(FREEBSD15_64), BS(FREEBSD15_ARM_64) #define ALLFREEBSD ALLFREEBSD32, ALLFREEBSD64 @@ -225,11 +226,19 @@ BS(DEBIAN_ARM_64), BS(UBUNTU_ARM_64), \ BS(RHEL9_64), BS(RHEL9_ARM_64), \ BS(ROCKY_LINUX_64), BS(ROCKY_LINUX_ARM_64), \ - BS(ALMA_LINUX_64), BS(ALMA_LINUX_ARM_64) + BS(ALMA_LINUX_64), BS(ALMA_LINUX_ARM_64), \ + BS(CRXSYS1_ARM_64), BS(CRXPOD1_ARM_64), \ + BS(CRXSYS2_64), BS(CRXSYS2_ARM_64) #define ALL6XLINUX32 BS(OTHER6XLINUX) -#define ALL6XLINUX64 BS(OTHER6XLINUX_64), BS(OTHER6XLINUX_ARM_64) +#define ALL6XLINUX64 BS(OTHER6XLINUX_64), BS(OTHER6XLINUX_ARM_64), \ + BS(RHEL10_64), BS(RHEL10_ARM_64), \ + BS(ORACLE10_64) + +#define ALL7XLINUX32 BS(OTHER7XLINUX) + +#define ALL7XLINUX64 BS(OTHER7XLINUX_64), BS(OTHER7XLINUX_ARM_64) #define ALLVMKERNEL BS(VMKERNEL), BS(VMKERNEL5), \ BS(VMKERNEL6), BS(VMKERNEL65), \ @@ -239,12 +248,14 @@ #define ALLLINUX32 BS(VMKERNEL), BS(OTHERLINUX), \ BS(OTHER24XLINUX), ALL26XLINUX32, \ ALL3XLINUX32, ALL4XLINUX32, \ - ALL5XLINUX32, ALL6XLINUX32 + ALL5XLINUX32, ALL6XLINUX32, \ + ALL7XLINUX32 #define ALLLINUX64 BS(OTHERLINUX_64), BS(OTHER24XLINUX_64), \ ALL26XLINUX64, ALL3XLINUX64, \ ALL4XLINUX64, ALL5XLINUX64, \ - ALL6XLINUX64, ALLPHOTON + ALL6XLINUX64, ALL7XLINUX64, \ + ALLPHOTON #define ALLLINUX ALLLINUX32, ALLLINUX64 @@ -271,16 +282,23 @@ #define ALLOS2 BS(OS2), ALLECOMSTATION -#define ALLCRX BS(CRXSYS1_64), BS(CRXPOD1_64) +#define ALLCRX BS(CRXSYS1_64), BS(CRXPOD1_64), \ + BS(CRXSYS1_ARM_64), BS(CRXPOD1_ARM_64), \ + BS(CRXSYS2_64), BS(CRXSYS2_ARM_64) #define ALLARM BS(WIN_10_ARM_64), BS(WIN_11_ARM_64), \ - BS(WIN_12_ARM_64), BS(RHEL9_ARM_64), \ + BS(WIN_12_ARM_64), \ BS(UBUNTU_ARM_64), BS(PHOTON_ARM_64), \ BS(VMKERNEL7_ARM), BS(VMKERNEL8_ARM), \ - BS(OTHER_ARM_64), BS(OTHER5XLINUX_ARM_64), \ - BS(OTHER6XLINUX_ARM_64), BS(DEBIAN_ARM_64), \ + BS(OTHER_ARM_64), BS(DEBIAN_ARM_64), \ + BS(OTHER5XLINUX_ARM_64), BS(OTHER6XLINUX_ARM_64), \ + BS(OTHER7XLINUX_ARM_64), \ BS(FREEBSD13_ARM_64), BS(FREEBSD14_ARM_64), \ - BS(ALMA_LINUX_ARM_64), BS(ROCKY_LINUX_ARM_64) + BS(FREEBSD15_ARM_64), \ + BS(ALMA_LINUX_ARM_64), BS(ROCKY_LINUX_ARM_64), \ + BS(CRXSYS1_ARM_64), BS(CRXSYS2_ARM_64), \ + BS(CRXPOD1_ARM_64), \ + BS(RHEL9_ARM_64), BS(RHEL10_ARM_64) /* * Architecture prefixes. No prefix implies the X86 architecture. @@ -340,7 +358,9 @@ #define STR_OS_OTHER_5X "other5xlinux" #define STR_OS_OTHER_5X_FULL "Other Linux 5.x kernel" #define STR_OS_OTHER_6X "other6xlinux" -#define STR_OS_OTHER_6X_FULL "Other Linux 6.x and later kernel" +#define STR_OS_OTHER_6X_FULL "Other Linux 6.x kernel" +#define STR_OS_OTHER_7X "other7xlinux" +#define STR_OS_OTHER_7X_FULL "Other Linux 7.x and later kernel" #define STR_OS_PHOTON "vmware-photon" #define STR_OS_PHOTON_FULL "VMware Photon OS" #define STR_OS_PLD "PLD" @@ -551,6 +571,9 @@ * Window on Arm support starts with Windows 10. */ +#define STR_OS_ARM_WIN "arm-windows" + + /* * Windows 10 * diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/guest_os_tables.h open-vm-tools-12.3.0/open-vm-tools/lib/include/guest_os_tables.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/guest_os_tables.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/guest_os_tables.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -84,9 +84,12 @@ GOT(GUEST_OS_OTHER5XLINUX) /* Linux 5.x 32-bit */ \ GOT(GUEST_OS_OTHER5XLINUX_64) /* Linux 5.x 64-bit */ \ GOT(GUEST_OS_OTHER5XLINUX_ARM_64) /* Linux 5.x Arm 64-bit */ \ - GOT(GUEST_OS_OTHER6XLINUX) /* Linux 6.x and later 32-bit */ \ - GOT(GUEST_OS_OTHER6XLINUX_64) /* Linux 6.x and later 64-bit */ \ - GOT(GUEST_OS_OTHER6XLINUX_ARM_64) /* Linux 6.x and later Arm 64-bit */ \ + GOT(GUEST_OS_OTHER6XLINUX) /* Linux 6.x 32-bit */ \ + GOT(GUEST_OS_OTHER6XLINUX_64) /* Linux 6.x 64-bit */ \ + GOT(GUEST_OS_OTHER6XLINUX_ARM_64) /* Linux 6.x Arm 64-bit */ \ + GOT(GUEST_OS_OTHER7XLINUX) /* Linux 7.x and later 32-bit */ \ + GOT(GUEST_OS_OTHER7XLINUX_64) /* Linux 7.x and later 64-bit */ \ + GOT(GUEST_OS_OTHER7XLINUX_ARM_64) /* Linux 7.x and later Arm 64-bit */ \ GOT(GUEST_OS_OTHER) /* Other 32-bit */ \ GOT(GUEST_OS_OTHER_64) /* Other 64-bit */ \ GOT(GUEST_OS_OTHER_ARM_64) /* Other Arm 64-bit */ \ @@ -100,6 +103,8 @@ GOT(GUEST_OS_RHEL_64) \ GOT(GUEST_OS_RHEL9_64) \ GOT(GUEST_OS_RHEL9_ARM_64) \ + GOT(GUEST_OS_RHEL10_64) \ + GOT(GUEST_OS_RHEL10_ARM_64) \ GOT(GUEST_OS_FREEBSD) \ GOT(GUEST_OS_FREEBSD_64) \ GOT(GUEST_OS_FREEBSD11) \ @@ -112,6 +117,9 @@ GOT(GUEST_OS_FREEBSD14) \ GOT(GUEST_OS_FREEBSD14_64) \ GOT(GUEST_OS_FREEBSD14_ARM_64) \ + GOT(GUEST_OS_FREEBSD15) \ + GOT(GUEST_OS_FREEBSD15_64) \ + GOT(GUEST_OS_FREEBSD15_ARM_64) \ GOT(GUEST_OS_SOLARIS_6_AND_7) \ GOT(GUEST_OS_SOLARIS8) \ GOT(GUEST_OS_SOLARIS9) \ @@ -158,6 +166,7 @@ GOT(GUEST_OS_ORACLE7_64) \ GOT(GUEST_OS_ORACLE8_64) \ GOT(GUEST_OS_ORACLE9_64) \ + GOT(GUEST_OS_ORACLE10_64) \ GOT(GUEST_OS_CENTOS) \ GOT(GUEST_OS_CENTOS_64) \ GOT(GUEST_OS_CENTOS6) \ @@ -168,7 +177,11 @@ GOT(GUEST_OS_AMAZONLINUX2_64) \ GOT(GUEST_OS_AMAZONLINUX3_64) \ GOT(GUEST_OS_CRXSYS1_64) /* VMware CRX system VM 1.0 64-bit */ \ + GOT(GUEST_OS_CRXSYS1_ARM_64) /* VMware CRX system VM 1.0 Arm 64-bit */ \ + GOT(GUEST_OS_CRXSYS2_64) /* VMware CRX system VM 2.0 64-bit */ \ + GOT(GUEST_OS_CRXSYS2_ARM_64) /* VMware CRX system VM 2.0 Arm 64-bit */ \ GOT(GUEST_OS_CRXPOD1_64) /* VMware CRX pod VM 1.0 64-bit */ \ + GOT(GUEST_OS_CRXPOD1_ARM_64) /* VMware CRX pod VM 1.0 Arm 64-bit */ \ GOT(GUEST_OS_LINUX_MINT_64) \ GOT(GUEST_OS_ROCKY_LINUX_64) \ GOT(GUEST_OS_ROCKY_LINUX_ARM_64) \ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/guestStoreClient.h open-vm-tools-12.3.0/open-vm-tools/lib/include/guestStoreClient.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/guestStoreClient.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/guestStoreClient.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020 VMware, Inc. All rights reserved. + * Copyright (c) 2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/guestStoreConst.h open-vm-tools-12.3.0/open-vm-tools/lib/include/guestStoreConst.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/guestStoreConst.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/guestStoreConst.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2019-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/guestStoreDefs.h open-vm-tools-12.3.0/open-vm-tools/lib/include/guestStoreDefs.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/guestStoreDefs.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/guestStoreDefs.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2019-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/hgfsServer.h open-vm-tools-12.3.0/open-vm-tools/lib/include/hgfsServer.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/hgfsServer.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/hgfsServer.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2020 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2020,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -27,7 +27,7 @@ extern "C" { #endif -#define HGFS_VMX_IOV_CONTEXT_SIZE (vmx86_debug ? 112 : 96) +#define HGFS_VMX_IOV_CONTEXT_SIZE (vmx86_debug ? 120 : 104) typedef struct HgfsVmxIov { void *va; /* Virtual addr */ uint64 pa; /* Physical address passed by the guest */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/hostinfo.h open-vm-tools-12.3.0/open-vm-tools/lib/include/hostinfo.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/hostinfo.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/hostinfo.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -57,6 +57,7 @@ int pid); HostinfoProcessQuery Hostinfo_QueryProcessExistence(int pid); +HostinfoProcessQuery Hostinfo_QueryProcessReaped(int pid); /* This macro defines the current version of the structured header. */ #define HOSTINFO_STRUCT_HEADER_VERSION 1 diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/iovector.h open-vm-tools-12.3.0/open-vm-tools/lib/include/iovector.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/iovector.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/iovector.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -36,7 +36,8 @@ /* * Ugly definition of struct iovec. */ -#if defined(__linux__) || defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(sun) || defined(__APPLE__) || \ + defined(__FreeBSD__) || defined(__EMSCRIPTEN__) #include // for struct iovec #else @@ -59,7 +60,7 @@ uint32 numEntries; /* Total number of entries */ Bool read; /* is it a readv operation? else it's write */ struct iovec *entries; /* Array of entries (dynamically allocated) */ - struct iovec *allocEntries; /* The original array that can be passed to free(). + struct iovec *allocEntries; /* The original array that can be passed to free(). * NULL if entries is on a stack. */ } VMIOVec; diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/log.h open-vm-tools-12.3.0/open-vm-tools/lib/include/log.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/log.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/log.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -402,6 +402,7 @@ typedef struct { uint8 level; Bool additionalLine; + size_t msgLen; char timeStamp[64]; char threadName[32]; char opID[LOG_MAX_OPID_LENGTH + 1]; // Will be empty string on hosted products diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/loglevel_user.h open-vm-tools-12.3.0/open-vm-tools/lib/include/loglevel_user.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/loglevel_user.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/loglevel_user.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2020 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/loglevel_userVars.h open-vm-tools-12.3.0/open-vm-tools/lib/include/loglevel_userVars.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/loglevel_userVars.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/loglevel_userVars.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -105,8 +105,6 @@ LOGLEVEL_VAR(fsresx), \ LOGLEVEL_VAR(ftConfig), /*lib/ftConfig */ \ LOGLEVEL_VAR(ftcpt), \ - LOGLEVEL_VAR(gmm), \ - LOGLEVEL_VAR(gpuManager), \ LOGLEVEL_VAR(grainTrack), \ LOGLEVEL_VAR(grm), \ LOGLEVEL_VAR(guestAppMonitor), \ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/mutexRankLib.h open-vm-tools-12.3.0/open-vm-tools/lib/include/mutexRankLib.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/mutexRankLib.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/mutexRankLib.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -211,7 +211,8 @@ * battery/button < preference * workerLib < something for sure under VThread_Create * licenseCheck < preference - * sslState < getSafeTmpDir + * sslState < sslCrlCache + * sslCrlCache < getSafeTmpDir */ #define RANK_vigorTransportListLock (RANK_libLockBase + 0x7010) @@ -223,7 +224,8 @@ #define RANK_configDbLock (RANK_libLockBase + 0x7070) #define RANK_keyLocatorLock (RANK_libLockBase + 0x7080) #define RANK_sslStateLock (RANK_libLockBase + 0x7085) -#define RANK_getSafeTmpDirLock (RANK_libLockBase + 0x7086) +#define RANK_sslCrlCacheLock (RANK_libLockBase + 0x7086) +#define RANK_getSafeTmpDirLock (RANK_libLockBase + 0x7087) #define RANK_licenseCheckLock (RANK_libLockBase + 0x7090) #define RANK_preferenceLock (RANK_libLockBase + 0x7100) diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/nicInfo.h open-vm-tools-12.3.0/open-vm-tools/lib/include/nicInfo.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/nicInfo.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/nicInfo.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2014-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2014-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/sslDirect.h open-vm-tools-12.3.0/open-vm-tools/lib/include/sslDirect.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/sslDirect.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/sslDirect.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2014-2016 VMware, Inc. All rights reserved. + * Copyright (c) 2014-2016,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -59,7 +59,5 @@ #define SSLGeneric_close(sock) close(sock) #endif -void *SSL_NewContext(void); - #endif // ifndef _SSLDIRECT_H_ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/strutil.h open-vm-tools-12.3.0/open-vm-tools/lib/include/strutil.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/strutil.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/strutil.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2018, 2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2018, 2021-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/su.h open-vm-tools-12.3.0/open-vm-tools/lib/include/su.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/su.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/su.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -55,7 +55,8 @@ char const *localizedDescription, Bool showDialogIfNeeded); -#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__)) +#elif defined(__linux__) || defined(sun) || defined(__FreeBSD__) || \ + defined(__EMSCRIPTEN__) #include #include diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/syncDriver.h open-vm-tools-12.3.0/open-vm-tools/lib/include/syncDriver.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/syncDriver.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/syncDriver.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2005-2018 VMware, Inc. All rights reserved. + * Copyright (c) 2005-2018, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -51,7 +51,8 @@ Bool SyncDriver_Init(void); Bool SyncDriver_Freeze(const char *drives, Bool enableNullDriver, SyncDriverHandle *handle, - const char *excludedFileSystems); + const char *excludedFileSystems, + Bool ignoreFrozenFS); Bool SyncDriver_Thaw(const SyncDriverHandle handle); SyncDriverStatus SyncDriver_QueryStatus(const SyncDriverHandle handle, int32 timeout); diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/system.h open-vm-tools-12.3.0/open-vm-tools/lib/include/system.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/system.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/system.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2016,2018 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2016,2018,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -77,6 +77,7 @@ Bool System_EnableDesktopComposition(BOOL enabled); LPWSTR System_GetImageFilePathForWindow(HWND hwnd); HANDLE System_OpenProcessForHWND(DWORD mask, BOOL inherit, HWND hwnd); +LONG System_VerifyTrust(const char *filePath); #endif diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/tracer.hh open-vm-tools-12.3.0/open-vm-tools/lib/include/tracer.hh --- open-vm-tools-12.2.5/open-vm-tools/lib/include/tracer.hh 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/tracer.hh 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013-2017,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2013-2017,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vixCommands.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vixCommands.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vixCommands.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vixCommands.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2003-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -42,7 +42,7 @@ /* * These give upper bounds for how big any VIX IPC meesage - * should be. There are for sanity checks and to ignore maliciously + * should be. There are for confidence checks and to ignore maliciously * large messages that may be part of an DoS attack. The may need to * be revised if large messages are added to the protocol. */ @@ -60,21 +60,27 @@ /* * The types of credential we can pass with any request. */ -#define VIX_USER_CREDENTIAL_NONE 0 -#define VIX_USER_CREDENTIAL_NAME_PASSWORD 1 -#define VIX_USER_CREDENTIAL_ANONYMOUS 2 -#define VIX_USER_CREDENTIAL_ROOT 3 -#define VIX_USER_CREDENTIAL_NAME_PASSWORD_OBFUSCATED 4 -#define VIX_USER_CREDENTIAL_CONSOLE_USER 5 -#define VIX_USER_CREDENTIAL_HOST_CONFIG_SECRET 6 -#define VIX_USER_CREDENTIAL_HOST_CONFIG_HASHED_SECRET 7 -#define VIX_USER_CREDENTIAL_NAMED_INTERACTIVE_USER 8 -#define VIX_USER_CREDENTIAL_TICKETED_SESSION 9 -#define VIX_USER_CREDENTIAL_SSPI 10 -#define VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN 11 +#define VIX_USER_CREDENTIAL_NONE 0 +#define VIX_USER_CREDENTIAL_NAME_PASSWORD 1 +#define VIX_USER_CREDENTIAL_ANONYMOUS 2 +#define VIX_USER_CREDENTIAL_ROOT 3 +#define VIX_USER_CREDENTIAL_NAME_PASSWORD_OBFUSCATED 4 +#define VIX_USER_CREDENTIAL_CONSOLE_USER 5 +#define VIX_USER_CREDENTIAL_HOST_CONFIG_SECRET 6 +#define VIX_USER_CREDENTIAL_HOST_CONFIG_HASHED_SECRET 7 +#define VIX_USER_CREDENTIAL_NAMED_INTERACTIVE_USER 8 +#define VIX_USER_CREDENTIAL_TICKETED_SESSION 9 +#define VIX_USER_CREDENTIAL_SSPI 10 +#define VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN 11 +#define VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN_HOST_VERIFIED 12 #define VIX_SHARED_SECRET_CONFIG_USER_NAME "__VMware_Vix_Shared_Secret_1__" +/* + * Base64 encoded value of string %HOST_VERIFIED_SIGNATURE% + */ +#define VIX_BASE64_ENCODED_HOST_VERIFIED_SIGNATURE_VALUE "JUhPU1RfVkVSSUZJRURfU0lHTkFUVVJFJQA=" + /* * This is the port for the server side remote Vix component diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vixOpenSource.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vixOpenSource.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vixOpenSource.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vixOpenSource.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2021 VMware, Inc. All rights reserved. + * Copyright (C) 2007-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_api.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_api.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_api.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_api.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2016,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2016,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_atomic.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_atomic.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_atomic.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_atomic.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -45,6 +45,14 @@ #pragma warning(pop) #endif +#ifdef __wasm__ +#define VM_ATOMIC_USE_C11 +#endif + +#ifdef VM_ATOMIC_USE_C11 +#include +#endif + #include "vm_basic_types.h" #include "vm_assert.h" @@ -309,7 +317,9 @@ { uint8 val; -#if defined __GNUC__ && defined VM_ARM_32 +#if defined VM_ATOMIC_USE_C11 + val = atomic_load((const _Atomic uint8 *)&var->value); +#elif defined __GNUC__ && defined VM_ARM_32 val = AtomicUndefined(var); #elif defined __GNUC__ && defined VM_ARM_64 val = _VMATOM_X(R, 8, &var->value); @@ -349,7 +359,9 @@ Atomic_ReadWrite8(Atomic_uint8 *var, // IN/OUT: uint8 val) // IN: { -#if defined __GNUC__ && defined VM_ARM_32 +#if defined VM_ATOMIC_USE_C11 + return atomic_exchange((_Atomic uint8 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_32 return AtomicUndefined(var + val); #elif defined __GNUC__ && defined VM_ARM_64 return _VMATOM_X(RW, 8, TRUE, &var->value, val); @@ -391,7 +403,9 @@ Atomic_Write8(Atomic_uint8 *var, // IN/OUT: uint8 val) // IN: { -#if defined __GNUC__ && defined VM_ARM_32 +#if defined VM_ATOMIC_USE_C11 + atomic_store((_Atomic uint8 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_32 AtomicUndefined(var + val); #elif defined __GNUC__ && defined VM_ARM_64 _VMATOM_X(W, 8, &var->value, val); @@ -430,7 +444,11 @@ uint8 oldVal, // IN: uint8 newVal) // IN: { -#if defined __GNUC__ && defined VM_ARM_32 +#if defined VM_ATOMIC_USE_C11 + atomic_compare_exchange_strong( + (_Atomic uint8 *)&var->value, &oldVal, newVal); + return oldVal; +#elif defined __GNUC__ && defined VM_ARM_32 return AtomicUndefined(var + oldVal + newVal); #elif defined __GNUC__ && defined VM_ARM_64 return _VMATOM_X(RIFEQW, 8, TRUE, &var->value, oldVal, newVal); @@ -479,7 +497,9 @@ { uint8 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_and((_Atomic uint8 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 8, TRUE, &var->value, and, val); #else do { @@ -541,7 +561,9 @@ { uint8 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_or((_Atomic uint8 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 8, TRUE, &var->value, orr, val); #else do { @@ -603,7 +625,9 @@ { uint8 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_xor((_Atomic uint8 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 8, TRUE, &var->value, eor, val); #else do { @@ -665,7 +689,9 @@ { uint8 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_add((_Atomic uint8 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 8, TRUE, &var->value, add, val); #else do { @@ -725,7 +751,9 @@ Atomic_Sub8(Atomic_uint8 *var, // IN/OUT uint8 val) // IN { -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_sub((_Atomic uint8 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 _VMATOM_X(OP, 8, TRUE, &var->value, sub, val); #else Atomic_Add8(var, -val); @@ -850,7 +878,9 @@ ASSERT(((uintptr_t)var % 4) == 0); #endif -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + value = atomic_load((_Atomic uint32 *)&var->value); +#elif defined __GNUC__ /* * Use inline assembler to force using a single load instruction to * ensure that the compiler doesn't split a transfer operation into multiple @@ -909,7 +939,9 @@ Atomic_ReadWrite32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + return atomic_exchange((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint32 retVal; uint32 res; @@ -976,7 +1008,9 @@ ASSERT(((uintptr_t)var % 4) == 0); #endif -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_store((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ #if defined VM_ARM_64 _VMATOM_X(W, 32, &var->value, val); #elif defined VM_ARM_32 @@ -1055,7 +1089,11 @@ uint32 oldVal, // IN uint32 newVal) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_compare_exchange_strong( + (_Atomic uint32 *)&var->value, &oldVal, newVal); + return oldVal; +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint32 retVal; uint32 res; @@ -1105,7 +1143,7 @@ #define Atomic_ReadIfEqualWrite Atomic_ReadIfEqualWrite32 -#if defined VM_64BIT || defined VM_ARM_V7 +#if defined VM_64BIT || defined VM_ARM_V7 || defined VM_ATOMIC_USE_C11 /* *----------------------------------------------------------------------------- * @@ -1127,7 +1165,11 @@ uint64 oldVal, // IN uint64 newVal) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_compare_exchange_strong( + (_Atomic uint64 *)&var->value, &oldVal, newVal); + return oldVal; +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint64 retVal; uint32 res; @@ -1218,7 +1260,9 @@ Atomic_And32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_and((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint32 res; uint32 tmp; @@ -1278,7 +1322,9 @@ Atomic_Or32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_or((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint32 res; uint32 tmp; @@ -1338,7 +1384,9 @@ Atomic_Xor32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_xor((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint32 res; uint32 tmp; @@ -1399,7 +1447,9 @@ Atomic_Xor64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_xor((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ #if defined VM_ARM_64 _VMATOM_X(OP, 64, TRUE, &var->value, eor, val); #else /* VM_X86_64 */ @@ -1441,7 +1491,9 @@ Atomic_Add32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_add((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint32 res; uint32 tmp; @@ -1501,7 +1553,9 @@ Atomic_Sub32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_sub((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint32 res; uint32 tmp; @@ -1574,7 +1628,9 @@ static INLINE void Atomic_Inc32(Atomic_uint32 *var) // IN/OUT { -#ifdef __GNUC__ +#if defined VM_ATOMIC_USE_C11 + Atomic_Add32(var, 1); +#elif defined __GNUC__ #if defined VM_ARM_ANY Atomic_Add32(var, 1); #else /* VM_X86_ANY */ @@ -1615,7 +1671,9 @@ static INLINE void Atomic_Dec32(Atomic_uint32 *var) // IN/OUT { -#ifdef __GNUC__ +#if defined VM_ATOMIC_USE_C11 + Atomic_Sub32(var, 1); +#elif defined __GNUC__ #if defined VM_ARM_ANY Atomic_Sub32(var, 1); #else /* VM_X86_ANY */ @@ -1665,7 +1723,9 @@ { uint32 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_or((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 32, TRUE, &var->value, orr, val); #else do { @@ -1699,7 +1759,9 @@ { uint32 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_and((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 32, TRUE, &var->value, and, val); #else do { @@ -1734,7 +1796,9 @@ { uint64 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_or((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 64, TRUE, &var->value, orr, val); #else do { @@ -1768,7 +1832,9 @@ { uint64 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_and((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 64, TRUE, &var->value, and, val); #else do { @@ -1805,7 +1871,9 @@ Atomic_ReadAdd32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + return atomic_fetch_add((_Atomic uint32 *)&var->value, val); +#elif defined __GNUC__ #ifdef VM_ARM_V7 uint32 res; uint32 retVal; @@ -1916,7 +1984,10 @@ uint64 oldVal, // IN uint64 newVal) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + return atomic_compare_exchange_strong( + (_Atomic uint64 *)&var->value, &oldVal, newVal); +#elif defined __GNUC__ #if defined VM_ARM_ANY return Atomic_ReadIfEqualWrite64(var, oldVal, newVal) == oldVal; #else /* VM_X86_ANY */ @@ -2041,7 +2112,10 @@ uint32 oldVal, // IN uint32 newVal) // IN { -#if defined __GNUC__ +#if defined VM_ATOMIC_USE_C11 + return atomic_compare_exchange_strong( + (_Atomic uint32 *)&var->value, &oldVal, newVal); +#elif defined __GNUC__ #if defined VM_ARM_ANY return Atomic_ReadIfEqualWrite32(var, oldVal, newVal) == oldVal; #else /* VM_X86_ANY */ @@ -2085,6 +2159,9 @@ static INLINE uint64 Atomic_Read64(Atomic_uint64 const *var) // IN { +#if defined VM_ATOMIC_USE_C11 + return atomic_load((const _Atomic uint64 *)&var->value); +#else #if defined __GNUC__ uint64 value; #endif @@ -2152,6 +2229,7 @@ #if defined __GNUC__ return value; #endif +#endif // !defined VM_ATOMIC_USE_C11 } @@ -2205,7 +2283,9 @@ Atomic_ReadAdd64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + return atomic_fetch_add((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 return _VMATOM_X(ROP, 64, TRUE, &var->value, add, val); #elif defined __x86_64__ @@ -2259,7 +2339,9 @@ Atomic_ReadSub64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + return atomic_fetch_sub((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 return _VMATOM_X(ROP, 64, TRUE, &var->value, sub, val); #else # ifdef _MSC_VER @@ -2351,7 +2433,9 @@ Atomic_Add64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if !defined VM_64BIT +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_add((_Atomic uint64 *)&var->value, val); +#elif !defined VM_64BIT Atomic_ReadAdd64(var, val); /* Return value is unused. */ #elif defined __GNUC__ #if defined VM_ARM_64 @@ -2394,7 +2478,9 @@ Atomic_Sub64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if !defined VM_64BIT +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_sub((_Atomic uint64 *)&var->value, val); +#elif !defined VM_64BIT Atomic_ReadSub64(var, val); /* Return value is unused. */ #elif defined __GNUC__ #if defined VM_ARM_64 @@ -2436,7 +2522,7 @@ static INLINE void Atomic_Inc64(Atomic_uint64 *var) // IN/OUT { -#if defined VM_ARM_64 +#if defined VM_ARM_64 || defined VM_ATOMIC_USE_C11 Atomic_Add64(var, 1); #elif !defined __x86_64__ Atomic_ReadInc64(var); /* Return value is unused. */ @@ -2476,7 +2562,7 @@ static INLINE void Atomic_Dec64(Atomic_uint64 *var) // IN/OUT { -#if defined VM_ARM_64 +#if defined VM_ARM_64 || defined VM_ATOMIC_USE_C11 Atomic_Sub64(var, 1); #elif !defined __x86_64__ Atomic_ReadDec64(var); /* Return value is unused. */ @@ -2517,7 +2603,9 @@ Atomic_ReadWrite64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __GNUC__ && defined __x86_64__ +#if defined VM_ATOMIC_USE_C11 + return atomic_exchange((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ && defined __x86_64__ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "xchgq %0, %1" @@ -2568,7 +2656,9 @@ ASSERT((uintptr_t)var % 8 == 0); #endif -#if defined __GNUC__ && defined __x86_64__ +#if defined VM_ATOMIC_USE_C11 + atomic_store((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ && defined __x86_64__ /* * There is no move instruction for 64-bit immediate to memory, so unless * the immediate value fits in 32-bit (i.e. can be sign-extended), GCC @@ -2619,7 +2709,9 @@ Atomic_Or64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __GNUC__ && defined __x86_64__ +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_or((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ && defined __x86_64__ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; orq %1, %0" @@ -2663,7 +2755,9 @@ Atomic_And64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { -#if defined __GNUC__ && defined __x86_64__ +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_and((_Atomic uint64 *)&var->value, val); +#elif defined __GNUC__ && defined __x86_64__ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; andq %1, %0" @@ -2874,7 +2968,9 @@ ASSERT((uintptr_t)var % 2 == 0); #endif -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + value = atomic_load((_Atomic uint16 *)&var->value); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "movw %1, %0" : "=r" (value) @@ -2918,7 +3014,9 @@ Atomic_ReadWrite16(Atomic_uint16 *var, // IN/OUT: uint16 val) // IN: { -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + return atomic_exchange((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "xchgw %0, %1" : "=r" (val), @@ -2981,7 +3079,9 @@ ASSERT((uintptr_t)var % 2 == 0); #endif -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + atomic_store((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "movw %1, %0" : "=m" (var->value) @@ -3022,7 +3122,11 @@ uint16 oldVal, // IN uint16 newVal) // IN { -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + atomic_compare_exchange_strong( + (_Atomic uint16 *)&var->value, &oldVal, newVal); + return oldVal; +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) uint16 val; __asm__ __volatile__( @@ -3087,7 +3191,9 @@ { uint16 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_and((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 16, TRUE, &var->value, and, val); #else do { @@ -3119,7 +3225,9 @@ Atomic_And16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_and((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "lock; andw %1, %0" : "+m" (var->value) @@ -3174,7 +3282,9 @@ Atomic_Or16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_or((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "lock; orw %1, %0" : "+m" (var->value) @@ -3229,7 +3339,9 @@ Atomic_Xor16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_xor((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "lock; xorw %1, %0" : "+m" (var->value) @@ -3284,7 +3396,9 @@ Atomic_Add16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_add((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "lock; addw %1, %0" : "+m" (var->value) @@ -3339,7 +3453,9 @@ Atomic_Sub16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + atomic_fetch_sub((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "lock; subw %1, %0" : "+m" (var->value) @@ -3460,7 +3576,9 @@ { uint16 res; -#if defined __GNUC__ && defined VM_ARM_64 +#if defined VM_ATOMIC_USE_C11 + res = atomic_fetch_or((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && defined VM_ARM_64 res = _VMATOM_X(ROP, 16, TRUE, &var->value, orr, val); #else do { @@ -3492,7 +3610,9 @@ Atomic_ReadAdd16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN: { -#if defined __GNUC__ && (defined __x86_64__ || defined __i386__) +#if defined VM_ATOMIC_USE_C11 + return atomic_fetch_add((_Atomic uint16 *)&var->value, val); +#elif defined __GNUC__ && (defined __x86_64__ || defined __i386__) __asm__ __volatile__( "lock; xaddw %0, %1" : "=r" (val), diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_asm_arm64.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_asm_arm64.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_asm_arm64.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_asm_arm64.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013-2022 VMware, Inc. All rights reserved. + * Copyright (C) 2013-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -659,131 +659,6 @@ } -#ifndef MUL64_NO_ASM -/* - *----------------------------------------------------------------------------- - * - * Mul64x6464 -- - * - * Unsigned integer by fixed point multiplication, with rounding: - * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) - * - * Unsigned 64-bit integer multiplicand. - * Unsigned 64-bit fixed point multiplier, represented as - * (multiplier, shift), where shift < 64. - * - * Result: - * Unsigned 64-bit integer product. - * - *----------------------------------------------------------------------------- - */ - -static INLINE uint64 -Mul64x6464(uint64 multiplicand, - uint64 multiplier, - uint32 shift) -{ - if (shift == 0) { - return multiplicand * multiplier; - } else { - uint64 lo, hi; - - asm("mul %0, %2, %3" "\n\t" - "umulh %1, %2, %3" - : "=&r" (lo), "=r" (hi) - : "r" (multiplicand), "r" (multiplier)); - return (hi << (64 - shift) | lo >> shift) + (lo >> (shift - 1) & 1); - } -} - - -/* - *----------------------------------------------------------------------------- - * - * Muls64x64s64 -- - * - * Signed integer by fixed point multiplication, with rounding: - * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) - * - * Signed 64-bit integer multiplicand. - * Unsigned 64-bit fixed point multiplier, represented as - * (multiplier, shift), where shift < 64. - * - * Result: - * Signed 64-bit integer product. - * - *----------------------------------------------------------------------------- - */ - -static INLINE int64 -Muls64x64s64(int64 multiplicand, - int64 multiplier, - uint32 shift) -{ - if (shift == 0) { - return multiplicand * multiplier; - } else { - uint64 lo, hi; - - asm("mul %0, %2, %3" "\n\t" - "smulh %1, %2, %3" - : "=&r" (lo), "=r" (hi) - : "r" (multiplicand), "r" (multiplier)); - return (hi << (64 - shift) | lo >> shift) + (lo >> (shift - 1) & 1); - } -} - - -/* - *----------------------------------------------------------------------------- - * - * Mul64x3264 -- - * - * Unsigned integer by fixed point multiplication, with rounding: - * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) - * - * Unsigned 64-bit integer multiplicand. - * Unsigned 32-bit fixed point multiplier, represented as - * (multiplier, shift), where shift < 64. - * - * Result: - * Unsigned 64-bit integer product. - * - *----------------------------------------------------------------------------- - */ - -static INLINE uint64 -Mul64x3264(uint64 multiplicand, uint32 multiplier, uint32 shift) -{ - return Mul64x6464(multiplicand, multiplier, shift); -} - - -/* - *----------------------------------------------------------------------------- - * - * Muls64x32s64 -- - * - * Signed integer by fixed point multiplication, with rounding: - * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) - * - * Signed 64-bit integer multiplicand. - * Unsigned 32-bit fixed point multiplier, represented as - * (multiplier, shift), where shift < 64. - * - * Result: - * Signed 64-bit integer product. - * - *----------------------------------------------------------------------------- - */ - -static INLINE int64 -Muls64x32s64(int64 multiplicand, uint32 multiplier, uint32 shift) -{ - return Muls64x64s64(multiplicand, multiplier, shift); -} -#endif - /* *----------------------------------------------------------------------------- * @@ -1000,6 +875,139 @@ #endif // ifndef _MSC_VER +#if defined _MSC_VER +/* Until we implement Mul64x6464() with Windows intrinsics... */ +#define MUL64_NO_ASM 1 +#endif + +#ifdef MUL64_NO_ASM +#include "mul64.h" +#else +/* + *----------------------------------------------------------------------------- + * + * Mul64x6464 -- + * + * Unsigned integer by fixed point multiplication, with rounding: + * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) + * + * Unsigned 64-bit integer multiplicand. + * Unsigned 64-bit fixed point multiplier, represented as + * (multiplier, shift), where shift < 64. + * + * Result: + * Unsigned 64-bit integer product. + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Mul64x6464(uint64 multiplicand, + uint64 multiplier, + uint32 shift) +{ + if (shift == 0) { + return multiplicand * multiplier; + } else { + uint64 lo, hi; + + asm("mul %0, %2, %3" "\n\t" + "umulh %1, %2, %3" + : "=&r" (lo), "=r" (hi) + : "r" (multiplicand), "r" (multiplier)); + return (hi << (64 - shift) | lo >> shift) + (lo >> (shift - 1) & 1); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * Muls64x64s64 -- + * + * Signed integer by fixed point multiplication, with rounding: + * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) + * + * Signed 64-bit integer multiplicand. + * Unsigned 64-bit fixed point multiplier, represented as + * (multiplier, shift), where shift < 64. + * + * Result: + * Signed 64-bit integer product. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int64 +Muls64x64s64(int64 multiplicand, + int64 multiplier, + uint32 shift) +{ + if (shift == 0) { + return multiplicand * multiplier; + } else { + uint64 lo, hi; + + asm("mul %0, %2, %3" "\n\t" + "smulh %1, %2, %3" + : "=&r" (lo), "=r" (hi) + : "r" (multiplicand), "r" (multiplier)); + return (hi << (64 - shift) | lo >> shift) + (lo >> (shift - 1) & 1); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * Mul64x3264 -- + * + * Unsigned integer by fixed point multiplication, with rounding: + * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) + * + * Unsigned 64-bit integer multiplicand. + * Unsigned 32-bit fixed point multiplier, represented as + * (multiplier, shift), where shift < 64. + * + * Result: + * Unsigned 64-bit integer product. + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Mul64x3264(uint64 multiplicand, uint32 multiplier, uint32 shift) +{ + return Mul64x6464(multiplicand, multiplier, shift); +} + + +/* + *----------------------------------------------------------------------------- + * + * Muls64x32s64 -- + * + * Signed integer by fixed point multiplication, with rounding: + * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) + * + * Signed 64-bit integer multiplicand. + * Unsigned 32-bit fixed point multiplier, represented as + * (multiplier, shift), where shift < 64. + * + * Result: + * Signed 64-bit integer product. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int64 +Muls64x32s64(int64 multiplicand, uint32 multiplier, uint32 shift) +{ + return Muls64x64s64(multiplicand, multiplier, shift); +} +#endif + + #if defined __cplusplus } // extern "C" #endif diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_asm.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_asm.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_asm.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_asm.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 2003-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2003-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -75,6 +75,12 @@ #include "mul64.h" #endif +#if defined _M_ARM64EC || defined _M_ARM64 +#include "vm_assert.h" +#define MUL64_NO_ASM 1 +#include "mul64.h" +#endif + #if defined __cplusplus extern "C" { #endif @@ -109,7 +115,7 @@ * mssb64 MSB set (uint64) 1..64 0 */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) // Clang defines _MSC_VER on Windows static INLINE int lssb32_0(const uint32 value) { @@ -1131,7 +1137,7 @@ // if out == 2^32 then out = 1 as it is right rotate : [in]"+r"(value),[out]"+r"(out)); return out; -#elif defined(VM_ARM_64) +#elif defined(VM_ARM_64) || defined(__wasm__) return RoundUpPow2C32(value); #else uint32 out = 2; diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_asm_x86_64.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_asm_x86_64.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_asm_x86_64.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_asm_x86_64.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2021 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -345,7 +345,7 @@ * constraints. * */ -#if defined(__GNUC__) && (defined(VMM) || defined(VMKERNEL) || defined(FROBOS)) +#if (defined(VMM) || defined(VMKERNEL) || defined(FROBOS) || defined(ULM)) static INLINE Bool xtest(void) { @@ -354,14 +354,18 @@ __asm__ __volatile__("xtest\n" "setnz %%al" : "=a" (result) : : "cc"); -#else +#elif defined(__GNUC__) __asm__ __volatile__("xtest" : "=@ccnz" (result) : : "cc"); +#elif defined (_WIN64) + result = _xtest(); +#else +#error No xtest implementation for this compiler. #endif return result; } -#endif /* __GNUC__ */ +#endif /* VMM || VMKERNEL || FROBOS || ULM */ /* *----------------------------------------------------------------------------- diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_asm_x86.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_asm_x86.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_asm_x86.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_asm_x86.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2021 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -71,7 +71,7 @@ * constraints. * */ -#if defined(__GNUC__) && (defined(VMM) || defined(VMKERNEL) || defined(FROBOS)) +#if (defined(VMM) || defined(VMKERNEL) || defined(FROBOS) || defined(ULM)) static INLINE Bool xtest(void) { @@ -80,14 +80,18 @@ __asm__ __volatile__("xtest\n" "setnz %%al" : "=a" (result) : : "cc"); -#else +#elif defined (__GNUC__) __asm__ __volatile__("xtest" : "=@ccnz" (result) : : "cc"); +#elif defined (_WIN32) + result = _xtest(); +#else +#error No xtest implementation for this compiler. #endif return result; } -#endif /* __GNUC__ */ +#endif /* VMM || VMKERNEL || FROBOS || ULM */ /* diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_defs.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_defs.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_defs.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_defs.h 2023-08-31 14:38:59.000000000 +0000 @@ -261,6 +261,8 @@ #define PAGE_SHIFT PAGE_SHIFT_4KB #elif defined __arm__ #define PAGE_SHIFT PAGE_SHIFT_4KB +#elif defined __wasm__ + #define PAGE_SHIFT PAGE_SHIFT_4KB #else #error #endif @@ -682,6 +684,12 @@ #define VMKERNEL_ONLY(x) #endif +#ifdef COMP_TEST +#define vmx86_test 1 +#else +#define vmx86_test 0 +#endif + /* * In MSVC, _WIN32 is defined as 1 when the compilation target is * 32-bit ARM, 64-bit ARM, x86, or x64 (which implies _WIN64). This diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_types.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_types.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_basic_types.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_basic_types.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -78,11 +78,11 @@ /* * Standardize MSVC arch macros to GCC arch macros. */ -#if defined _MSC_VER && defined _M_X64 +#if defined _MSC_VER && defined _M_X64 && !defined _M_ARM64EC # define __x86_64__ 1 #elif defined _MSC_VER && defined _M_IX86 # define __i386__ 1 -#elif defined _MSC_VER && defined _M_ARM64 +#elif defined _MSC_VER && (defined _M_ARM64 || defined _M_ARM64EC) # define __aarch64__ 1 #elif defined _MSC_VER && defined _M_ARM # define __arm__ 1 @@ -202,7 +202,7 @@ * - Linux userlevel uses 'long' uint64_t * - Windows uses 'long long' uint64_t */ -#if !defined(VMKERNEL) && !defined(DECODERLIB) && \ +#if !defined(VMKERNEL) && \ defined(__linux__) && defined(__KERNEL__) # include # include @@ -244,7 +244,7 @@ * - VMM does not have POSIX headers * - Windows does not define ssize_t */ -#if defined(VMKERNEL) || defined(VMM) || defined(DECODERLIB) +#if defined(VMKERNEL) || defined(VMM) /* Guard against FreeBSD collison. */ # if !defined(_SIZE_T_DEFINED) && !defined(_SIZE_T) # define _SIZE_T_DEFINED @@ -392,7 +392,7 @@ #define FMTPD "I" #define FMTH "I" #endif -#elif defined __APPLE__ || (!defined VMKERNEL && !defined DECODERLIB && \ +#elif defined __APPLE__ || (!defined VMKERNEL && \ defined __linux__ && defined __KERNEL__) /* semi-LLP64 targets; 'long' is 64-bit, but uint64_t is 'long long' */ #define FMT64 "ll" diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_device_version.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_device_version.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_device_version.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_device_version.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998,2005-2012,2014-2022 VMware, Inc. All rights reserved. + * Copyright (C) 1998,2005-2012,2014-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -72,6 +72,7 @@ #define PCI_DEVICE_ID_VMWARE_UHCI 0x0774 #define PCI_DEVICE_ID_VMWARE_XHCI_0096 0x0778 #define PCI_DEVICE_ID_VMWARE_XHCI_0100 0x0779 +#define PCI_DEVICE_ID_VMWARE_XHCI_0120 0x077A #define PCI_DEVICE_ID_VMWARE_1394 0x0780 #define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790 #define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0 @@ -359,6 +360,22 @@ #define NUM_SERIAL_PORTS 32 #define NUM_PARALLEL_PORTS 3 +/************* USB host controller limits ********************/ +#define USB_EHCI_MAX_CONTROLLERS 1 +#define USB_XHCI_MAX_CONTROLLERS 1 + +/* + * As per USB specification 127 devices can be connected. Along with user usb + * devices other types of devices like root hub, hub, keyboard, mouse are also + * present and are not expose directly to users. These other devices also + * occupy ports on USB. + * + * Although we have 20 devices limit for virtual usb mass storage on each + * controller we can't just put 20 here as we need to account for other devices + * which are necessary for functionality + * TODO: enforce 20 devices limit from hostd + */ +#define USB_MAX_DEVICES_PER_HOST_CTRL 127 /************* Strings for Host USB Driver *******************************/ #ifdef _WIN32 diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmfs.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmfs.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmfs.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmfs.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2003-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmGuestAppMonitorLib.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmGuestAppMonitorLib.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmGuestAppMonitorLib.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmGuestAppMonitorLib.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2016 VMware, Inc. All rights reserved. + * Copyright (c) 2009-2016 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmGuestLib.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmGuestLib.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmGuestLib.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmGuestLib.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2016,2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2003-2016,2019-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmk_exports.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmk_exports.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmk_exports.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmk_exports.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2009-2016,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -33,14 +33,23 @@ /* * vmk_exports.h -- * - * Macros for exporting symbols from vmkernel + * Macros for exporting symbols from vmkernel. */ #ifndef _VMK_EXPORTS_H #define _VMK_EXPORTS_H #ifdef VMKERNEL -#include "vm_basic_defs.h" +# include "vm_basic_defs.h" + +# define _VMK_KERNEL_EXPORT(string) asm( \ + ".pushsection .vmkexports, \"aS\", @progbits" "\n\t" \ + ".string \"" string "\"" "\n\t" \ + ".popsection" \ +) +#else +# define _VMK_KERNEL_EXPORT(string) +#endif /* * The following macros allow you to export symbols from vmkernel, @@ -69,39 +78,16 @@ * VMK_MODULE_NAMESPACE_REQUIRED("myns", "1") tag to see that symbol. */ -#define VMK_KERNEL_EXPORT_SEC ".vmkexports" - -#define VMK_KERNEL_EXPORT(symbol) \ - asm(".pushsection " VMK_KERNEL_EXPORT_SEC ",\"aS\", @progbits\n" \ - "\t.string \"" XSTR(symbol) "\" \n" "\t.popsection\n"); - -#define VMK_KERNEL_ALIAS(symbol, alias) \ - asm(".pushsection " VMK_KERNEL_EXPORT_SEC ",\"aS\", @progbits\n" \ - "\t.string \"" XSTR(symbol) "!" XSTR(alias) "\" \n" \ - "\t.popsection\n"); - -/* name@namespace:version */ -#define VMK_KERNEL_EXPORT_TO_NAMESPACE(symbol, namespace, version) \ - asm(".pushsection " VMK_KERNEL_EXPORT_SEC ",\"aS\", @progbits\n" \ - "\t.string \"" XSTR(symbol) "@" namespace ":" version "\" \n" \ - "\t.popsection\n"); - -/* name!alias@namespace:version */ -#define VMK_KERNEL_ALIAS_TO_NAMESPACE(symbol, alias, namespace, version) \ - asm(".pushsection " VMK_KERNEL_EXPORT_SEC ",\"aS\", @progbits\n" \ - "\t.string \"" XSTR(symbol) "!" XSTR(alias) "@" namespace ":" \ - version "\" \n\t.popsection\n"); +#define VMK_KERNEL_EXPORT(symbol) \ + _VMK_KERNEL_EXPORT(XSTR(symbol)) -#else /* ! defined VMKERNEL */ +#define VMK_KERNEL_ALIAS(symbol, alias) \ + _VMK_KERNEL_EXPORT(XSTR(symbol) "!" XSTR(alias)) -/* - * Empty definitions for kernel exports when built in non-kernel environments. - */ -#define VMK_KERNEL_EXPORT(_symbol) -#define VMK_KERNEL_ALIAS(symbol, alias) -#define VMK_KERNEL_EXPORT_TO_NAMESPACE(symbol, namespace, version) -#define VMK_KERNEL_ALIAS_TO_NAMESPACE(symbol, alias, namespace, version) +#define VMK_KERNEL_EXPORT_TO_NAMESPACE(symbol, namespace, version) \ + _VMK_KERNEL_EXPORT(XSTR(symbol) "@" namespace ":" version) -#endif /* defined VMKERNEL */ +#define VMK_KERNEL_ALIAS_TO_NAMESPACE(symbol, alias, namespace, version) \ + _VMK_KERNEL_EXPORT(XSTR(symbol) "!" XSTR(alias) "@" namespace ":" version) #endif /* _VMK_EXPORTS_H */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_legal.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_legal.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_legal.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_legal.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2023 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_product_versions.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_product_versions.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_product_versions.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_product_versions.h 2023-08-31 14:38:59.000000000 +0000 @@ -81,9 +81,9 @@ #define PRODUCT_VERSION 1,1,5,PRODUCT_BUILD_NUMBER_NUMERIC #elif defined(VMX86_VPX) /* this should be kept in sync with the corresponding vpx branch. */ - #define PRODUCT_VERSION 8,0,1,PRODUCT_BUILD_NUMBER_NUMERIC + #define PRODUCT_VERSION 8,0,2,PRODUCT_BUILD_NUMBER_NUMERIC #elif defined(VMX86_HORIZON_VIEW) - #define PRODUCT_VERSION 8,9,0,PRODUCT_BUILD_NUMBER_NUMERIC + #define PRODUCT_VERSION 8,11,0,PRODUCT_BUILD_NUMBER_NUMERIC // VMX86_DESKTOP must be last because it is the default and is always defined. #elif defined(VMX86_DESKTOP) // WORKSTATION_VERSION_NUMBER below has to match this @@ -184,7 +184,7 @@ */ #define ESX_VERSION_MAJOR "8" #define ESX_VERSION_MINOR "0" -#define ESX_VERSION_MAINT "1" // 0 = Pre-release/GA, 1 = Update 1 +#define ESX_VERSION_MAINT "2" // 0 = Pre-release/GA, 2 = Update 2 #define ESX_VERSION_UPDATE ESX_VERSION_MAINT // ESX's own update level #define ESX_VERSION ESX_VERSION_MAJOR "." ESX_VERSION_MINOR "." \ @@ -239,7 +239,7 @@ */ #define FUSION_VERSION "e.x.p" -#define VIM_VERSION "8.0.1" +#define VIM_VERSION "8.0.2" /* *For smooth version bump up for quaterly releases, we need to have a fallback *mechanism to previous version in all those components which perform version @@ -269,15 +269,15 @@ 6.0.0,\ 6.5.0" // Put VPX_VERSION first, because vpx/make/defs.mk doesn't check for suffix. -#define VPX_VERSION "8.0.1" +#define VPX_VERSION "8.0.2" #define VPX_VERSION_MAJOR "8" #define VPX_VERSION_MINOR "0" -#define VPX_VERSION_MAINT "1" +#define VPX_VERSION_MAINT "2" #define VPX_VERSION_PATCH "00000" #define VPX_VERSION_THIRD_PARTY VPX_VERSION_MAJOR VPX_VERSION_MINOR \ VPX_VERSION_MAINT //MARKER_FAST_REMOVE_START -#define VPX_VERSION_NUMERIC 8,0,1,PRODUCT_BUILD_NUMBER_NUMERIC +#define VPX_VERSION_NUMERIC 8,0,2,PRODUCT_BUILD_NUMBER_NUMERIC //MARKER_FAST_REMOVE_END //MARKER_FAST_UNCOMMENT_START //#define VPX_VERSION_NUMERIC gVpxVersionNumeric @@ -287,14 +287,14 @@ #define VPX_MIN_HOST_VERSION "6.7.0" #define MAX_SUPPORTED_VI_VERSION "6.6" //from ovfTool/src/supportedVersions.h -#define VCDB_CURRENT_SCHEMA_VERSION 801 // from PitCADatabase.h +#define VCDB_CURRENT_SCHEMA_VERSION 802 // from PitCADatabase.h #define VPX_RELEASE_UPDATE "0" /* 0 = Pre-release/GA, 1 = Update 1 */ #define VPX_RELEASE_PATCH "0" /* 0 = experimental */ #define VPX_RELEASE VPX_RELEASE_UPDATE "." VPX_RELEASE_PATCH /* expected database version for current release */ -#define VPXD_VDB_DB_VERSION_ID 801 +#define VPXD_VDB_DB_VERSION_ID 802 #define VPXD_VDB_DB_VERSION_VALUE "VirtualCenter Database 8.0" /* @@ -309,10 +309,10 @@ // Changing the version is required when CPD releases an update. #define VA_PATCH_VERSION "5100" -#define HORIZONOSOT_VERSION "1.2.2210" +#define HORIZONOSOT_VERSION "1.2.2303" #define HORIZONVMDS_VERSION "1.0.0" -#define INTEGRITY_VERSION "8.0.1" /* Should use VPX_VERSION? */ +#define INTEGRITY_VERSION "8.0.2" /* Should use VPX_VERSION? */ #define SVA_VERSION "1.0.0" #define SSO_VERSION "1.0.0" #define SDK_VERSION "4.1.0" @@ -339,10 +339,10 @@ //#define NETDUMP_FILE_VERSION gNetdumpFileVersion //MARKER_FAST_UNCOMMENT_END -#define VDDK_VERSION "8.0.1" +#define VDDK_VERSION "8.0.2" #define VDDK_VERSION_MAJOR 8 #define VDDK_VERSION_MINOR 0 -#define VDDK_VERSION_MAINT 1 +#define VDDK_VERSION_MAINT 2 //MARKER_FAST_REMOVE_START #define VDDK_FILE_VERSION VDDK_VERSION_MAJOR,VDDK_VERSION_MINOR,\ @@ -352,11 +352,11 @@ //#define VDDK_FILE_VERSION gVddkFileVersion //MARKER_FAST_UNCOMMENT_END -#define OVFTOOL_VERSION "4.6.0" +#define OVFTOOL_VERSION "4.6.2" #define VCSA_INSTALLER_VERSION "1.0.0" //MARKER_FAST_REMOVE_START -#define OVFTOOL_FILE_VERSION 4,6,0,PRODUCT_BUILD_NUMBER_NUMERIC +#define OVFTOOL_FILE_VERSION 4,6,2,PRODUCT_BUILD_NUMBER_NUMERIC //MARKER_FAST_REMOVE_END //MARKER_FAST_UNCOMMENT_START //#define OVFTOOL_FILE_VERSION gOvftoolFileVersion @@ -372,7 +372,7 @@ #define PRECHECK_VERSION "e.x.p" #define VHSESDK_VERSION "1.0.0" #define VIEWVC_VERSION "14.0.2" -#define WCP_VERSION "0.1.2" +#define WCP_VERSION "0.1.5" #define VSTATS_VERSION "0.0.1" #define XVP_VERSION "1.0.0" /* @@ -381,27 +381,27 @@ * SCons parsing code requires that each line have a version string, so we * can't just do something like #define RDESDK_VERSION VIEW_VERSION" */ -#define VIEW_CLIENT_VERSION "8.9.0" +#define VIEW_CLIENT_VERSION "8.11.0" #define VIEW_CLIENT_VERSION_NUMBER VIEW_CLIENT_VERSION -#define VIEW_VERSION "8.9.0" -#define RDE_RFT_ALL_VERSION "8.9.0" -#define RDE_RFT_REL_VERSION "8.9.0" -#define RDESDKREL_VERSION "8.9.0" -#define MKSVCHANDEV_VERSION "15.9.0" -#define TSMMRDEV_VERSION "8.9.0" -#define RDF_VERSION "8.9.0" -#define HORIZON_DAAS_AGENT_VERSION "22.5.0" -#define HORIZON_USB_AGENT_VERSION "11.9.0" -#define HORIZON_UPDATETOOL_VERSION "2.0.7" +#define VIEW_VERSION "8.11.0" +#define RDE_RFT_ALL_VERSION "8.11.0" +#define RDE_RFT_REL_VERSION "8.11.0" +#define RDESDKREL_VERSION "8.11.0" +#define MKSVCHANDEV_VERSION "15.11.0" +#define TSMMRDEV_VERSION "8.11.0" +#define RDF_VERSION "8.11.0" +#define HORIZON_DAAS_AGENT_VERSION "23.3.0" +#define HORIZON_USB_AGENT_VERSION "11.11.0" +#define HORIZON_UPDATETOOL_VERSION "2.0.8" #define MFW_VERSION "16.9.0" -#define HORIZONTOOL_VERSION "16.9.0" +#define HORIZONTOOL_VERSION "16.11.0" /* * This is the Horizon Marketing version which is shared between * Horizon Client, Agent and Server. It is set in the format of * YYMM of the targeted release date. */ -#define HORIZON_YYMM_VERSION "2303" +#define HORIZON_YYMM_VERSION "2309" #ifndef MAKESTR #define MAKESTR(x) #x @@ -528,7 +528,7 @@ # define PRODUCT_LICENSE_VERSION PRODUCT_FLEX_VERSION_STRING_FOR_LICENSE # elif defined(VMX86_VPX) # define PRODUCT_LICENSE_VERSION "8.0" -# define PRODUCT_LICENSE_FILE_VERSION "8.0.2.0" +# define PRODUCT_LICENSE_FILE_VERSION "8.0.3.0" # elif defined(VMX86_SDK) # define PRODUCT_LICENSE_VERSION "1.0" # elif defined(VMX86_P2V) @@ -546,7 +546,7 @@ # define PRODUCT_VERSION_STRING_FOR_LICENSE PRODUCT_LICENSE_VERSION #endif #define PRODUCT_ESX_LICENSE_VERSION "8.0" -#define PRODUCT_ESX_LICENSE_FILE_VERSION "8.0.2.0" +#define PRODUCT_ESX_LICENSE_FILE_VERSION "8.0.3.0" /* * The configuration file version string should be changed diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_tools_version.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_tools_version.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_tools_version.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_tools_version.h 2023-08-31 14:38:59.000000000 +0000 @@ -1750,9 +1750,16 @@ #define TOOLS_VERSION_BANDSAW_UPDATE1_V_MNR 2 #define TOOLS_VERSION_BANDSAW_UPDATE1_V_BASE 5 -#define TOOLS_VERSION_CURRENT TOOLS_VERSION_BANDSAW_UPDATE1 -#define TOOLS_VERSION_CURRENT_STR TOOLS_VERSION_TO_STR(TOOLS_VERSION_BANDSAW_UPDATE1) -#define TOOLS_VERSION_CURRENT_CSV TOOLS_VERSION_TO_CSV(TOOLS_VERSION_BANDSAW_UPDATE1) +#ifndef RC_INVOKED +#define TOOLS_VERSION_NEXT TOOLS_VERSION_TO_UINT(TOOLS_VERSION_NEXT_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_NEXT_V_MJR 12 +#define TOOLS_VERSION_NEXT_V_MNR 3 +#define TOOLS_VERSION_NEXT_V_BASE 0 + +#define TOOLS_VERSION_CURRENT TOOLS_VERSION_NEXT +#define TOOLS_VERSION_CURRENT_STR TOOLS_VERSION_TO_STR(TOOLS_VERSION_NEXT) +#define TOOLS_VERSION_CURRENT_CSV TOOLS_VERSION_TO_CSV(TOOLS_VERSION_NEXT) /* * The extended Tools version is the current Tools version with the diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_valgrind.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_valgrind.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vm_valgrind.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vm_valgrind.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2014, 2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2014, 2021-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2017,2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2017,2020-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -26,6 +26,7 @@ #ifndef _GUEST_CAPS_H_ #define _GUEST_CAPS_H_ +/* clang-format off */ /* * Guest capabilities. * The guest uses this enum to communicate whether a certain @@ -79,6 +80,7 @@ CAP_GUESTSTORE_UPGRADE = 34, // supports tools upgrade from GuestStore CAP_DEVICE_HELPER = 35, // supports tools device helper for Windows guests CAP_VMBACKUP_NVME = 36, // supports NVMe for vmbackup + CAP_HOST_VERIFIED_SAML_TOKEN = 37, // supports host verification of SAML tokens } GuestCapabilities; typedef struct { @@ -102,7 +104,6 @@ * If you change these strings, make sure you also change the * vmdb schema, since these strings are used as vmdb keys. */ -// clang-format off static GuestCapElem guestCapTable[] = { { UNITY_CAP_START_MENU, UNITY_CAP_VMDB_PATH, "startmenu" }, { UNITY_CAP_VIRTUAL_DESK, UNITY_CAP_VMDB_PATH, "virtualdesk" }, @@ -145,6 +146,7 @@ { CAP_GUESTSTORE_UPGRADE, NULL, NULL }, { CAP_DEVICE_HELPER, NULL, NULL }, { CAP_VMBACKUP_NVME, NULL, NULL }, + { CAP_HOST_VERIFIED_SAML_TOKEN, NULL, NULL }, }; // clang-format on diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/guestrpc/containerInfo.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/guestrpc/containerInfo.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/guestrpc/containerInfo.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/guestrpc/containerInfo.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/guestrpc/tclodefs.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/guestrpc/tclodefs.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/guestrpc/tclodefs.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/guestrpc/tclodefs.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2009-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/gdp.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/gdp.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/gdp.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/gdp.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/guestStoreClientLib.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/guestStoreClientLib.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/guestStoreClientLib.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/guestStoreClientLib.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2019-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/guestStore.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/guestStore.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/guestStore.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/guestStore.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020 VMware, Inc. All rights reserved. + * Copyright (c) 2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/log.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/log.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/log.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/log.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/plugin.h open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/plugin.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/vmware/tools/plugin.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/vmware/tools/plugin.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/x86_basic_defs.h open-vm-tools-12.3.0/open-vm-tools/lib/include/x86_basic_defs.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/x86_basic_defs.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/x86_basic_defs.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2021 VMware, Inc. All rights reserved. + * Copyright (C) 2006-2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -275,4 +275,8 @@ #define BNDCFG_RSVD 0x00000ffc #define BNDCFG_BDBASE CONST64U(0xfffffffffffff000) +/* Reset state of RIP. */ +#define RESET_RIP 0xfff0 +#define RESET_RIP_TDX 0xfffffff0 /* Reset RIP for TDX protected mode boot. */ + #endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/include/x86cpuid.h open-vm-tools-12.3.0/open-vm-tools/lib/include/x86cpuid.h --- open-vm-tools-12.2.5/open-vm-tools/lib/include/x86cpuid.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/include/x86cpuid.h 2023-08-31 14:38:59.000000000 +0000 @@ -189,7 +189,7 @@ CPUIDLEVEL(FALSE, 81D, 0x8000001d, 5, 0) \ CPUIDLEVEL(FALSE, 81E, 0x8000001e, 0, 0) \ CPUIDLEVEL(TRUE, 81F, 0x8000001f, 0, 14) \ - CPUIDLEVEL(TRUE, 820, 0x80000020, 2, 17) \ + CPUIDLEVEL(TRUE, 820, 0x80000020, 4, 17) \ CPUIDLEVEL(TRUE, 821, 0x80000021, 0, 17) \ CPUIDLEVEL(TRUE, 822, 0x80000022, 0, 20) \ CPUIDLEVEL(TRUE, 823, 0x80000023, 0, 20) \ @@ -566,7 +566,7 @@ FLAG( 7, 0, ECX, 25, 1, CLDEMOTE, YES, 18 ) \ FLAG( 7, 0, ECX, 27, 1, MOVDIRI, YES, 18 ) \ FLAG( 7, 0, ECX, 28, 1, MOVDIR64B, YES, 18 ) \ -FLAG( 7, 0, ECX, 29, 1, ENQCMD, NO, 0 ) \ +FLAG( 7, 0, ECX, 29, 1, ENQCMD, YES, FUT ) \ FLAG( 7, 0, ECX, 30, 1, SGX_LC, ANY, 17 ) \ FLAG( 7, 0, ECX, 31, 1, PKS, YES, 20 ) \ FLAG( 7, 0, EDX, 1, 1, SGK_KEYS, NO, 0 ) \ @@ -581,7 +581,7 @@ FLAG( 7, 0, EDX, 13, 1, RTM_FORCE_ABORT, NO, 0 ) \ FLAG( 7, 0, EDX, 14, 1, SERIALIZE, YES, 20 ) \ FLAG( 7, 0, EDX, 15, 1, HYBRID, NO, 0 ) \ -FLAG( 7, 0, EDX, 16, 1, TSXLDTRK, NO, 0 ) \ +FLAG( 7, 0, EDX, 16, 1, TSXLDTRK, YES, 21 ) \ FLAG( 7, 0, EDX, 18, 1, PCONFIG, NO, 0 ) \ FLAG( 7, 0, EDX, 19, 1, ARCH_LBR, YES, 20 ) \ FLAG( 7, 0, EDX, 20, 1, CET_IBT, YES, 20 ) \ @@ -605,7 +605,7 @@ FLAG( 7, 1, EAX, 11, 1, FAST_SHORT_STOSB, YES, 20 ) \ FLAG( 7, 1, EAX, 12, 1, FAST_SHORT_CMPSB_SCASB, YES, 20 ) \ FLAG( 7, 1, EAX, 19, 1, WRMSRNS, NO, 0 ) \ -FLAG( 7, 1, EAX, 21, 1, AMX_FP16, NO, 0 ) \ +FLAG( 7, 1, EAX, 21, 1, AMX_FP16, YES, 21 ) \ FLAG( 7, 1, EAX, 22, 1, HRESET, NO, 0 ) \ FLAG( 7, 1, EAX, 23, 1, AVX_IFMA, NO, 0 ) \ FLAG( 7, 1, EAX, 26, 1, LAM, NO, 0 ) \ @@ -613,14 +613,16 @@ FLAG( 7, 1, EBX, 0, 1, LEAF7_PPIN, NO, 0 ) \ FLAG( 7, 1, EDX, 4, 1, AVX_VNNI_INT8, NO, 0 ) \ FLAG( 7, 1, EDX, 5, 1, AVX_NE_CONVERT, NO, 0 ) \ -FLAG( 7, 1, EDX, 14, 1, PREFETCHI, NO, 0 ) \ +FLAG( 7, 1, EDX, 8, 1, AMX_COMPLEX, NO, 0 ) \ +FLAG( 7, 1, EDX, 14, 1, PREFETCHI, YES, 21 ) \ FLAG( 7, 1, EDX, 18, 1, CET_SSS, NO, 0 ) \ FLAG( 7, 2, EDX, 0, 1, PSFD, YES, 20 ) \ -FLAG( 7, 2, EDX, 1, 1, IPRED_CTRL, NO, 0 ) \ -FLAG( 7, 2, EDX, 2, 1, RRSBA_CTRL, NO, 0 ) \ -FLAG( 7, 2, EDX, 3, 1, DDPD_U, NO, 0 ) \ -FLAG( 7, 2, EDX, 4, 1, BHI_CTRL, NO, 0 ) \ -FLAG( 7, 2, EDX, 5, 1, MCDT_NO, NO, 0 ) +FLAG( 7, 2, EDX, 1, 1, IPRED_CTRL, YES, 21 ) \ +FLAG( 7, 2, EDX, 2, 1, RRSBA_CTRL, YES, 21 ) \ +FLAG( 7, 2, EDX, 3, 1, DDPD_U, YES, 21 ) \ +FLAG( 7, 2, EDX, 4, 1, BHI_CTRL, YES, 21 ) \ +FLAG( 7, 2, EDX, 5, 1, MCDT_NO, NO, 0 ) \ +FLAG( 7, 2, EDX, 6, 1, UC_LOCK_DISABLE, NO, 0 ) /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_9 \ @@ -681,7 +683,7 @@ FLAG( D, 1, EAX, 4, 1, XFD, YES, 20 ) \ FIELD( D, 1, EBX, 0, 32, XSAVES_ENABLED_SIZE, ANY, 13 ) \ FLAG( D, 1, ECX, 8, 1, XSS_MASTER_PT, NO, 0 ) \ -FLAG( D, 1, ECX, 10, 1, XSS_MASTER_PASID, NO, 0 ) \ +FLAG( D, 1, ECX, 10, 1, XSS_MASTER_PASID, YES, FUT ) \ FLAG( D, 1, ECX, 11, 1, XSS_MASTER_CET_U, YES, 20 ) \ FLAG( D, 1, ECX, 12, 1, XSS_MASTER_CET_S, YES, 20 ) \ FLAG( D, 1, ECX, 13, 1, XSS_MASTER_HDC, NO, 0 ) \ @@ -728,10 +730,10 @@ FLAG( D, 9, ECX, 0, 1, XSAVE_PKRU_SUP_BY_XSS, NO, 0 ) \ FLAG( D, 9, ECX, 1, 1, XSAVE_PKRU_ALIGN, YES, 13 ) \ FLAG( D, 9, ECX, 2, 1, XSAVE_PKRU_XFD, NO, 0 ) \ -FIELD( D, 10, EAX, 0, 32, XSAVES_PASID_STATE_SIZE, NO, 0 ) \ -FLAG( D, 10, ECX, 0, 1, XSAVES_PASID_STATE_SUP_BY_XSS, NO, 0 ) \ -FLAG( D, 10, ECX, 1, 1, XSAVES_PASID_STATE_ALIGN, NO, 0 ) \ -FLAG( D, 10, ECX, 2, 1, XSAVES_PASID_STATE_XFD, NO, 0 ) \ +FIELD( D, 10, EAX, 0, 32, XSAVES_PASID_STATE_SIZE, YES, FUT ) \ +FLAG( D, 10, ECX, 0, 1, XSAVES_PASID_STATE_SUP_BY_XSS, YES, FUT ) \ +FLAG( D, 10, ECX, 1, 1, XSAVES_PASID_STATE_ALIGN, YES, FUT ) \ +FLAG( D, 10, ECX, 2, 1, XSAVES_PASID_STATE_XFD, YES, FUT ) \ FIELD( D, 11, EAX, 0, 32, XSAVES_CET_U_SIZE, YES, 20 ) \ FLAG( D, 11, ECX, 0, 1, XSAVES_CET_U_SUP_BY_XSS, YES, 20 ) \ FLAG( D, 11, ECX, 1, 1, XSAVES_CET_U_ALIGN, YES, 20 ) \ @@ -796,9 +798,10 @@ /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_12 \ FLAG( 12, 0, EAX, 0, 1, SGX1, ANY, 17 ) \ -FLAG( 12, 0, EAX, 1, 1, SGX2, ANY, FUT ) \ -FLAG( 12, 0, EAX, 5, 1, SGX_OVERSUB_ENCLV, ANY, FUT ) \ -FLAG( 12, 0, EAX, 6, 1, SGX_OVERSUB_ENCLS, ANY, FUT ) \ +FLAG( 12, 0, EAX, 1, 1, SGX2, ANY, 21 ) \ +FLAG( 12, 0, EAX, 5, 1, SGX_OVERSUB_ENCLV, NO, 0 ) \ +FLAG( 12, 0, EAX, 6, 1, SGX_OVERSUB_ENCLS, NO, 0 ) \ +FLAG( 12, 0, EAX, 7, 1, SGX_EVERIFYREPORT2, NO, 0 ) \ FLAG( 12, 0, EAX, 10, 1, SGX_EUPDATESVN, NO, 0 ) \ FLAG( 12, 0, EBX, 0, 1, SGX_MISCSELECT_EXINFO, ANY, FUT ) \ FIELD( 12, 0, EBX, 1, 31, SGX_MISCSELECT_RSVD, NO, 0 ) \ @@ -924,20 +927,24 @@ FLAG( 1C, 0, ECX, 0, 1, LBR_MISPREDICT, YES, 20 ) \ FLAG( 1C, 0, ECX, 1, 1, LBR_TIMED_LBRS, YES, 20 ) \ FLAG( 1C, 0, ECX, 2, 1, LBR_BRANCH_TYPE, YES, 20 ) \ +FLAG( 1C, 0, ECX, 16, 1, LBR_EVENT_LOGGING_PMC0, NO, 0 ) \ +FLAG( 1C, 0, ECX, 17, 1, LBR_EVENT_LOGGING_PMC1, NO, 0 ) \ +FLAG( 1C, 0, ECX, 18, 1, LBR_EVENT_LOGGING_PMC2, NO, 0 ) \ +FLAG( 1C, 0, ECX, 19, 1, LBR_EVENT_LOGGING_PMC3, NO, 0 ) /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_1D \ -FIELD( 1D, 0, EAX, 0, 32, TILE_PALETTE_MAX, YES, 20 ) \ -FIELD( 1D, 1, EAX, 0, 16, TILE_PALETTE1_TOTAL_BYTES, YES, 20 ) \ -FIELD( 1D, 1, EAX, 16, 16, TILE_PALETTE1_BYTES_PER_TILE, YES, 20 ) \ -FIELD( 1D, 1, EBX, 0, 16, TILE_PALETTE1_BYTES_PER_ROW, YES, 20 ) \ -FIELD( 1D, 1, EBX, 16, 16, TILE_PALETTE1_NUM_REGS, YES, 20 ) \ -FIELD( 1D, 1, ECX, 0, 16, TILE_PALETTE1_MAX_ROWS, YES, 20 ) +FIELD( 1D, 0, EAX, 0, 32, TILE_PALETTE_MAX, YES, 20 ) \ +FIELD( 1D, 1, EAX, 0, 16, TILE_PALETTE1_TOTAL_BYTES, YES, 20 ) \ +FIELD( 1D, 1, EAX, 16, 16, TILE_PALETTE1_BYTES_PER_TILE, YES, 20 ) \ +FIELD( 1D, 1, EBX, 0, 16, TILE_PALETTE1_BYTES_PER_ROW, YES, 20 ) \ +FIELD( 1D, 1, EBX, 16, 16, TILE_PALETTE1_NUM_REGS, YES, 20 ) \ +FIELD( 1D, 1, ECX, 0, 16, TILE_PALETTE1_MAX_ROWS, YES, 20 ) /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_1E \ -FIELD( 1E, 0, EBX, 0, 8, TMUL_MAX_K, YES, 20 ) \ -FIELD( 1E, 0, EBX, 8, 16, TMUL_MAX_N, YES, 20 ) +FIELD( 1E, 0, EBX, 0, 8, TMUL_MAX_K, YES, 20 ) \ +FIELD( 1E, 0, EBX, 8, 16, TMUL_MAX_N, YES, 20 ) /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_1F \ @@ -962,6 +969,8 @@ /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_23 \ FIELD( 23, 0, EAX, 0, 32, ARCH_PMC_MAX_SUBLEAF, NO, 0 ) \ +FLAG( 23, 0, EBX, 0, 1, ARCH_PMC_UNITMASK2, NO, 0 ) \ +FLAG( 23, 0, EBX, 1, 1, ARCH_PMC_ZBIT, NO, 0 ) \ FIELD( 23, 1, EAX, 0, 32, ARCH_PMC_GEN_BITMAP, NO, 0 ) \ FIELD( 23, 1, EBX, 0, 32, ARCH_PMC_FIXED_BITMAP, NO, 0 ) \ FLAG( 23, 3, EAX, 0, 1, ARCH_PMC_CORE_CYCLES, NO, 0 ) \ @@ -1101,7 +1110,7 @@ FIELD( 81, 0, EAX, 16, 4, LEAF81_EXTENDED_MODEL, ANY, 4 ) \ FIELD( 81, 0, EAX, 20, 8, LEAF81_EXTENDED_FAMILY, ANY, 4 ) \ FIELD( 81, 0, EBX, 0, 16, LEAF81_BRAND_ID, ANY, 4 ) \ -FIELD( 81, 0, EBX, 16, 16, UNDEF, ANY, 4 ) \ +FIELD( 81, 0, EBX, 28, 4, LEAF81_PKG_TYPE, ANY, 4 ) \ FLAG( 81, 0, ECX, 0, 1, LAHF64, YES, 4 ) \ FLAG( 81, 0, ECX, 1, 1, CMPLEGACY, ANY, 9 ) \ FLAG( 81, 0, ECX, 2, 1, SVM, YES, 8 ) \ @@ -1238,7 +1247,8 @@ FLAG( 87, 0, EDX, 11, 1, PROC_FEEDBACK_INTERFACE, NA, 0 ) \ FLAG( 87, 0, EDX, 12, 1, PROC_POWER_REPORTING, NA, 0 ) \ FLAG( 87, 0, EDX, 13, 1, CONNECTED_STANDBY, NA, 0 ) \ -FLAG( 87, 0, EDX, 14, 1, RAPL, NA, 0 ) +FLAG( 87, 0, EDX, 14, 1, RAPL, NA, 0 ) \ +FLAG( 87, 0, EDX, 15, 1, FAST_CPPC, NA, 0 ) /* LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_88 \ @@ -1267,6 +1277,7 @@ FLAG( 88, 0, EBX, 24, 1, LEAF88_SSBD_SPEC_CTRL, YES, 20 ) \ FLAG( 88, 0, EBX, 25, 1, LEAF88_SSBD_VIRT_SPEC_CTRL, NO, 0 ) \ FLAG( 88, 0, EBX, 26, 1, LEAF88_SSBD_NOT_NEEDED, NO, 0 ) \ +FLAG( 88, 0, EBX, 27, 1, CPPC, NO, 0 ) \ FLAG( 88, 0, EBX, 28, 1, LEAF88_PSFD, YES, 20 ) \ FLAG( 88, 0, EBX, 29, 1, BTC_NO, NO, 0 ) \ FIELD( 88, 0, ECX, 0, 8, LEAF88_CORE_COUNT, YES, 4 ) \ @@ -1307,9 +1318,13 @@ FLAG( 8A, 0, EDX, 18, 1, SVMEDX_RSVD3, NO, 0 ) \ FLAG( 8A, 0, EDX, 19, 1, SVM_SSS, YES, 20 ) \ FLAG( 8A, 0, EDX, 20, 1, SVM_GUEST_SPEC_CTRL, NO, 0 ) \ -FIELD( 8A, 0, EDX, 21, 3, SVMEDX_RSVD4, NO, 0 ) \ +FLAG( 8A, 0, EDX, 21, 1, SVM_NON_WRITEABLE_PT, NO, 0 ) \ +FLAG( 8A, 0, EDX, 23, 1, SVM_HOST_MCE_OVERRIDE, NO, 0 ) \ FLAG( 8A, 0, EDX, 24, 1, SVM_TLB_CTL, NO, 0 ) \ -FIELD( 8A, 0, EDX, 25, 7, SVMEDX_RSVD5, NO, 0 ) +FLAG( 8A, 0, EDX, 25, 1, SVM_NMI_VIRT, NO, 0 ) \ +FLAG( 8A, 0, EDX, 26, 1, SVM_IBS_VIRT, NO, 0 ) \ +FLAG( 8A, 0, EDX, 27, 1, SVM_EXTLVT_OFFSET_FAULT, NO, 0 ) \ +FLAG( 8A, 0, EDX, 28, 1, SVM_VMCB_ADDR_CHK, NO, 0 ) /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_819 \ @@ -1340,7 +1355,8 @@ FLAG( 81B, 0, EAX, 7, 1, RIP_INVALID_CHECK, NA, 0 ) \ FLAG( 81B, 0, EAX, 8, 1, OP_BRN_FUSE, NA, 0 ) \ FLAG( 81B, 0, EAX, 9, 1, IBS_FETCH_CTL_EXTD, NA, 0 ) \ -FLAG( 81B, 0, EAX, 10, 1, IBS_OP_DATA4, NA, 0 ) +FLAG( 81B, 0, EAX, 10, 1, IBS_OP_DATA4, NA, 0 ) \ +FLAG( 81B, 0, EAX, 11, 1, IBS_FETCH_OP, NA, 0 ) /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_81C \ @@ -1408,6 +1424,9 @@ FLAG( 81F, 0, EAX, 3, 1, SEV_ES, YES, 17 ) \ FLAG( 81F, 0, EAX, 4, 1, SEV_SNP, NO, 0 ) \ FLAG( 81F, 0, EAX, 5, 1, VMPL, NO, 0 ) \ +FLAG( 81F, 0, EAX, 6, 1, RMPQUERY, NO, 0 ) \ +FLAG( 81F, 0, EAX, 7, 1, VMPL_SSS, NO, 0 ) \ +FLAG( 81F, 0, EAX, 8, 1, SECURE_TSC, NO, 0 ) \ FLAG( 81F, 0, EAX, 9, 1, TSC_AUX_VIRT, YES, 20 ) \ FLAG( 81F, 0, EAX, 10, 1, SEV_HEC, NO, 0 ) \ FLAG( 81F, 0, EAX, 11, 1, SEV_64BIT_REQ, NO, 0 ) \ @@ -1415,6 +1434,11 @@ FLAG( 81F, 0, EAX, 13, 1, SEV_ALT_INJECTION, NO, 0 ) \ FLAG( 81F, 0, EAX, 14, 1, SEV_DEBUG_SWAP, NO, 0 ) \ FLAG( 81F, 0, EAX, 15, 1, SEV_NO_HOST_IBS, NO, 0 ) \ +FLAG( 81F, 0, EAX, 16, 1, SEV_VTE, NO, 0 ) \ +FLAG( 81F, 0, EAX, 17, 1, VMGEXIT_PARAMETER, NO, 0 ) \ +FLAG( 81F, 0, EAX, 18, 1, VIRTUAL_MSR_TOM, NO, 0 ) \ +FLAG( 81F, 0, EAX, 19, 1, SEV_IBS_VIRT, NO, 0 ) \ +FLAG( 81F, 0, EAX, 24, 1, VMSA_REG_PROT, NO, 0 ) \ FIELD(81F, 0, EBX, 0, 6, SME_PAGE_TABLE_BIT_NUM, YES, 17 ) \ FIELD(81F, 0, EBX, 6, 6, SME_PHYS_ADDR_SPACE_REDUCTION, NO, 0 ) \ FIELD(81F, 0, EBX, 12, 4, NUM_VMPL, NO, 0 ) \ @@ -1424,17 +1448,68 @@ /* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_820 \ FLAG( 820, 0, EBX, 1, 1, LEAF820_MBE, NO, 0 ) \ +FLAG( 820, 0, EBX, 2, 1, LEAF820_SMBE, NO, 0 ) \ +FLAG( 820, 0, EBX, 3, 1, LEAF820_EVT_CFG, NO, 0 ) \ +FLAG( 820, 0, EBX, 4, 1, LEAF820_L3RR, NO, 0 ) \ FIELD(820, 1, EAX, 0, 32, CAPACITY_MASK_LEN, NO, 0 ) \ -FIELD(820, 1, EDX, 0, 32, NUM_SERVICE_CLASSES, NO, 0 ) +FIELD(820, 1, EDX, 0, 32, NUM_SERVICE_CLASSES, NO, 0 ) \ +FIELD(820, 2, EAX, 0, 32, SMBE_LENGTH, NO, 0 ) \ +FIELD(820, 2, EDX, 0, 32, COS_MAX, NO, 0 ) \ +FIELD(820, 3, EBX, 0, 8, NUM_BANDWIDTH_EVENTS, NO, 0 ) \ +FLAG( 820, 3, ECX, 0, 1, L3_CACHE_LCL_BW_FILL, NO, 0 ) \ +FLAG( 820, 3, ECX, 1, 1, L3_CACHE_RMT_BW_FILL, NO, 0 ) \ +FLAG( 820, 3, ECX, 2, 1, L3_CACHE_LCL_BW_NT_WRITE, NO, 0 ) \ +FLAG( 820, 3, ECX, 3, 1, L3_CACHE_RMT_BW_NT_WRITE, NO, 0 ) \ +FLAG( 820, 3, ECX, 4, 1, L3_CACHE_LCL_SLOW_BW_FILL, NO, 0 ) \ +FLAG( 820, 3, ECX, 5, 1, L3_CACHE_RMT_SLOW_BW_FILL, NO, 0 ) \ +FLAG( 820, 3, ECX, 6, 1, L3_CACHE_BW_VIC, NO, 0 ) +/* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ #define CPUID_FIELD_DATA_LEVEL_821 \ -FLAG( 821, 0, EAX, 7, 1, UPPER_ADDRESS_IGNORE, YES, 20 ) - -#define CPUID_FIELD_DATA_LEVEL_822 - -#define CPUID_FIELD_DATA_LEVEL_823 - -#define CPUID_FIELD_DATA_LEVEL_826 +FLAG( 821, 0, EAX, 0, 1, NO_NESTED_DATA_BP, NO, 0 ) \ +FLAG( 821, 0, EAX, 1, 1, NON_SERIALIZING_FSGSBASE, NO, 0 ) \ +FLAG( 821, 0, EAX, 2, 1, ALWAYS_SERIALIZING_LFENCE, YES, 19 ) \ +FLAG( 821, 0, EAX, 3, 1, SMM_PGCFG_LOCK, NO, 0 ) \ +FLAG( 821, 0, EAX, 6, 1, NULL_SELECTOR_CLEARS_BASE, NO, 0 ) \ +FLAG( 821, 0, EAX, 7, 1, UPPER_ADDRESS_IGNORE, YES, 20 ) \ +FLAG( 821, 0, EAX, 8, 1, AUTOMATIC_IBRS, YES, 20 ) \ +FLAG( 821, 0, EAX, 9, 1, NO_SMMCTL_MSR, NO, 0 ) \ +FLAG( 821, 0, EAX, 10, 1, AMD_FAST_SHORT_STOSB, YES, 20 ) \ +FLAG( 821, 0, EAX, 11, 1, AMD_FAST_SHORT_CMPSB, YES, 20 ) \ +FLAG( 821, 0, EAX, 13, 1, PREFETCHCTL_MSR, NO, 0 ) \ +FLAG( 821, 0, EAX, 17, 1, CPL3_CPUID_GP, NO, 0 ) \ +FLAG( 821, 0, EAX, 18, 1, EPSF, NO, 0 ) \ +FIELD(821, 0, EBX, 0, 12, MICROCODE_PATCH_SIZE, NO, 0 ) + +/* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ +#define CPUID_FIELD_DATA_LEVEL_822 \ +FLAG( 822, 0, EAX, 0, 1, AMD_PERFMON_V2, NO, 0 ) \ +FLAG( 822, 0, EAX, 1, 1, AMD_LBREXT_V2, NO, 0 ) \ +FLAG( 822, 0, EAX, 2, 1, AMD_LBR_PMC_FREEZE, NO, 0 ) \ +FIELD(822, 0, EBX, 0, 4, AMD_NUM_CORE_PMC, NO, 0 ) \ +FIELD(822, 0, EBX, 4, 6, AMD_LBR_STACK_SIZE, NO, 0 ) \ +FIELD(822, 0, EBX, 10, 6, AMD_NUM_DF_PMC, NO, 0 ) \ +FIELD(822, 0, EBX, 16, 6, AMD_NUM_UMC_PMC, NO, 0 ) \ +FIELD(822, 0, ECX, 0, 32, AMD_ACTIVE_UMC_PMC_MASK, NO, 0 ) + +/* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ +#define CPUID_FIELD_DATA_LEVEL_823 \ +FLAG( 823, 0, EAX, 0, 1, MEM_HMK, NO, 0 ) \ +FIELD(823, 0, EBX, 0, 16, MEM_HMK_MAX_ENCR_KEYID, NO, 0 ) + +/* LEVEL, SUB-LEVEL, REG, POS, SIZE, NAME, MON SUPP, HWV */ +#define CPUID_FIELD_DATA_LEVEL_826 \ +FIELD(826, 0, EAX, 0, 5, AMD_TOPOLOGY_MASK_WIDTH, NA, 0 ) \ +FLAG( 826, 0, EAX, 29, 1, AMD_TOPOLOGY_EFFICIENCY_RANK, NA, 0 ) \ +FLAG( 826, 0, EAX, 30, 1, AMD_TOPOLOGY_HETEROGENEOUS_CORES, NA, 0 ) \ +FLAG( 826, 0, EAX, 31, 1, AMD_TOPOLOGY_ASYMMETRIC_CORES, NA, 0 ) \ +FIELD(826, 0, EBX, 0, 16, AMD_TOPOLOGY_CPUS_SHARING_LEVEL, NA, 0 ) \ +FIELD(826, 0, EBX, 16, 8, AMD_TOPOLOGY_POWER_RANKING, NA, 0 ) \ +FIELD(826, 0, EBX, 24, 4, AMD_TOPOLOGY_NATIVE_MODEL_ID, NA, 0 ) \ +FIELD(826, 0, EBX, 28, 4, AMD_TOPOLOGY_CORE_TYPE, NA, 0 ) \ +FIELD(826, 0, ECX, 0, 8, AMD_TOPOLOGY_LEVEL_NUMBER, NA, 0 ) \ +FIELD(826, 0, ECX, 8, 8, AMD_TOPOLOGY_LEVEL_TYPE, NA, 0 ) \ +FIELD(826, 0, EDX, 0, 32, AMD_TOPOLOGY_EXT_APIC_ID, NA, 0 ) #define CPUID_FIELD_DATA \ CPUID_FIELD_DATA_LEVEL_0 \ @@ -1734,8 +1809,10 @@ #define CPUID_MODEL_ICELAKE_7E 0x7e // Ice Lake U/Y #define CPUID_MODEL_ICELAKE_6A 0x6a // Ice Lake SP (ICX) #define CPUID_MODEL_ICELAKE_6C 0x6c // Ice Lake D +#define CPUID_MODEL_LAKEFIELD_8A 0x8a // Lakefield #define CPUID_MODEL_TIGERLAKE_8C 0x8c // Tiger Lake UP3/UP4/H35 #define CPUID_MODEL_TIGERLAKE_8D 0x8d // Tiger Lake H81 +#define CPUID_MODEL_SAPPHIRERAPIDS_8F 0x8f // Sapphire Rapids #define CPUID_MODEL_KNM_85 0x85 // Knights Mill #define CPUID_MODEL_KABYLAKE_8E 0x8e // Kaby Lake U/Y QS #define CPUID_MODEL_ALDERLAKE_97 0x97 // Alder Lake-S @@ -1744,6 +1821,9 @@ #define CPUID_MODEL_COMETLAKE_A5 0xa5 // Comet Lake S #define CPUID_MODEL_COMETLAKE_A6 0xa6 // Comet Lake U #define CPUID_MODEL_ROCKETLAKE_A7 0xa7 // Rocket Lake S +#define CPUID_MODEL_RAPTORLAKE_B7 0xb7 // Raptor Lake S/HX B-0 +#define CPUID_MODEL_RAPTORLAKE_BA 0xba // Raptor Lake H/P/PX J-0, U Q-0 +#define CPUID_MODEL_RAPTORLAKE_BF 0xbf // Raptor Lake S/HX C-0 /* Intel stepping information */ #define CPUID_STEPPING_KABYLAKE_ES 0x8 // Kaby Lake S/H/U/Y ES @@ -2144,6 +2224,34 @@ CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_ALDERLAKE_9A); } +static INLINE Bool +CPUID_MODEL_IS_RAPTORLAKE(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_FAMILY_IS_P6(v) && + (CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_RAPTORLAKE_B7 || + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_RAPTORLAKE_BF || + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_RAPTORLAKE_BA); +} + + +static INLINE Bool +CPUID_MODEL_IS_SAPPHIRERAPIDS(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_FAMILY_IS_P6(v) && + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_SAPPHIRERAPIDS_8F; +} + +static INLINE Bool +CPUID_UARCH_IS_SAPPHIRERAPIDS(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_MODEL_IS_SAPPHIRERAPIDS(v) || + CPUID_MODEL_IS_ALDERLAKE(v) || + CPUID_MODEL_IS_RAPTORLAKE(v); +} + static INLINE Bool CPUID_UARCH_IS_HASWELL(uint32 v) // IN: %eax from CPUID with %eax=1. diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/Makefile.am open-vm-tools-12.3.0/open-vm-tools/lib/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/lib/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2007-2016,2020-2022 VMware, Inc. All rights reserved. +### Copyright (c) 2007-2016,2020-2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -17,9 +17,6 @@ SUBDIRS = SUBDIRS += guestRpc -if HAVE_X11 - SUBDIRS += appUtil -endif SUBDIRS += auth SUBDIRS += backdoor if HAVE_VSOCK diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/misc/codesetOld.c open-vm-tools-12.3.0/open-vm-tools/lib/misc/codesetOld.c --- open-vm-tools-12.2.5/open-vm-tools/lib/misc/codesetOld.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/misc/codesetOld.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2017,2019,2021,2022 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2017,2019,2021-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -646,7 +646,7 @@ { char *codeset; -#if defined(__linux__) +#if defined(__linux__) || defined(__EMSCRIPTEN__) locale_t new = newlocale(LC_CTYPE_MASK, "", NULL); if (!new) { @@ -656,9 +656,9 @@ * locale. */ - new = newlocale(LC_CTYPE_MASK, "C", NULL); - ASSERT(new); - } + new = newlocale(LC_CTYPE_MASK, "C", NULL); + ASSERT(new); + } codeset = Util_SafeStrdup(nl_langinfo_l(CODESET, new)); freelocale(new); @@ -928,7 +928,7 @@ * change bufIn so a simple cast is safe. --plangdale */ -#ifdef __linux__ +#if defined(__linux__) || defined(__EMSCRIPTEN__) status = iconv(cd, (char **)&bufIn, &sizeIn, &out, &outLeft); #else status = iconv(cd, &bufIn, &sizeIn, &out, &outLeft); diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/misc/hostinfoPosix.c open-vm-tools-12.3.0/open-vm-tools/lib/misc/hostinfoPosix.c --- open-vm-tools-12.2.5/open-vm-tools/lib/misc/hostinfoPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/misc/hostinfoPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -19,12 +19,12 @@ #define _GNU_SOURCE #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -133,6 +133,7 @@ #include "uwvmkAPI.h" #include "uwvmk.h" #include "vmkSyscall.h" +#include "uwvmkprivate.h" #endif #define LGPFX "HOSTINFO:" @@ -149,6 +150,8 @@ MAX(sizeof SYSTEM_BITNESS_64_ARM_LINUX, \ sizeof SYSTEM_BITNESS_64_ARM_FREEBSD)))) +#define LSB_RELEASE "/usr/bin/lsb_release" + struct hostinfoOSVersion { int hostinfoOSVersion[4]; char *hostinfoOSVersionString; @@ -1793,10 +1796,20 @@ size_t fields = ARRAYSIZE(lsbFields) - 1; // Exclude terminator /* + * In recent times, an increasing number of distros do not have the + * LSB support installed. Perform a quick check for it and bail if + * it's not accessible. + */ + + if (access(LSB_RELEASE, F_OK | X_OK) == -1) { + return -1; + } + + /* * Try to get OS detailed information from the lsb_release command. */ - lsbOutput = HostinfoGetCmdOutput("/usr/bin/lsb_release -sd 2>/dev/null"); + lsbOutput = HostinfoGetCmdOutput(LSB_RELEASE " -sd 2>/dev/null"); if (lsbOutput == NULL) { /* @@ -1819,14 +1832,16 @@ free(lsbOutput); /* LSB Distributor */ - lsbOutput = HostinfoGetCmdOutput("/usr/bin/lsb_release -si 2>/dev/null"); + lsbOutput = HostinfoGetCmdOutput(LSB_RELEASE " -si 2>/dev/null"); + if (lsbOutput != NULL) { (*args)[0] = Util_SafeStrdup(HostinfoLsbRemoveQuotes(lsbOutput)); free(lsbOutput); } /* LSB Release */ - lsbOutput = HostinfoGetCmdOutput("/usr/bin/lsb_release -sr 2>/dev/null"); + lsbOutput = HostinfoGetCmdOutput(LSB_RELEASE " -sr 2>/dev/null"); + if (lsbOutput != NULL) { (*args)[1] = Util_SafeStrdup(HostinfoLsbRemoveQuotes(lsbOutput)); free(lsbOutput); @@ -4553,6 +4568,62 @@ } +/* + *---------------------------------------------------------------------- + * + * Hostinfo_QueryProcessReaped -- + * + * Determine if the resources of a "dead" process have been reclaimed. + * On Linux, this is equivalent to querying the process's existence. + * On ESX, we can query the vmkernel. + * + * Results: + * HOSTINFO_PROCESS_QUERY_ALIVE Process is not yet reaped + * HOSTINFO_PROCESS_QUERY_DEAD Process has been reaped + * HOSTINFO_PROCESS_QUERY_UNKNOWN Don't know + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +HostinfoProcessQuery +Hostinfo_QueryProcessReaped(int pid) // IN: +{ +#if defined(VMX86_SERVER) || defined(USERWORLD) // ESXi + VMK_ReturnStatus status = VMKPrivate_WaitForWorldDeath(pid, 1); + HostinfoProcessQuery result; + + switch (status) { + case VMK_TIMEOUT: + result = HOSTINFO_PROCESS_QUERY_ALIVE; + break; + + /* + * VMK_BAD_PARAM indicates the pid is no longer associated with + * a userworld. + * + * VMK_OK indicates the pid has been reaped. + */ + case VMK_BAD_PARAM: + case VMK_OK: + result = HOSTINFO_PROCESS_QUERY_DEAD; + break; + + /* VMK_DEATH_PENDING (on caller), VMK_WAIT_INTERRUPTED */ + default: + result = HOSTINFO_PROCESS_QUERY_UNKNOWN; + break; + } + + return result; +#else + return Hostinfo_QueryProcessExistence(pid); +#endif +} + + /* *---------------------------------------------------------------------- * diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/misc/jsonUTF8.c open-vm-tools-12.3.0/open-vm-tools/lib/misc/jsonUTF8.c --- open-vm-tools-12.2.5/open-vm-tools/lib/misc/jsonUTF8.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/misc/jsonUTF8.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/misc/strutil.c open-vm-tools-12.3.0/open-vm-tools/lib/misc/strutil.c --- open-vm-tools-12.2.5/open-vm-tools/lib/misc/strutil.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/misc/strutil.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2019, 2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2019, 2021-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/misc/timeutil.c open-vm-tools-12.3.0/open-vm-tools/lib/misc/timeutil.c --- open-vm-tools-12.2.5/open-vm-tools/lib/misc/timeutil.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/misc/timeutil.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/misc/vthreadBase.c open-vm-tools-12.3.0/open-vm-tools/lib/misc/vthreadBase.c --- open-vm-tools-12.2.5/open-vm-tools/lib/misc/vthreadBase.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/misc/vthreadBase.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -352,6 +352,8 @@ # endif // Best effort until FreeBSD header update return (uint64)(uintptr_t)(void *)pthread_self(); +#elif defined __EMSCRIPTEN__ + return (uint64)(uintptr_t)(void *)pthread_self(); #else # error "Unknown platform" #endif @@ -574,7 +576,7 @@ #endif if (vmx86_debug) { - Log("Forgetting VThreadID %" FMTPD "d (\"%s\").\n", + Log("Forgetting VThreadID %" FMTPD "u (\"%s\").\n", VThread_CurID(), VThread_CurName()); } diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/nicInfo/nicInfo.c open-vm-tools-12.3.0/open-vm-tools/lib/nicInfo/nicInfo.c --- open-vm-tools-12.2.5/open-vm-tools/lib/nicInfo/nicInfo.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/nicInfo/nicInfo.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2014-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2014-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/nicInfo/nicInfoInt.h open-vm-tools-12.3.0/open-vm-tools/lib/nicInfo/nicInfoInt.h --- open-vm-tools-12.2.5/open-vm-tools/lib/nicInfo/nicInfoInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/nicInfo/nicInfoInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2014-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2014-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/nicInfo/nicInfoPosix.c open-vm-tools-12.3.0/open-vm-tools/lib/nicInfo/nicInfoPosix.c --- open-vm-tools-12.2.5/open-vm-tools/lib/nicInfo/nicInfoPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/nicInfo/nicInfoPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2014-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2014-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/panic/panic.c open-vm-tools-12.3.0/open-vm-tools/lib/panic/panic.c --- open-vm-tools-12.2.5/open-vm-tools/lib/panic/panic.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/panic/panic.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2022 VMware, Inc. All rights reserved. + * Copyright (C) 2006-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -508,8 +508,8 @@ case 0: // case 0 stuff is below break; case 1: - Log("PANIC: %s", buf); - Log("Panic loop\n"); + Log_Panic("PANIC: %s", buf); + Log_Panic("Panic loop\n"); /* Fall through */ default: fprintf(stderr, "Panic loop\n"); @@ -532,7 +532,7 @@ * Log panic information. */ - Log("PANIC: %s", buf); + Log_Panic("PANIC: %s", buf); Util_Backtrace(0); /* diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/pollGtk/pollGtk.c open-vm-tools-12.3.0/open-vm-tools/lib/pollGtk/pollGtk.c --- open-vm-tools-12.2.5/open-vm-tools/lib/pollGtk/pollGtk.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/pollGtk/pollGtk.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2019,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2004-2019,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/procMgr/procMgrPosix.c open-vm-tools-12.3.0/open-vm-tools/lib/procMgr/procMgrPosix.c --- open-vm-tools-12.2.5/open-vm-tools/lib/procMgr/procMgrPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/procMgr/procMgrPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/rpcChannel/simpleSocket.c open-vm-tools-12.3.0/open-vm-tools/lib/rpcChannel/simpleSocket.c --- open-vm-tools-12.2.5/open-vm-tools/lib/rpcChannel/simpleSocket.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/rpcChannel/simpleSocket.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013-2017,2019-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2013-2017,2019-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/rpcIn/rpcin.c open-vm-tools-12.3.0/open-vm-tools/lib/rpcIn/rpcin.c --- open-vm-tools-12.2.5/open-vm-tools/lib/rpcIn/rpcin.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/rpcIn/rpcin.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2020, 2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2020, 2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/rpcVmx/rpcvmx.c open-vm-tools-12.3.0/open-vm-tools/lib/rpcVmx/rpcvmx.c --- open-vm-tools-12.2.5/open-vm-tools/lib/rpcVmx/rpcvmx.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/rpcVmx/rpcvmx.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2018,2019,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2004-2018,2019,2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -217,7 +217,11 @@ * We have to dup the default, because of our contract: values we * return must always be freed by the caller. */ +#if defined(_WIN32) && defined(USERLEVEL) + value = _strdup(defval); +#else value = strdup(defval); +#endif } } diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/slashProc/net.c open-vm-tools-12.3.0/open-vm-tools/lib/slashProc/net.c --- open-vm-tools-12.2.5/open-vm-tools/lib/slashProc/net.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/slashProc/net.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2018 VMware, Inc. All rights reserved. + * Copyright (c) 2009-2018, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -566,7 +566,7 @@ myChannel = g_io_channel_unix_new(fd); /* - * 2. Sanity check the header, making sure it matches what we expect. + * 2. Confidence check the header, making sure it matches what we expect. * (It's -extremely- unlikely this will change, but we should check * anyway.) */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/nullDriver.c open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/nullDriver.c --- open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/nullDriver.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/nullDriver.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -54,8 +54,9 @@ * * Calls sync(). * - * @param[in] paths Unused. - * @param[out] handle Where to store the operation handle. + * @param[in] paths Unused. + * @param[out] handle Where to store the operation handle. + * @param[in] ignoreFrozenFS Unused. * * @return A SyncDriverErr. * @@ -64,7 +65,8 @@ SyncDriverErr NullDriver_Freeze(const GSList *paths, - SyncDriverHandle *handle) + SyncDriverHandle *handle, + Bool ignoreFrozenFS) { /* * This is more of a "let's at least do something" than something that diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/syncDriverInt.h open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/syncDriverInt.h --- open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/syncDriverInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/syncDriverInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2017 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2017, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -41,7 +41,8 @@ } SyncDriverErr; typedef SyncDriverErr (*SyncFreezeFn)(const GSList *paths, - SyncDriverHandle *handle); + SyncDriverHandle *handle, + Bool ignoreFrozenFs); typedef struct SyncHandle { SyncDriverErr (*thaw)(const SyncDriverHandle handle); @@ -55,15 +56,18 @@ #if defined(__linux__) SyncDriverErr LinuxDriver_Freeze(const GSList *userPaths, - SyncDriverHandle *handle); + SyncDriverHandle *handle, + Bool ignoreFrozenFs); SyncDriverErr VmSync_Freeze(const GSList *userPaths, - SyncDriverHandle *handle); + SyncDriverHandle *handle, + Bool ignoreFrozenFs); SyncDriverErr NullDriver_Freeze(const GSList *userPaths, - SyncDriverHandle *handle); + SyncDriverHandle *handle, + Bool ignoreFrozenFs); #endif #endif diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/syncDriverLinux.c open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/syncDriverLinux.c --- open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/syncDriverLinux.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/syncDriverLinux.c 2023-08-31 14:38:59.000000000 +0000 @@ -199,8 +199,9 @@ * slow when guest is performing significant IO. Therefore, caller should * consider running this function in a separate thread. * - * @param[in] paths List of paths to freeze. - * @param[out] handle Handle to use for thawing. + * @param[in] paths List of paths to freeze. + * @param[out] handle Handle to use for thawing. + * @param[in] ignoreFrozenFS Switch to allow EBUSY error. * * @return A SyncDriverErr. * @@ -209,7 +210,8 @@ SyncDriverErr LinuxDriver_Freeze(const GSList *paths, - SyncDriverHandle *handle) + SyncDriverHandle *handle, + Bool ignoreFrozenFS) { ssize_t count = 0; Bool first = TRUE; @@ -324,9 +326,12 @@ * Previously, an EBUSY error was ignored, assuming that we may try * to freeze the same superblock more than once depending on the * OS configuration (e.g., usage of bind mounts). - * Using the filesystem Id to check if this is a filesystem that we - * have seen previously and will ignore this FD only if that is - * the case. Log a warning otherwise since the quiesced snapshot + * Use the filesystem Id to check if this filesystem has been + * handled before and, if so, ignore it. + * Alternatively, allow (ignore) the EBUSY if the + * "ignoreFrozenFileSystems" switch inside "vmbackup" section of + * tools.conf file is TRUE. + * Otherwise, log a warning as the quiesced snapshot * attempt will fail. */ if (ioctlerr == EBUSY) { @@ -339,6 +344,14 @@ */ Debug(LGPFX "skipping path '%s' - previously frozen", path); continue; + } else if (ignoreFrozenFS) { + /* + * Ignores the EBUSY error if the FS has been frozen by another + * process and the 'ignoreFrozenFileSystems' setting is + * turned on in tools.conf file. + */ + Debug(LGPFX "Ignoring the frozen filesystem '%s'",path); + continue; } /* * It appears that this FS has been locked or frozen by another diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/syncDriverPosix.c open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/syncDriverPosix.c --- open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/syncDriverPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/syncDriverPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2005-2019 VMware, Inc. All rights reserved. + * Copyright (c) 2005-2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -456,7 +456,8 @@ SyncDriver_Freeze(const char *userPaths, // IN Bool enableNullDriver, // IN SyncDriverHandle *handle, // OUT - const char *excludedFileSystems) // IN + const char *excludedFileSystems, // IN + Bool ignoreFrozenFS) // IN { GSList *paths = NULL; SyncDriverErr err = SD_UNAVAILABLE; @@ -517,7 +518,7 @@ continue; } #endif - err = freezeFn(paths, handle); + err = freezeFn(paths, handle, ignoreFrozenFS); } /* diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/vmSyncDriver.c open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/vmSyncDriver.c --- open-vm-tools-12.2.5/open-vm-tools/lib/syncDriver/vmSyncDriver.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/syncDriver/vmSyncDriver.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -91,8 +91,9 @@ * Opens a description to the driver's proc node, and if successful, send an * ioctl to freeze the requested filesystems. * - * @param[in] paths List of paths to freeze. - * @param[out] handle Where to store the handle to use for thawing. + * @param[in] paths List of paths to freeze. + * @param[out] handle Where to store the handle to use for thawing. + * @param[in] ignoreFrozenFS Unused. * * @return A SyncDriverErr. * @@ -101,7 +102,8 @@ SyncDriverErr VmSync_Freeze(const GSList *paths, - SyncDriverHandle *handle) + SyncDriverHandle *handle, + Bool ignoreFrozenFS) { int file; Bool first = TRUE; diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/user/util.c open-vm-tools-12.3.0/open-vm-tools/lib/user/util.c --- open-vm-tools-12.2.5/open-vm-tools/lib/user/util.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/user/util.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2020 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2020, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -90,7 +90,7 @@ * * Util_Init -- * - * Opportunity to sanity check things + * Opportunity to confidence check things * * Results: * Bool - TRUE (this should never fail) @@ -106,7 +106,7 @@ { #ifdef VMX86_DEVEL /* - * Sanity check Str_Snprintf so that we're never thrown off guard + * Confidence check Str_Snprintf so that we're never thrown off guard * by a change in the underlying libraries that Str_Snprintf doesn't * catch and wrap properly. */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/lib/vmCheck/vmcheck.c open-vm-tools-12.3.0/open-vm-tools/lib/vmCheck/vmcheck.c --- open-vm-tools-12.2.5/open-vm-tools/lib/vmCheck/vmcheck.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/lib/vmCheck/vmcheck.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2021, 2023 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/libappmonitor/Makefile.am open-vm-tools-12.3.0/open-vm-tools/libappmonitor/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/libappmonitor/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libappmonitor/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2018 VMware, Inc. All rights reserved. +### Copyright (C) 2018, 2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -48,12 +48,10 @@ libappmonitor_la_SOURCES += $(libappmonitor_rpcchanneldir)/simpleSocket.c endif -libappmonitor_la_LDFLAGS = -libappmonitor_la_LDFLAGS += -Wl,-ldl -libappmonitor_la_LDFLAGS += -Wl,-lrt +libappmonitor_la_LIBADD += -ldl -lrt # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD -libappmonitor_la_LDFLAGS += -Wl,-lc +libappmonitor_la_LIBADD += -lc libappmonitor_includedir = $(includedir)/libappmonitor diff -Nru open-vm-tools-12.2.5/open-vm-tools/libDeployPkg/linuxDeployment.c open-vm-tools-12.3.0/open-vm-tools/libDeployPkg/linuxDeployment.c --- open-vm-tools-12.2.5/open-vm-tools/libDeployPkg/linuxDeployment.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libDeployPkg/linuxDeployment.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/libDeployPkg/Makefile.am open-vm-tools-12.3.0/open-vm-tools/libDeployPkg/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/libDeployPkg/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libDeployPkg/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2014-2022 VMware, Inc. All rights reserved. +### Copyright (c) 2014-2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -36,10 +36,9 @@ libDeployPkg_la_SOURCES += linuxDeploymentUtilities.c libDeployPkg_la_SOURCES += linuxDeploymentUtilities.h -libDeployPkg_la_LDFLAGS = # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD -libDeployPkg_la_LDFLAGS += -Wl,-lc +libDeployPkg_la_LIBADD += -lc libDeployPkg_includedir = $(includedir)/libDeployPkg diff -Nru open-vm-tools-12.2.5/open-vm-tools/libDeployPkg/processPosix.c open-vm-tools-12.3.0/open-vm-tools/libDeployPkg/processPosix.c --- open-vm-tools-12.2.5/open-vm-tools/libDeployPkg/processPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libDeployPkg/processPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2007-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/libguestlib/Makefile.am open-vm-tools-12.3.0/open-vm-tools/libguestlib/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/libguestlib/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libguestlib/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2007-2018,2020 VMware, Inc. All rights reserved. +### Copyright (C) 2007-2018,2020,2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -50,12 +50,10 @@ libguestlib_la_SOURCES += $(libguestlib_rpcchanneldir)/simpleSocket.c endif -libguestlib_la_LDFLAGS = -libguestlib_la_LDFLAGS += -Wl,-ldl -libguestlib_la_LDFLAGS += -Wl,-lrt +libguestlib_la_LIBADD += -ldl -lrt # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD -libguestlib_la_LDFLAGS += -Wl,-lc +libguestlib_la_LIBADD += -lc libguestlib_includedir = $(includedir)/vmGuestLib diff -Nru open-vm-tools-12.2.5/open-vm-tools/libguestlib/vmGuestLib.c open-vm-tools-12.3.0/open-vm-tools/libguestlib/vmGuestLib.c --- open-vm-tools-12.2.5/open-vm-tools/libguestlib/vmGuestLib.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libguestlib/vmGuestLib.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2005-2016,2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2005-2016,2019-2020, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -446,7 +446,7 @@ goto done; } - /* Sanity check the results. */ + /* Confidence check the results. */ if (replyLen < sizeof hostVersion) { Debug("%s: Unable to retrieve version\n", __FUNCTION__); ret = VMGUESTLIB_ERROR_OTHER; @@ -457,7 +457,7 @@ VMGuestLibDataV2 *v2reply = (VMGuestLibDataV2 *)reply; size_t dataSize = sizeof *v2reply; - /* More sanity checks. */ + /* More confidence checks. */ if (v2reply->hdr.version != hostVersion) { Debug("%s: Incorrect data version returned\n", __FUNCTION__); ret = VMGUESTLIB_ERROR_OTHER; @@ -491,7 +491,7 @@ GuestLibV3StatCount count; VMGuestLibStatisticsV3 *v3stats; - /* More sanity checks. */ + /* More confidence checks. */ if (v3reply->hdr.version != hostVersion) { Debug("%s: Incorrect data version returned\n", __FUNCTION__); ret = VMGUESTLIB_ERROR_OTHER; diff -Nru open-vm-tools-12.2.5/open-vm-tools/libguestStoreClient/guestStoreClientLib.c open-vm-tools-12.3.0/open-vm-tools/libguestStoreClient/guestStoreClientLib.c --- open-vm-tools-12.2.5/open-vm-tools/libguestStoreClient/guestStoreClientLib.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libguestStoreClient/guestStoreClientLib.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2019-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/libguestStoreClient/guestStoreClientLibInt.h open-vm-tools-12.3.0/open-vm-tools/libguestStoreClient/guestStoreClientLibInt.h --- open-vm-tools-12.2.5/open-vm-tools/libguestStoreClient/guestStoreClientLibInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libguestStoreClient/guestStoreClientLibInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2019-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/libguestStoreClient/gueststoreclientlib_version.h open-vm-tools-12.3.0/open-vm-tools/libguestStoreClient/gueststoreclientlib_version.h --- open-vm-tools-12.2.5/open-vm-tools/libguestStoreClient/gueststoreclientlib_version.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libguestStoreClient/gueststoreclientlib_version.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2019-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/libguestStoreClient/Makefile.am open-vm-tools-12.3.0/open-vm-tools/libguestStoreClient/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/libguestStoreClient/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libguestStoreClient/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2020 VMware, Inc. All rights reserved. +### Copyright (c) 2020, 2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -33,4 +33,4 @@ libguestStoreClient_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libguestStoreClient_la_LDFLAGS += -Wl,-lc +libguestStoreClient_la_LIBADD += -lc diff -Nru open-vm-tools-12.2.5/open-vm-tools/libhgfs/Makefile.am open-vm-tools-12.3.0/open-vm-tools/libhgfs/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/libhgfs/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libhgfs/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2010-2016 VMware, Inc. All rights reserved. +### Copyright (C) 2010-2016,2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -41,5 +41,5 @@ libhgfs_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libhgfs_la_LDFLAGS += -Wl,-lc +libhgfs_la_LIBADD += -lc diff -Nru open-vm-tools-12.2.5/open-vm-tools/libvmtools/Makefile.am open-vm-tools-12.3.0/open-vm-tools/libvmtools/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/libvmtools/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libvmtools/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2008-2021 VMware, Inc. All rights reserved. +### Copyright (c) 2008-2021,2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -89,5 +89,5 @@ libvmtools_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libvmtools_la_LDFLAGS += -Wl,-lc +libvmtools_la_LIBADD += -lc diff -Nru open-vm-tools-12.2.5/open-vm-tools/libvmtools/vmtoolsConfig.c open-vm-tools-12.3.0/open-vm-tools/libvmtools/vmtoolsConfig.c --- open-vm-tools-12.2.5/open-vm-tools/libvmtools/vmtoolsConfig.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libvmtools/vmtoolsConfig.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/libvmtools/vmtoolsLog.c open-vm-tools-12.3.0/open-vm-tools/libvmtools/vmtoolsLog.c --- open-vm-tools-12.2.5/open-vm-tools/libvmtools/vmtoolsLog.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/libvmtools/vmtoolsLog.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/Makefile.am open-vm-tools-12.3.0/open-vm-tools/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2007-2021 VMware, Inc. All rights reserved. +### Copyright (c) 2007-2021,2023 VMware, Inc. All rights reserved. ### ### Top-level Makefile for building the VMware OSS Tools. ### @@ -71,6 +71,7 @@ SUBDIRS += vmwgfxctrl endif + install-data-local: $(INSTALL) -d $(DESTDIR)/etc/vmware-tools/ $(INSTALL) -m 644 $(srcdir)/tools.conf $(DESTDIR)/etc/vmware-tools/tools.conf.example diff -Nru open-vm-tools-12.2.5/open-vm-tools/modules/freebsd/vmblock/subr.c open-vm-tools-12.3.0/open-vm-tools/modules/freebsd/vmblock/subr.c --- open-vm-tools-12.2.5/open-vm-tools/modules/freebsd/vmblock/subr.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/modules/freebsd/vmblock/subr.c 2023-08-31 14:38:59.000000000 +0000 @@ -432,7 +432,7 @@ * * VMBlockCheckVp -- * - * Sanity-checking intermediary used for debugging. When module is + * Confidence-checking intermediary used for debugging. When module is * compiled with FreeBSD macro "DIAGNOSTIC", every instance of * VMBVPTOLOWERVP() calls this function to test vnodes' and VMBlockNodes' * values, printing diagnostic information before panicing. If the kernel diff -Nru open-vm-tools-12.2.5/open-vm-tools/modules/shared/vmmemctl/kernelStubs.h open-vm-tools-12.3.0/open-vm-tools/modules/shared/vmmemctl/kernelStubs.h --- open-vm-tools-12.2.5/open-vm-tools/modules/shared/vmmemctl/kernelStubs.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/modules/shared/vmmemctl/kernelStubs.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2019,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2019,2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -227,7 +227,7 @@ #elif defined(__FreeBSD__) /* } else if (FreeBSD) { */ -/* Kernel memory on FreeBSD is tagged for statistics and sanity checking. */ +/* Kernel memory on FreeBSD is tagged for statistics and confidence checking. */ MALLOC_DECLARE(M_VMWARE_TEMP); /* diff -Nru open-vm-tools-12.2.5/open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h open-vm-tools-12.3.0/open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h --- open-vm-tools-12.2.5/open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2022 VMware, Inc. All rights reserved. + * Copyright (C) 2007-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -1102,7 +1102,7 @@ #define VMXNET3_MAX_MTU 9000 #define VMXNET3_MIN_MTU 60 -#define VMXNET3_LINK_UP (10000 << 16 | 1) // 10 Gbps, up +#define VMXNET3_LINK_UP 1 //up #define VMXNET3_LINK_DOWN 0 #define VMXWIFI_DRIVER_SHARED_LEN 8192 diff -Nru open-vm-tools-12.2.5/open-vm-tools/modules/solaris/vmhgfs/hgfsState.h open-vm-tools-12.3.0/open-vm-tools/modules/solaris/vmhgfs/hgfsState.h --- open-vm-tools-12.2.5/open-vm-tools/modules/solaris/vmhgfs/hgfsState.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/modules/solaris/vmhgfs/hgfsState.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2016, 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2004-2016, 2021, 2023 VMware, Inc. All rights reserved. * * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 @@ -65,7 +65,7 @@ HGFS_VP_TO_FP(vp)->fileType /* - * This macro is used for sanity checking the fact that Solaris won't ever call + * This macro is used for confidence checking the fact that Solaris won't ever call * one of our vnode operations without first calling lookup(), which is the * place where we acquire the filename. I have never seen a function fail * because of this, so it is likely that we can remove this macro and the checks diff -Nru open-vm-tools-12.2.5/open-vm-tools/modules/solaris/vmhgfs/kernelStubs.h open-vm-tools-12.3.0/open-vm-tools/modules/solaris/vmhgfs/kernelStubs.h --- open-vm-tools-12.2.5/open-vm-tools/modules/solaris/vmhgfs/kernelStubs.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/modules/solaris/vmhgfs/kernelStubs.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2019,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2019,2021, 2023 VMware, Inc. All rights reserved. * * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 @@ -186,7 +186,7 @@ #elif defined(__FreeBSD__) /* } else if (FreeBSD) { */ -/* Kernel memory on FreeBSD is tagged for statistics and sanity checking. */ +/* Kernel memory on FreeBSD is tagged for statistics and confidence checking. */ MALLOC_DECLARE(M_VMWARE_TEMP); /* diff -Nru open-vm-tools-12.2.5/open-vm-tools/modules/solaris/vmhgfs/vnode.c open-vm-tools-12.3.0/open-vm-tools/modules/solaris/vmhgfs/vnode.c --- open-vm-tools-12.2.5/open-vm-tools/modules/solaris/vmhgfs/vnode.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/modules/solaris/vmhgfs/vnode.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2016 VMware, Inc. All rights reserved. + * Copyright (c) 2004-2016, 2023 VMware, Inc. All rights reserved. * * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 @@ -2162,7 +2162,7 @@ /* - * XXX: If would be nice if we could perform some sort of sanity check on + * XXX: If would be nice if we could perform some sort of confidence check on * the handle here. Perhaps make sure handle <= NUM_SEARCHES in * hgfsServer.c since the handle is the index number in searchArray. */ @@ -5571,7 +5571,7 @@ /* - * XXX: If would be nice if we could perform some sort of sanity check on + * XXX: If would be nice if we could perform some sort of confidence check on * the handle here. Perhaps make sure handle <= NUM_SEARCHES in * hgfsServer.c since the handle is the index number in searchArray. */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/namespacetool/namespacetool.c open-vm-tools-12.3.0/open-vm-tools/namespacetool/namespacetool.c --- open-vm-tools-12.2.5/open-vm-tools/namespacetool/namespacetool.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/namespacetool/namespacetool.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2016-2020,2022 VMware, Inc. All rights reserved. + * Copyright (c) 2016-2020,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/scripts/common/statechange.sh open-vm-tools-12.3.0/open-vm-tools/scripts/common/statechange.sh --- open-vm-tools-12.2.5/open-vm-tools/scripts/common/statechange.sh 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/scripts/common/statechange.sh 2023-08-31 14:38:59.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2010-2016 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2016, 2023 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -107,7 +107,7 @@ # main() { - # This is sanity checked in the case/esac bit below. + # This is confidence checked in the case/esac bit below. powerOp=`basename "$0" | sed 's,-default,,'` exitCode=0 diff -Nru open-vm-tools-12.2.5/open-vm-tools/scripts/common/vm-support open-vm-tools-12.3.0/open-vm-tools/scripts/common/vm-support --- open-vm-tools-12.2.5/open-vm-tools/scripts/common/vm-support 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/scripts/common/vm-support 2023-08-31 14:38:59.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2006-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/scripts/freebsd/network open-vm-tools-12.3.0/open-vm-tools/scripts/freebsd/network --- open-vm-tools-12.2.5/open-vm-tools/scripts/freebsd/network 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/scripts/freebsd/network 2023-08-31 14:38:59.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2010-2017 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017, 2023 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -74,7 +74,7 @@ # # main -- # -# Main entry point. Perform some sanity checking, then map state change +# Main entry point. Perform some confidence checking, then map state change # events to relevant networking operations. # # Results: diff -Nru open-vm-tools-12.2.5/open-vm-tools/scripts/linux/network open-vm-tools-12.3.0/open-vm-tools/scripts/linux/network --- open-vm-tools-12.2.5/open-vm-tools/scripts/linux/network 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/scripts/linux/network 2023-08-31 14:38:59.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -x ########################################################## -# Copyright (C) 2001-2018, 2021 VMware, Inc. All rights reserved. +# Copyright (c) 2001-2018, 2021, 2023 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -608,7 +608,7 @@ # -# sanity_check -- +# confidence_check -- # # Check if the script has all the commands it needs to carry out the # request. So far, it requires either ip or ifconfig command to read @@ -616,7 +616,7 @@ # the place where we need to do individual interface state change. # -sanity_check() +confidence_check() { ip_cmd=$(which ip 2>/dev/null) ifconfig_cmd=$(which ifconfig 2>/dev/null) @@ -631,7 +631,7 @@ # # main -- # -# Main entry point. Perform some sanity checking, then map state change +# Main entry point. Perform some confidence checking, then map state change # events to relevant networking operations. # # Results: @@ -650,7 +650,7 @@ TranquilizeNetworkManager exitCode=$? if [ $exitCode != 0 ]; then - sanity_check suspend-vm + confidence_check suspend-vm save_active_NIC_list run_network_script stop exitCode=$? @@ -660,7 +660,7 @@ WakeNetworkManager exitCode=$? if [ $exitCode != 0 ]; then - sanity_check resume-vm + confidence_check resume-vm # According to hfu, "/etc/init.d/networking restart" on Debian 5.0 # may bring down ethernet interfaces tagged as "allow-hotplug" without # bringing them back up. diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgr.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgr.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgr.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgr.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgrInstallAction.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgrInstallAction.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgrInstallAction.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgrInstallAction.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2021-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -47,39 +47,48 @@ typedef struct ComponentAction { const char *componentName; /* The name of the enabled - component. */ + * component. + */ const char *scriptName; /* The default script to be invoked - to take actions for a particular - component */ + * to take actions for a particular + * component + */ const char *addActionArguments; /* Default arguments to the script - to execute present action towards - the component in the guest OS. */ + * to execute present action towards + * the component in the guest OS. + */ const char *removeActionArguments; /* Default arguments to the script - to execute absent action towards - the component in the guest OS. */ + * to execute absent action towards + * the component in the guest OS. + */ const char *checkStatusActionArguments; /* Default arguments to the script - to execute checkstatus towards - the component in the guest OS. */ + * to execute checkstatus towards + * the component in the guest OS. + */ const char* mandatoryParameters; /* Arguments that are mandatory to - be passed to script. */ + * be passed to script. + */ const char *componentDirectory; /* The name of directory in which - scripts will be installed.*/ + * scripts will be installed. + */ char* (*customizeRemoveAction)(); /* A custom callback function - to customize arguments for - absent action on the component - script. */ + * to customize arguments for + * absent action on the component + * script. + */ char* (*customizeAddAction)(); /* A custom callback function - to customize arguments for - present action on the component - script. */ + * to customize arguments for + * present action on the component + * script. + */ } ComponentAction; @@ -214,7 +223,7 @@ * component. * * @param[in] asyncProcInfo An asyncProcInfo object of the currently running - async process. + * async process. * @param[in] componentIndex Index of the component in the global array of * components. * @@ -410,13 +419,13 @@ * * * The linux counterpart is constructed as: - * + * * * @param[in] scriptName Name of the component script. * @param[in] defaultArguments Default arguments to the component script. * @param[in] mandatoryParams mandatory params to the component script. * @param[in] customizeAction A callback function to customize the arguments - for the component script. + * for the component script. * * @return * A commandline to be directly run as an async process. @@ -1178,7 +1187,7 @@ size_t replylen; gchar *msg; - /* + /* * Proceed only if the component script is installed and * the component is enabled by the plugin. */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgrInstallManager.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgrInstallManager.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgrInstallManager.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgrInstallManager.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -19,9 +19,9 @@ /* * componentMgrInstallManager.c -- * - * This file contains all the neccessary functions and handling of performing + * This file contains all the necessary functions and handling of performing * check status operation and add/remove of a component. - * The operations are triggerred as an async process and GSource timers are + * The operations are triggered as an async process and GSource timers are * created to monitor the execution status of the async process. * After successful completion of the async process, it's resources are * released to make way for a new async process. @@ -147,7 +147,7 @@ ComponentMgr_ResetComponentGSourceTimer(componentIndex); /* - * After checkstatus operation has completed sucessfully, we can have a + * After checkstatus operation has completed successfully, we can have a * next sequence of operations to be executed on a component. */ if (callbackFunction != NULL) { diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgrPlugin.h open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgrPlugin.h --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgrPlugin.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgrPlugin.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -75,20 +75,20 @@ #define COMPONENTMGR_ASYNC_CHECK_STATUS_TERMINATE_PERIOD 15 /* - * Poll interval for waiting on the async process runnning the action for a + * Poll interval for waiting on the async process running the action for a * component in seconds. */ #define COMPONENTMGR_ASYNCPROCESS_POLL_INTERVAL 5 /* - * The wait period after which the async proces needs to be killed for a + * The wait period after which the async process needs to be killed for a * component in seconds. */ #define COMPONENTMGR_ASYNCPROCESS_TERMINATE_PERIOD 600 /* * The amount of times the check status operation needs to wait before any - * change in the guetsVar to trigger another checkstatus opeartion. + * change in the guetsVar to trigger another checkstatus operation. */ #define COMPONENTMGR_CHECK_STATUS_COUNT_DOWN 10 @@ -166,7 +166,7 @@ #define COMPONENTMGR_ALLCOMPONENTS "all" /* - * The included param in the tools.conf contains comma seperated list + * The included param in the tools.conf contains comma separated list * of components and can have special values. * Defines various special values present in the included tools.conf param. */ @@ -190,13 +190,18 @@ { INSTALLED = 100, /* The component is installed on the guest OS. */ INSTALLING, /* The component is being installed on the guest - OS. */ + * OS. + */ NOTINSTALLED, /* The component is not installed on the guest OS. */ INSTALLFAILED, /* The component install failed on the guest OS. */ REMOVING, /* The component is being removed on the guest OS. */ REMOVEFAILED, /* The component remove failed on the guest OS. */ + UNMANAGED, /* The component is installed on the guest OS, but + * is not managed (or manageable), through the + * component manager plugin. + */ SCRIPTFAILED = 126, /* The component script failed for some reason. */ SCRIPTTERMINATED = 130 /* The component script terminated for some reason. */ @@ -213,8 +218,9 @@ PRESENT, /* The action adds/installs the components on the guest. */ ABSENT, /* The action removes/uninstalls the components on the guest.*/ CHECKSTATUS, /* The action calls the preconfigured script to check the - current status of the component. */ - INVALIDACTION /* Action not recongnised by the plugin. */ + * current status of the component. + */ + INVALIDACTION /* Action not recognised by the plugin. */ } Action; @@ -225,15 +231,18 @@ typedef struct AsyncProcessInfo { ProcMgr_AsyncProc *asyncProc; /* ProcMgr_AsyncProc structure consisting of - the process data running an action on the - component. */ + * the process data running an action on the + * component. + */ ToolsAppCtx *ctx; /* Tools application context. */ int backoffTimer; /* Backoff timer to wait until timeout - to kill the asynchronous process. */ + * to kill the asynchronous process. + */ int componentIndex; /* The index of the component in the global - array of components. */ + * array of components. + */ void (*callbackFunction)(int componentIndex); /* A callback function to - sequence a new operation + * sequence a new operation */ } AsyncProcessInfo; @@ -249,15 +258,17 @@ gboolean isEnabled; /* Component enabled/disabled by the plugin. */ InstallStatus status; /* Contains current status of the component. */ GSource *sourceTimer; /* A GSource timer for async process monitoring running - an operation for a component. */ + * an operation for a component. + */ AsyncProcessInfo *procInfo; /* A structure to store information about the * current running async process for a component. */ int statuscount; /* A counter value to store max number of times to - wait before starting another checkstatus opeartion + * wait before starting another checkstatus operation */ Action action; /* Contains information about the action to be - performed on a component. */ + * performed on a component. + */ } ComponentInfo; diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgrUtil.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgrUtil.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/componentMgrUtil.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/componentMgrUtil.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -37,7 +37,7 @@ * @param[in] ctx Tools application context. * @param[in] guestInfoCmd Guestinfo command to fetch the guestVar. * @param[out] outBuffer Output buffer to hold RPC result (optional). - * @param[out] outBufferLen Output buffer len (optional). + * @param[out] outBufferLen Output buffer length (optional). * * @return * TRUE if cmd executed successfully, otherwise FALSE @@ -115,6 +115,7 @@ case REMOVING: return "REMOVING"; case INSTALLFAILED: return "INSTALLFAILED"; case REMOVEFAILED: return "REMOVEFAILED"; + case UNMANAGED: return "UNMANAGED"; case SCRIPTFAILED: return "SCRIPTFAILED"; case SCRIPTTERMINATED: return "SCRIPTTERMINATED"; } @@ -191,7 +192,7 @@ * requested components. * * @param[in] ctx Tools application context. - * @param[in] components Comma seperated list of available components. + * @param[in] components Comma separated list of available components. * * @return * None diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/svtminion.sh open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/svtminion.sh --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/componentMgr/svtminion.sh 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/componentMgr/svtminion.sh 2023-08-31 14:38:59.000000000 +0000 @@ -1,11 +1,15 @@ #!/usr/bin/env bash -# Copyright (c) 2021-2023 VMware, Inc. +# Copyright 2021-2023 VMware, Inc. # SPDX-License-Identifier: Apache-2 ## Salt VMware Tools Integration script ## integration with Component Manager and GuestStore Helper +# latest shellcheck 0.9.0-1 is showing false negatives +# which 0.8.0-2 does not, disabling since using 0.9.0-1 +# shellcheck disable=SC2317,SC2004,SC2320,SC2086 + ## set -u ## set -xT set -o functrace @@ -13,9 +17,10 @@ ## set -o errexit # using bash for now -# run this script as root, as needed to run salt +# run this script as root, as needed to run Salt -readonly SCRIPT_VERSION='1.4' +## readonly SCRIPT_VERSION='SCRIPT_VERSION_REPLACE' +readonly SCRIPT_VERSION="1.6" # definitions @@ -26,13 +31,14 @@ readonly salt_name="salt" readonly repo_json_file="repo.json" salt_url_version="${default_salt_url_version}" -base_url="https://repo.saltproject.io/salt/vmware-tools-onedir" +pre_3006_base_url="https://repo.saltproject.io/salt/vmware-tools-onedir" +# Release +post_3005_base_url="https://repo.saltproject.io/salt/py3/onedir" +base_url="" # Salt file and directory locations readonly base_salt_location="/opt/saltstack" readonly salt_dir="${base_salt_location}/${salt_name}" -readonly test_exists_file="${salt_dir}/run/run" - readonly salt_conf_dir="/etc/salt" readonly salt_minion_conf_name="minion" readonly salt_minion_conf_file="${salt_conf_dir}/${salt_minion_conf_name}" @@ -40,16 +46,19 @@ readonly log_dir="/var/log" +readonly list_files_systemd_to_remove="/lib/systemd/system/salt-minion.service +/usr/lib/systemd/system/salt-minion.service +/usr/local/lib/systemd/system/salt-minion.service +/etc/systemd/system/salt-minion.service +" + readonly list_file_dirs_to_remove="${base_salt_location} /etc/salt /var/run/salt /var/cache/salt /var/log/salt /usr/bin/salt-* -/lib/systemd/system/salt-minion.service -/usr/lib/systemd/system/salt-minion.service -/usr/local/lib/systemd/system/salt-minion.service -/etc/systemd/system/salt-minion.service +${list_files_systemd_to_remove} " ## /var/log/vmware-${SCRIPTNAME}-* @@ -77,7 +86,8 @@ " readonly salt_minion_service_wrapper=\ -"# Copyright (c) 2021-2022 VMware, Inc. All rights reserved. +"# Copyright 2021-2023 VMware, Inc. +# SPDX-License-Identifier: Apache-2 [Unit] Description=The Salt Minion @@ -92,12 +102,19 @@ LimitNOFILE=8192 MemoryLimit=250M Nice=19 -ExecStart=/opt/saltstack/salt/run/run minion +ExecStart=/usr/bin/salt-minion [Install] WantedBy=multi-user.target " +# Onedir detection locations +readonly onedir_post_3005_location="${salt_dir}/salt-minion" +readonly onedir_pre_3006_location="${salt_dir}/run/run" + +declare -a list_of_onedir_locations_check +list_of_onedir_locations_check[0]="${onedir_pre_3006_location}" +list_of_onedir_locations_check[1]="${onedir_post_3005_location}" ## VMware file and directory locations readonly vmtools_base_dir_etc="/etc/vmware-tools" @@ -127,6 +144,7 @@ # 100 + 3 => installFailed # 100 + 4 => removing # 100 + 5 => removeFailed +# 100 + 6 => externalInstall # 126 => scriptFailed # 130 => scriptTerminated declare -A STATUS_CODES_ARY @@ -136,6 +154,7 @@ STATUS_CODES_ARY[installFailed]=103 STATUS_CODES_ARY[removing]=104 STATUS_CODES_ARY[removeFailed]=105 +STATUS_CODES_ARY[externalInstall]=106 STATUS_CODES_ARY[scriptFailed]=126 STATUS_CODES_ARY[scriptTerminated]=130 @@ -174,6 +193,11 @@ SOURCE_FLAG=0 SOURCE_PARAMS="" +# Flag for pre_3006 and post_3005, 0 => pre_3006, 1 => post_3005 +POST_3005_FLAG=0 +POST_3005_MAJOR_VER_FLAG=0 + + # helper functions _timestamp() { @@ -247,8 +271,8 @@ echo " [-j|--source] [-l|--loglevel] [-m|--minionversion]" echo " [-r|--remove] [-s|--status] [-v|--version]" echo "" - echo " -c, --clear clear previous minion identifer and keys," - echo " and set specified identifer if present" + echo " -c, --clear clear previous minion identifier and keys," + echo " and set specified identifier if present" echo " -d, --depend check dependencies required to run script exist" echo " -h, --help this message" echo " -i, --install install and activate salt-minion configuration" @@ -270,7 +294,7 @@ echo " -s, --status return status for this script" echo " -v, --version version of this script" echo "" - echo " salt-minion vmtools integration script" + echo " salt-minion VMTools integration script" echo " example: $0 --status" } @@ -278,7 +302,7 @@ # work functions # -# _cleanup +# _cleanup_int # # Cleanups any running process and areas on control-C # @@ -287,11 +311,26 @@ # Exits with hard-coded value 130 # -_cleanup() { +_cleanup_int() { + rm -rf "$WORK_DIR" + _debug_log "$0:${FUNCNAME[0]} Deleted temp working directory $WORK_DIR" + exit ${STATUS_CODES_ARY[scriptTerminated]} } -trap _cleanup INT +# +# _cleanup_exit +# +# Cleanups any running process and areas on exit +# +_cleanup_exit() { + rm -rf "$WORK_DIR" + _debug_log "$0:${FUNCNAME[0]} Deleted temp working directory $WORK_DIR" + ## exit ${CURRENT_STATUS} +} + +trap _cleanup_int INT +trap _cleanup_exit EXIT # cheap trim relying on echo to convert tabs to spaces and @@ -330,13 +369,13 @@ fi done if [[ ${valid_level} -ne 1 ]]; then - _warning_log "$0:${FUNCNAME[0]} attempted to set log_level with"\ - "invalid input, log_level unchanged, currently"\ + _warning_log "$0:${FUNCNAME[0]} attempted to set log_level with "\ + "invalid input, log_level unchanged, currently "\ "'${LOG_MODES_AVAILABLE[${LOG_LEVEL}]}'" else LOG_LEVEL=${LOG_LEVELS_ARY[${ip_level}]} - _info_log "$0:${FUNCNAME[0]} changed log_level from"\ - "'${LOG_MODES_AVAILABLE[${old_log_level}]}' to"\ + _info_log "$0:${FUNCNAME[0]} changed log_level from "\ + "'${LOG_MODES_AVAILABLE[${old_log_level}]}' to "\ "'${LOG_MODES_AVAILABLE[${LOG_LEVEL}]}'" fi return 0 @@ -349,7 +388,7 @@ # Set the version of Salt Minion wanted to install # default 'latest' # -# Note: typically salt version includes the release number in addition to +# Note: typically Salt version includes the release number in addition to # version number or 'latest' for the most recent release # # for example: 3003.3-1 @@ -361,32 +400,80 @@ _set_install_minion_version_fn() { if [[ "$#" -ne 1 ]]; then - _error_log "$0:${FUNCNAME[0]} error expected one parameter"\ + _error_log "$0:${FUNCNAME[0]} error expected one parameter "\ "specifying the version of the salt-minion to install or 'latest'" fi - _info_log "$0:${FUNCNAME[0]} processing setting salt version for"\ + _info_log "$0:${FUNCNAME[0]} processing setting Salt version for "\ "salt-minion to install" local salt_version="" salt_version=$(echo "$1" | cut -d ' ' -f 1) if [[ "latest" = "${salt_version}" ]]; then - _debug_log "$0:${FUNCNAME[0]} input salt version for salt-minion to"\ - " install is 'latest', leaving as default"\ + _debug_log "$0:${FUNCNAME[0]} input Salt version for salt-minion to "\ + "install is 'latest', leaving as default "\ "'${default_salt_url_version}' for now" else - _debug_log "$0:${FUNCNAME[0]} input salt version for salt-minion to"\ - " install is '${salt_version}'" + _debug_log "$0:${FUNCNAME[0]} input Salt version for salt-minion to "\ + "install is '${salt_version}'" salt_url_version="${salt_version}" - _debug_log "$0:${FUNCNAME[0]} set salt version for salt-minion to"\ + _debug_log "$0:${FUNCNAME[0]} set Salt version for salt-minion to "\ "install to '${salt_url_version}'" fi return 0 } +# +# _set_post_3005_flags_from_version +# +# Sets the POST_3005_FLAG and POST_3005_MAJOR_VER_FLAG +# from the version currently present in salt_url_version +# +# Will also set base_url if not already defined by --source option +# +# Results: +# Returns with exit code +# +_set_post_3005_flags_from_version() { + _info_log "$0:${FUNCNAME[0]} setting POST_3005_FLAG and "\ + "POST_3005_MAJOR_VER_FLAG from Salt version '${salt_url_version}'" + + if [[ "latest" = "${salt_url_version}" ]]; then + POST_3005_FLAG=1 + POST_3005_MAJOR_VER_FLAG=1 + base_url="${post_3005_base_url}" + # done, already have url for latest & major versions + _debug_log "$0:${FUNCNAME[0]} post-3005 install, using latest "\ + "base_url '${base_url}'" + else + ver_chk=$(echo "${salt_url_version}" | cut -d '.' -f 1) + if [[ ${ver_chk} -ge 3006 ]]; then + POST_3005_FLAG=1 + ver_chk_major=$(echo "${salt_url_version}" | cut -d '.' -f 1) + ver_chk_minor=$(echo "${salt_url_version}" | cut -d '.' -f 2) + _debug_log "$0:${FUNCNAME[0]} post-3005 install, checking "\ + "for major version only '${ver_chk_major}', minor "\ + "'${ver_chk_minor}'" + if [[ "${ver_chk_major}" = "${ver_chk_minor}" ]]; then + POST_3005_MAJOR_VER_FLAG=1 + base_url="${post_3005_base_url}" + else + base_url="${post_3005_base_url}/minor" + fi + _debug_log "$0:${FUNCNAME[0]} post-3005 install, for "\ + "'${salt_url_version}' using base_url '${base_url}'" + else + # install pre-3006, use older url + base_url="${pre_3006_base_url}" + _debug_log "$0:${FUNCNAME[0]} pre-3006 install, for "\ + "'${salt_url_version}' using base_url '${base_url}'" + fi + fi +} + # # _update_minion_conf_ary @@ -404,7 +491,7 @@ local _retn=0 if [[ "$#" -ne 2 ]]; then - _error_log "$0:${FUNCNAME[0]} error expect two parameters,"\ + _error_log "$0:${FUNCNAME[0]} error expect two parameters, "\ "a key and a value" fi @@ -417,8 +504,8 @@ do if [[ "${m_cfg_keys[${chk_idx}]}" = "${cfg_key}" ]]; then m_cfg_values[${chk_idx}]="${cfg_value}" - _debug_log "$0:${FUNCNAME[0]} updating minion configuration"\ - "array key '${m_cfg_keys[${chk_idx}]}' with"\ + _debug_log "$0:${FUNCNAME[0]} updating minion configuration "\ + "array key '${m_cfg_keys[${chk_idx}]}' with "\ "value '${cfg_value}'" chk_found=1 break; @@ -428,14 +515,14 @@ # new key for array m_cfg_keys[${key_ary_sz}]="${cfg_key}" m_cfg_values[${key_ary_sz}]="${cfg_value}" - _debug_log "$0:${FUNCNAME[0]} adding to minion configuration"\ + _debug_log "$0:${FUNCNAME[0]} adding to minion configuration "\ "array new key '${cfg_key}' and value '${cfg_value}'" fi else # initial entry m_cfg_keys[0]="${cfg_key}" m_cfg_values[0]="${cfg_value}" - _debug_log "$0:${FUNCNAME[0]} adding initial minion configuration"\ + _debug_log "$0:${FUNCNAME[0]} adding initial minion configuration "\ "array, key '${cfg_key}' and value '${cfg_value}'" fi return ${_retn} @@ -445,12 +532,12 @@ # # _fetch_vmtools_salt_minion_conf_tools_conf # -# Retrieve the configuration for salt-minion from vmtools +# Retrieve the configuration for salt-minion from VMTools # configuration file tools.conf # # Results: -# Exits with new vmtools configuration file if none found or salt-minion -# configuration file updated with configuration read from vmtools +# Exits with new VMTools configuration file if none found or salt-minion +# configuration file updated with configuration read from VMTools # configuration file section for salt_minion # @@ -463,7 +550,7 @@ mkdir -p "${vmtools_base_dir_etc}" echo "[${vmtools_salt_minion_section_name}]" \ > "${vmtools_base_dir_etc}/${vmtools_conf_file}" - _warning_log "$0:${FUNCNAME[0]} creating empty configuration"\ + _warning_log "$0:${FUNCNAME[0]} creating empty configuration "\ "file ${vmtools_base_dir_etc}/${vmtools_conf_file}" else # need to extract configuration for salt-minion @@ -475,11 +562,11 @@ do line_value=$(_trim "${line}") if [[ -n "${line_value}" ]]; then - _debug_log "$0:${FUNCNAME[0]} processing tools.conf"\ + _debug_log "$0:${FUNCNAME[0]} processing tools.conf "\ "line '${line}'" if echo "${line_value}" | grep -q '^\[' ; then if [[ ${salt_config_flag} -eq 1 ]]; then - # if new section after doing salt config, we are done + # if new section after doing Salt config, we are done break; fi if [[ ${line_value} = \ @@ -493,12 +580,12 @@ cfg_key=$(echo "${line}" | cut -d '=' -f 1) cfg_value=$(echo "${line}" | cut -d '=' -f 2) _update_minion_conf_ary "${cfg_key}" "${cfg_value}" || { - _error_log "$0:${FUNCNAME[0]} error updating minion"\ - "configuration array with key '${cfg_key}' and"\ + _error_log "$0:${FUNCNAME[0]} error updating minion "\ + "configuration array with key '${cfg_key}' and "\ "value '${cfg_value}', retcode '$?'"; } else - _debug_log "$0:${FUNCNAME[0]} skipping tools.conf"\ + _debug_log "$0:${FUNCNAME[0]} skipping tools.conf "\ "line '${line}'" fi fi @@ -511,30 +598,30 @@ # # _fetch_vmtools_salt_minion_conf_guestvars # -# Retrieve the configuration for salt-minion from vmtools guest variables +# Retrieve the configuration for salt-minion from VMTools guest variables # # Results: # salt-minion configuration file updated with configuration read -# from vmtools guest variables +# from VMTools guest variables # configuration file section for salt_minion # _fetch_vmtools_salt_minion_conf_guestvars() { # fetch the current configuration for section salt_minion - # from guest variables args + # from guest variables args local _retn=0 local gvar_args="" gvar_args=$(vmtoolsd --cmd "info-get ${guestvars_salt_args}" 2>/dev/null)\ - || { _warning_log "$0:${FUNCNAME[0]} unable to retrieve arguments"\ - "from guest variables location ${guestvars_salt_args},"\ + || { _warning_log "$0:${FUNCNAME[0]} unable to retrieve arguments "\ + "from guest variables location ${guestvars_salt_args}, "\ "retcode '$?'"; } if [[ -z "${gvar_args}" ]]; then return ${_retn}; fi - _debug_log "$0:${FUNCNAME[0]} processing arguments from guest variables"\ + _debug_log "$0:${FUNCNAME[0]} processing arguments from guest variables "\ "location ${guestvars_salt_args}" for idx in ${gvar_args} @@ -542,8 +629,8 @@ cfg_key=$(echo "${idx}" | cut -d '=' -f 1) cfg_value=$(echo "${idx}" | cut -d '=' -f 2) _update_minion_conf_ary "${cfg_key}" "${cfg_value}" || { - _error_log "$0:${FUNCNAME[0]} error updating minion configuration"\ - "array with key '${cfg_key}' and value '${cfg_value}',"\ + _error_log "$0:${FUNCNAME[0]} error updating minion configuration "\ + "array with key '${cfg_key}' and value '${cfg_value}', "\ "retcode '$?'"; } done @@ -559,9 +646,9 @@ # on the command line # # Results: -# Exits with new vmtools configuration file if none found +# Exits with new VMTools configuration file if none found # or salt-minion configuration file updated with configuration read -# from vmtools configuration file section for salt_minion +# from VMTools configuration file section for salt_minion # _fetch_vmtools_salt_minion_conf_cli_args() { @@ -572,7 +659,7 @@ cli_args="$*" cli_no_args=$# if [[ ${cli_no_args} -ne 0 ]]; then - _debug_log "$0:${FUNCNAME[0]} processing command line"\ + _debug_log "$0:${FUNCNAME[0]} processing command line "\ "arguments '${cli_args}'" for idx in ${cli_args} do @@ -583,8 +670,8 @@ cfg_key=$(echo "${idx}" | cut -d '=' -f 1) cfg_value=$(echo "${idx}" | cut -d '=' -f 2) _update_minion_conf_ary "${cfg_key}" "${cfg_value}" || { - _error_log "$0:${FUNCNAME[0]} error updating minion"\ - "configuration array with key '${cfg_key}' and"\ + _error_log "$0:${FUNCNAME[0]} error updating minion "\ + "configuration array with key '${cfg_key}' and "\ "value '${cfg_value}', retcode '$?'"; } done @@ -617,7 +704,7 @@ #provided input ran_minion="${ip_string}_${RANDOM:0:5}" fi - _debug_log "$0:${FUNCNAME[0]} generated randomized minion"\ + _debug_log "$0:${FUNCNAME[0]} generated randomized minion "\ "identifier '${ran_minion}'" echo "${ran_minion}" } @@ -627,7 +714,7 @@ # _fetch_vmtools_salt_minion_conf # # Retrieve the configuration for salt-minion -# precendence order: L -> H +# precedence order: L -> H # from VMware Tools guest Variables # from VMware Tools configuration file tools.conf # from any command line parameters @@ -642,15 +729,15 @@ _debug_log "$0:${FUNCNAME[0]} retrieving minion configuration parameters" _fetch_vmtools_salt_minion_conf_guestvars || { - _error_log "$0:${FUNCNAME[0]} failed to process guest variable"\ + _error_log "$0:${FUNCNAME[0]} failed to process guest variable "\ "arguments, retcode '$?'"; } _fetch_vmtools_salt_minion_conf_tools_conf || { - _error_log "$0:${FUNCNAME[0]} failed to process tools.conf file,"\ + _error_log "$0:${FUNCNAME[0]} failed to process tools.conf file, "\ "retcode '$?'"; } _fetch_vmtools_salt_minion_conf_cli_args "$*" || { - _error_log "$0:${FUNCNAME[0]} failed to process command line"\ + _error_log "$0:${FUNCNAME[0]} failed to process command line "\ "arguments, retcode '$?'"; } @@ -658,12 +745,12 @@ local mykey_ary_sz=${#m_cfg_keys[@]} local myvalue_ary_sz=${#m_cfg_values[@]} if [[ "${mykey_ary_sz}" -ne "${myvalue_ary_sz}" ]]; then - _error_log "$0:${FUNCNAME[0]} key '${mykey_ary_sz}' and"\ - "value '${myvalue_ary_sz}' array sizes for minion_conf"\ + _error_log "$0:${FUNCNAME[0]} key '${mykey_ary_sz}' and "\ + "value '${myvalue_ary_sz}' array sizes for minion_conf "\ "don't match" else mkdir -p "${salt_conf_dir}" - echo "# Minion configuration file - created by vmtools salt script"\ + echo "# Minion configuration file - created by VMTools Salt script" \ > "${salt_minion_conf_file}" echo "enable_fqdns_grains: False" >> "${salt_minion_conf_file}" for ((chk_idx=0; chk_idx> "${salt_minion_conf_file}" @@ -689,7 +776,7 @@ done fi - _info_log "$0:${FUNCNAME[0]} successfully retrieved the salt-minion"\ + _info_log "$0:${FUNCNAME[0]} successfully retrieved the salt-minion "\ "configuration from configuration sources" return 0 } @@ -698,7 +785,7 @@ # # _curl_download # -# Retrieve file from specifed url to specific file +# Retrieve file from specified url to specific file # # Results: # Exits with 0 or error code @@ -718,22 +805,22 @@ curl -o "${file_name}" --tlsv1.2 -fsSL "${file_url}" _retn=$? if [[ ${_retn} -ne 0 ]]; then - _warning_log "$0:${FUNCNAME[0]} failed to download file"\ - "'${file_name}' from '${file_url}' on '${i}' attempt,"\ + _warning_log "$0:${FUNCNAME[0]} failed to download file "\ + "'${file_name}' from '${file_url}' on '${i}' attempt, "\ "retcode '${_retn}'" else download_retry_failed=0 - _debug_log "$0:${FUNCNAME[0]} successfully downloaded file"\ + _debug_log "$0:${FUNCNAME[0]} successfully downloaded file "\ "'${file_name}' from '${file_url}' after '${i}' attempts" break fi done if [[ ${download_retry_failed} -ne 0 ]]; then - _error_log "$0:${FUNCNAME[0]} failed to download file '${file_name}'"\ - " from '${file_url}' after '${CURL_DOWNLOAD_RETRY_COUNT}' attempts" + _error_log "$0:${FUNCNAME[0]} failed to download file '${file_name}' "\ + "from '${file_url}' after '${CURL_DOWNLOAD_RETRY_COUNT}' attempts" fi - _info_log "$0:${FUNCNAME[0]} successfully downloaded file"\ + _info_log "$0:${FUNCNAME[0]} successfully downloaded file "\ "'${file_name}' from '${file_url}'" return 0 } @@ -750,7 +837,7 @@ # Echos empty '' if 'salt_url_version' is not found in repo json file # # Note: salt_url_version defaults to 'latest' unless set to a specific -# salt minion version, for example: 3004.1-1 +# Salt minion version, for example: 3004.1-1 # _parse_json_specd_ver() { @@ -763,10 +850,15 @@ local var1="" local var2="" + local machine_arch_chk="${MACHINE_ARCH}" declare -A rdict _info_log "$0:${FUNCNAME[0]} parsing of repo json file '${file_name}'" + if [[ ${POST_3005_FLAG} -eq 0 ]]; then + machine_arch_chk="amd64" # pre_3006 used amd64 + fi + file_value=$(<"${file_name}") # limit 80 cols @@ -784,12 +876,13 @@ elif [[ "${line}" = "}" ]]; then # examine directory just read in if [[ ${specd_ver_flag} -eq 1 ]]; then - if [[ "${rdict['os']}" = "linux" ]]; then + if [[ "${rdict['os']}" = "linux" \ + && "${rdict['arch']}" = "${machine_arch_chk}" ]]; then # have linux values for specd_ver - _debug_log "$0:${FUNCNAME[0]} parsed following linux for"\ - "specified version '${salt_url_version}' from repo json"\ - "file '${file_name}', os ${rdict['os']}, version"\ - "${rdict['version']}, name ${rdict['name']}, SHA512"\ + _debug_log "$0:${FUNCNAME[0]} parsed following linux for "\ + "specified version '${salt_url_version}' from repo json "\ + "file '${file_name}', os ${rdict['os']}, version "\ + "${rdict['version']}, name ${rdict['name']}, sha512 "\ "${rdict['SHA512']}" found_specd_ver_linux=1 break @@ -798,21 +891,55 @@ if [[ ${blk_count} -eq ${specd_ver_blk_count} ]]; then specd_ver_flag=0 - break + ## break fi (( blk_count-- )) else - line_key=$(echo "${line}" | cut -d ':' -f 1 | xargs) - line_value=$(echo "${line}" | cut -d ':' -f 2 | xargs) - if [[ "${line_key}" = "${salt_url_version}" ]]; then - # note blk_count encountered 'specd_ver', closing brace check - specd_ver_flag=1 - specd_ver_blk_count=${blk_count} - (( specd_ver_blk_count++ )) + if [[ ${POST_3005_FLAG} -eq 1 \ + && ${POST_3005_MAJOR_VER_FLAG} -eq 1 ]]; then + # doing major version check + line_major_key=$(echo "${line}" | cut -d ':' -f 1 | cut -d '-' -f 2 | cut -d '.' -f 1 |xargs) + line_key=$(echo "${line}" | cut -d ':' -f 1 | xargs) + line_value=$(echo "${line}" | cut -d ':' -f 2 | xargs) + _debug_log "$0:${FUNCNAME[0]} check line_major_key "\ + "'${line_major_key}' again salt_url_version "\ + "'${salt_url_version}', line_key '${line_key}', "\ + "line_value '${line_value}'" + if [[ "${line_major_key}" = "${salt_url_version}" ]]; then + # blk_count encountered 'specd_ver', closing brace check + specd_ver_flag=1 + specd_ver_blk_count=${blk_count} + (( specd_ver_blk_count++ )) + _debug_log "$0:${FUNCNAME[0]} found specd version, "\ + "version '${salt_url_version}' and line_major_key "\ + "'${line_major_key}', line_key '${line_key}' "\ + "specd_ver_blk_count '${specd_ver_blk_count}'" + else + rdict["${line_key}"]="${line_value}" + _debug_log "$0:${FUNCNAME[0]} updated dictionary for "\ + "major version with line_key '${line_key}' and "\ + "line_value '${line_value}'" + fi else - rdict["${line_key}"]="${line_value}" - _debug_log "$0:${FUNCNAME[0]} updated dictionary with"\ - "line_key '${line_key}' and line_value '${line_value}'" + line_key=$(echo "${line}" | cut -d ':' -f 1 | xargs) + line_value=$(echo "${line}" | cut -d ':' -f 2 | xargs) + _debug_log "$0:${FUNCNAME[0]} check line_key '${line_key}' "\ + "again salt_url_version '${salt_url_version}', "\ + "line_value '${line_value}'" + if [[ "${line_key}" = "${salt_url_version}" ]]; then + # blk_count encountered 'specd_ver', closing brace check + specd_ver_flag=1 + specd_ver_blk_count=${blk_count} + (( specd_ver_blk_count++ )) + _debug_log "$0:${FUNCNAME[0]} found specd version, "\ + "version '${salt_url_version}' and line_key "\ + "'${line_key}' and specd_ver_blk_count "\ + "'${specd_ver_blk_count}'" + else + rdict["${line_key}"]="${line_value}" + _debug_log "$0:${FUNCNAME[0]} updated dictionary with "\ + "line_key '${line_key}' and line_value '${line_value}'" + fi fi fi done <<< "${var2}" @@ -821,7 +948,7 @@ echo "${rdict['version']}:${rdict['name']}:${rdict['SHA512']}" else _error_log "$0:${FUNCNAME[0]} unable to parse version, name and "\ - "SHA512 from repo json file '${file_name}'" + "sha512 from repo json file '${file_name}'" # echo "" fi return 0 @@ -833,6 +960,19 @@ # # Retrieve the salt-minion from Salt repository # +# Note: +# pre_3006 The repo.json file only existed in one place (salt/onedir) +# and contained everything in the directory and sub-directories +# where the repo.json file resides. +# post_3005 There are two repo.json files: +# top level (salt/py3/onedir): +# repo.json contains 'latest' and 'major versions' only. +# minor level (salt/py3/onedir/minor): +# repo.json contains 'latest' and 'minor versions' only. +# +# With the 3006 release a breaking change in directory structure was introduced +# to bring conformity with directory structure used for packages. +# # Side Effects: # CURRENT_STATUS updated # @@ -854,6 +994,7 @@ local local_base_url="" local local_file_flag=0 + local local_count_repo_json=0 local salt_tarball="" local salt_tarball_SHA512="" @@ -863,43 +1004,88 @@ local salt_json_sha512="" local salt_pkg512="" - _debug_log "$0:${FUNCNAME[0]} retrieve the salt-minion and check"\ + local install_onedir_chk=0 + local sys_arch="" + + local ver_chk="" + local ver_chk_major="" + local ver_chk_minor="" + + _debug_log "$0:${FUNCNAME[0]} retrieve the salt-minion and check "\ "its validity" CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} mkdir -p ${base_salt_location} - cd ${base_salt_location} || return $? + ## cd ${base_salt_location} || return $? + cd "${WORK_DIR}" || return $? - # curl on Liux doesn't support file:// support - if echo "${base_url}" | grep -q '^/' ; then - local_base_url="${base_url}" - local_file_flag=1 - _debug_log "$0:${FUNCNAME[0]} using source '${local_base_url}'"\ - "from '${base_url}'" - elif echo "${base_url}" | grep -q '^file://' ; then - local_base_url="${base_url//file:/}" - local_file_flag=1 - _debug_log "$0:${FUNCNAME[0]} using source '${local_base_url}'"\ - "from '${base_url}'" + # check for pre-3006 or post-3005 and adjust base_url + # unless already defined by --source option + if [[ -z "${base_url}" ]]; then + _debug_log "$0:${FUNCNAME[0]} no source option used, determine "\ + "version attempting to install, version '${salt_url_version}" + _set_post_3005_flags_from_version else - _debug_log "$0:${FUNCNAME[0]} using source '${base_url}'" + _debug_log "$0:${FUNCNAME[0]} source url provided, need to scan for "\ + "pre 3006 / post 3005, and local file using base_url '${base_url}'" + + # curl on Linux doesn't support file:// support + if echo "${base_url}" | grep -q '^/' ; then + local_base_url="${base_url}" + local_file_flag=1 + _debug_log "$0:${FUNCNAME[0]} using source '${local_base_url}'"\ + "from '${base_url}'" + elif echo "${base_url}" | grep -q '^file://' ; then + local_base_url="${base_url//file:/}" + local_file_flag=1 + _debug_log "$0:${FUNCNAME[0]} using source '${local_base_url}'"\ + "from '${base_url}'" + else + _debug_log "$0:${FUNCNAME[0]} using non-local source '${base_url}'" + + ver_chk=$(echo "${base_url}" | grep 'salt/py3/onedir') + if [[ -n "${ver_chk}" ]]; then + POST_3005_FLAG=1 + _set_post_3005_flags_from_version + fi + fi fi - if [[ ${local_file_flag} -ne 0 ]]; then + if [[ ${local_file_flag} -eq 1 ]]; then # local absolute path # and allow for Linux handling multiple slashes - salt_url="${local_base_url}/${salt_url_version}" + + # need to determine if pre 3005 or post 3006 + local_count_repo_json=$(find "${local_base_url}" -name repo.json|wc -l) + if [[ ${local_count_repo_json} -eq 2 ]]; then + POST_3005_FLAG=1 + _set_post_3005_flags_from_version + else + _debug_log "$0:${FUNCNAME[0]} pre-3006 local install, for "\ + "'${salt_url_version}' using specified source "\ + "'${local_base_url}'" + fi + + if [[ ${POST_3005_FLAG} -eq 1 ]]; then + if [[ ${POST_3005_MAJOR_VER_FLAG} -eq 1 ]]; then + salt_url="${local_base_url}" + else + salt_url="${local_base_url}/minor" + fi + else + salt_url="${local_base_url}/${salt_url_version}" + fi if [[ -f "${salt_url}/${repo_json_file}" ]]; then - _debug_log "$0:${FUNCNAME[0]} successfully found file"\ - "'${repo_json_file}' in '${base_url}/${repo_json_file}'" + _debug_log "$0:${FUNCNAME[0]} successfully found file "\ + "'${repo_json_file}' in '${salt_url}/${repo_json_file}'" cp -a "${salt_url}/${repo_json_file}" . _retn=$? if [[ ${_retn} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} failed to find file" \ - "'${repo_json_file}' in specified location ${base_url},"\ + _error_log "$0:${FUNCNAME[0]} failed to find file "\ + "'${repo_json_file}' in specified location ${base_url}, "\ "error '${_retn}'" fi @@ -911,27 +1097,32 @@ echo "${json_version_name_sha}" | awk -F":" '{print $2}') salt_json_sha512=$(\ echo "${json_version_name_sha}" | awk -F":" '{print $3}') - _debug_log "$0:${FUNCNAME[0]} using repo.json values version"\ - "'${salt_json_version}', name '${salt_json_name}, sha512"\ + _debug_log "$0:${FUNCNAME[0]} using repo.json values version "\ + "'${salt_json_version}', name '${salt_json_name}, sha512 "\ "'${salt_json_sha512}'" salt_pkg_name="${salt_json_name}" - cp -a "${salt_url}/${salt_json_version}/${salt_pkg_name}" . + if [[ ${POST_3005_FLAG} -eq 1 \ + && ${POST_3005_MAJOR_VER_FLAG} -eq 1 ]]; then + cp -a "${salt_url}/minor/${salt_json_version}/${salt_pkg_name}" . + else + cp -a "${salt_url}/${salt_json_version}/${salt_pkg_name}" . + fi _retn=$? if [[ ${_retn} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} failed to find file" \ + _error_log "$0:${FUNCNAME[0]} failed to find file "\ "'${salt_pkg_name}' in specified location "\ "${salt_url}/${salt_json_version}, error '${_retn}'" fi - _debug_log "$0:${FUNCNAME[0]} successfully copied from"\ + _debug_log "$0:${FUNCNAME[0]} successfully copied from "\ "'${salt_url}/${salt_json_version}' to file '${salt_pkg_name}'" salt_pkg512=$(sha512sum "${salt_pkg_name}" |awk -F" " '{print $1}') if [[ "${salt_pkg512}" != "${salt_json_sha512}" ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} _error_log "$0:${FUNCNAME[0]} copied file "\ - "'${salt_url}/${salt_json_version}' failed to match"\ + "'${salt_url}/${salt_json_version}' failed to match "\ "checksum in file '${repo_json_file}'" fi else @@ -939,51 +1130,55 @@ # repo.json file is missing, look for 'latest' # directory with onedir files and retrieve files from it salt_url="${local_base_url}/${salt_url_version}" - salt_tarball="${salt_name}*-linux-amd64.tar.gz" - salt_tarball_SHA512="${salt_name}*_SHA512" - ## shellcheck cp -a ${salt_url}/${salt_tarball} . - cp -a "${salt_url}/${salt_name}"*-linux-amd64.tar.gz . + _debug_log "$0:${FUNCNAME[0]} current directory $(pwd)" + + cp -a "${salt_url}/${salt_name}"*-linux-*.tar.?z . _retn=$? if [[ ${_retn} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} failed to find file" \ - "'${salt_tarball}' in specified location ${salt_url},"\ + _error_log "$0:${FUNCNAME[0]} failed to find file "\ + "for Linux in specified location ${salt_url}, "\ "error '${_retn}'" fi - ## shellcheck cp -a ${salt_url}/${salt_tarball_SHA512} . + cp -a "${salt_url}/${salt_name}"*-linux-*.tar.?z.sha512 . 2>/dev/null cp -a "${salt_url}/${salt_name}"*_SHA512 . _retn=$? if [[ ${_retn} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} failed to find file" \ - "'${salt_tarball_SHA512}' in specified location ${salt_url},"\ + _error_log "$0:${FUNCNAME[0]} failed to find file "\ + "sha512 in specified location ${salt_url}, "\ "error '${_retn}'" fi ## shellcheck - ## salt_pkg_name=$(ls ${salt_tarball}) - ## salt_chksum_file=$(ls ${salt_tarball_SHA512}) - salt_pkg_name=$(ls "${salt_url}/${salt_name}"*-linux-amd64.tar.gz) - salt_chksum_file=$(ls "${salt_url}/${salt_name}"*_SHA512) - _debug_log "$0:${FUNCNAME[0]} successfully copied tarball from"\ - "'${salt_url}' to file '${salt_pkg_name}'" - _debug_log "$0:${FUNCNAME[0]} successfully coped checksum from"\ - "'${salt_url}' to file '${salt_chksum_file}'" + salt_chksum_file=$(ls "${salt_name}"*_SHA512) + salt_pkg_name=$(ls "${salt_name}"*-linux-amd64.tar.gz 2>/dev/null) + if [[ -z "${salt_pkg_name}" ]]; then + # failed to find pre-3006 linux tarball, + # attempt to find post-3005 with appro. arch + sys_arch="${MACHINE_ARCH}" + salt_chksum_file=$(ls "${salt_name}"*-linux-"${sys_arch}".tar.xz.sha512) + salt_pkg_name=$(ls "${salt_name}"*-linux-"${sys_arch}".tar.xz) + fi + _debug_log "$0:${FUNCNAME[0]} successfully copied tarball from "\ + "'${salt_url}' file '${salt_pkg_name}'" + _debug_log "$0:${FUNCNAME[0]} successfully coped checksum from "\ + "'${salt_url}' file '${salt_chksum_file}'" calc_sha512sum=$(grep "${salt_pkg_name}" \ "${salt_chksum_file}" | sha512sum --check --status) if [[ ${calc_sha512sum} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} downloaded file"\ - "'${salt_pkg_name}' failed to match checksum in file"\ + _error_log "$0:${FUNCNAME[0]} downloaded file "\ + "'${salt_pkg_name}' failed to match checksum in file "\ "'${salt_chksum_file}'" fi fi else # assume use curl for local or remote URI _curl_download "${repo_json_file}" "${base_url}/${repo_json_file}" - _debug_log "$0:${FUNCNAME[0]} successfully downloaded from"\ + _debug_log "$0:${FUNCNAME[0]} successfully downloaded from "\ "'${base_url}/${repo_json_file}' into file '${repo_json_file}'" if [[ -f "${repo_json_file}" ]]; then @@ -995,20 +1190,25 @@ echo "${json_version_name_sha}" | awk -F":" '{print $2}') salt_json_sha512=$(\ echo "${json_version_name_sha}" | awk -F":" '{print $3}') - _debug_log "$0:${FUNCNAME[0]} using repo.json values version"\ - "'${salt_json_version}', name '${salt_json_name}, sha512"\ - "'${salt_json_sha512}'" + _debug_log "$0:${FUNCNAME[0]} using repo.json values version "\ + "'${salt_json_version}', name '${salt_json_name}, sha512 "\ + "'${salt_json_sha512}'"/ salt_pkg_name="${salt_json_name}" - salt_url="${base_url}/${salt_json_version}/${salt_pkg_name}" + if [[ ${POST_3005_FLAG} -eq 1 \ + && ${POST_3005_MAJOR_VER_FLAG} -eq 1 ]]; then + salt_url="${base_url}/minor/${salt_json_version}/${salt_pkg_name}" + else + salt_url="${base_url}/${salt_json_version}/${salt_pkg_name}" + fi _curl_download "${salt_pkg_name}" "${salt_url}" - _debug_log "$0:${FUNCNAME[0]} successfully downloaded from"\ + _debug_log "$0:${FUNCNAME[0]} successfully downloaded from "\ "'${salt_url}' into file '${salt_pkg_name}'" salt_pkg512=$(sha512sum "${salt_pkg_name}" |awk -F" " '{print $1}') if [[ "${salt_pkg512}" != "${salt_json_sha512}" ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} downloaded file '${salt_url}'"\ + _error_log "$0:${FUNCNAME[0]} downloaded file '${salt_url}' "\ "failed to match checksum in file '${repo_json_file}'" fi else @@ -1016,7 +1216,7 @@ # repo.json file is missing, look for 'latest' # directory with onedir files and retrieve files from it salt_url="${base_url}/${salt_url_version}" - salt_tarball="${salt_name}*-linux-amd64.tar.gz" + salt_tarball="${salt_name}*-linux-*.tar.?z" salt_tarball_SHA512="${salt_name}*_SHA512" # assume http://, https:// or similar @@ -1024,51 +1224,91 @@ _retn=$? if [[ ${_retn} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} downloaded file"\ + _error_log "$0:${FUNCNAME[0]} downloaded file "\ "'${salt_tarball}' failed to download, error '${_retn}'" fi wget -q -r -l1 -nd -np -A "${salt_name}*_SHA512" "${salt_url}" _retn=$? if [[ ${_retn} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} downloaded file"\ + _error_log "$0:${FUNCNAME[0]} downloaded file "\ "'${salt_tarball_SHA512}' failed to download, error '${_retn}'" fi ## shellcheck - ## salt_pkg_name=$(ls ${salt_tarball}) - ## salt_chksum_file=$(ls ${salt_tarball_SHA512}) - salt_pkg_name=$(ls "${salt_url}/${salt_name}"*-linux-amd64.tar.gz) - salt_chksum_file=$(ls "${salt_url}/${salt_name}"*_SHA512) - _debug_log "$0:${FUNCNAME[0]} successfully downloaded tarball"\ + salt_chksum_file=$(ls "${salt_name}"*_SHA512) + salt_pkg_name=$(ls "${salt_name}"*-linux-amd64.tar.gz) + if [[ -z "${salt_pkg_name}" ]]; then + # failed to find pre-3006 linux tarball, + # attempt to find post-3005 with appro. arch + sys_arch="${MACHINE_ARCH}" + salt_chksum_file=$(ls "${salt_name}"*-linux-"${sys_arch}".tar.xz.sha512) + salt_pkg_name=$(ls "${salt_name}"*-linux-"${sys_arch}".tar.xz) + fi + _debug_log "$0:${FUNCNAME[0]} successfully downloaded tarball "\ "from '${salt_url}' into file '${salt_pkg_name}'" - _debug_log "$0:${FUNCNAME[0]} successfully downloaded checksum"\ + _debug_log "$0:${FUNCNAME[0]} successfully downloaded checksum "\ "from '${salt_url}' into file '${salt_chksum_file}'" calc_sha512sum=$(grep "${salt_pkg_name}" \ "${salt_chksum_file}" | sha512sum --check --status) if [[ ${calc_sha512sum} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} downloaded file"\ - "'${salt_pkg_name}' failed to match checksum in file"\ + _error_log "$0:${FUNCNAME[0]} downloaded file "\ + "'${salt_pkg_name}' failed to match checksum in file "\ "'${salt_chksum_file}'" fi fi fi _debug_log "$0:${FUNCNAME[0]} sha512sum match was successful" - tar xzf "${salt_pkg_name}" 1>/dev/null + if [[ ${POST_3005_FLAG} -eq 1 ]]; then + # need to setup salt user and group if not already existing + _debug_log "$0:${FUNCNAME[0]} setup salt user and group if not "\ + "already existing" + _SALT_GROUP=salt + _SALT_USER=salt + _SALT_NAME=Salt + # 1. create group if not existing + if getent group "${_SALT_GROUP}" 1>/dev/null; then + _debug_log "$0:${FUNCNAME[0]} already group salt, assume user "\ + "and group setup for Salt" + else + _debug_log "$0:${FUNCNAME[0]} setup group and user salt" + # create user to avoid running server as root + # 1. create group if not existing + groupadd --system "${_SALT_GROUP}" 2>/dev/null + # 2. create homedir if not existing + if [[ ! -d "${salt_dir}" ]]; then + mkdir -p "${salt_dir}" + fi + # 3. create user if not existing + if ! getent passwd | grep -q "^${_SALT_USER}:"; then + useradd --system --no-create-home -s /sbin/nologin -g \ + "${_SALT_GROUP}" "${_SALT_USER}" 2>/dev/null + fi + # 4. adjust passwd entry + usermod -c "${_SALT_NAME}" -d "${salt_dir}" -g "${_SALT_GROUP}" \ + "${_SALT_USER}" 2>/dev/null + fi + tar xf "${salt_pkg_name}" -C "${base_salt_location}" 1>/dev/null + # 5. adjust file and directory permissions + chown -R "${_SALT_USER}":"${_SALT_GROUP}" "${salt_dir}" + else + tar xf "${salt_pkg_name}" -C "${base_salt_location}" 1>/dev/null + fi _retn=$? if [[ ${_retn} -ne 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} tar xzf expansion of downloaded"\ + _error_log "$0:${FUNCNAME[0]} tar xf expansion of downloaded "\ "file '${salt_pkg_name}' failed, return code '${_retn}'" fi - if [[ ! -f ${test_exists_file} ]]; then + install_onedir_chk=$(_check_onedir_minion_install) + if [[ ${install_onedir_chk} -eq 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _error_log "$0:${FUNCNAME[0]} expansion of downloaded file"\ - "'${salt_url}' failed to provide critical file"\ - "'${test_exists_file}'" + _error_log "$0:${FUNCNAME[0]} expansion of downloaded file "\ + "'${salt_url}' failed to provide any onedir installed "\ + "critical files for salt-minion" fi CURRENT_STATUS=${STATUS_CODES_ARY[installed]} cd "${CURRDIR}" || return $? @@ -1084,33 +1324,38 @@ # check if more than one version of the script is running # # Results: -# Echos the number of scripts running, allowing for forks etc -# from bash etc, a single instance of the script returns 3 +# Checks the number of scripts running, allowing for forks etc +# from bash etc, as root a single instance of the script returns 3 +# as sudo root a single instance of the script returns 4 # _check_multiple_script_running() { local count=0 local procs_found="" - _info_log "$0:${FUNCNAME[0]} checking how many versions of the"\ + _info_log "$0:${FUNCNAME[0]} checking how many versions of the "\ "script are running" procs_found=$(pgrep -f "${SCRIPTNAME}") count=$(echo "${procs_found}" | wc -l) - _debug_log "$0:${FUNCNAME[0]} checking versions of script are running,"\ - "bashpid '${BASHPID}', processes found '${procs_found}',"\ + _debug_log "$0:${FUNCNAME[0]} checking versions of script are running, "\ + "bashpid '${BASHPID}', processes found '${procs_found}', "\ "and count '${count}'" - echo "${count}" + if [[ ${count} -gt 4 ]]; then + _error_log "$0:${FUNCNAME[0]} failed to check status, "\ + "multiple versions of the script are running" + fi + return 0 } # -# _check_std_minion_install +# _check_classic_minion_install # -# Check if standard salt-minion is installed for the OS +# Check if classic salt-minion is installed for the OS # for example: install salt-minion from rpm or deb package # # Results: @@ -1118,10 +1363,10 @@ # !0 - Standard install found and Salt version found output # -_check_std_minion_install() { +_check_classic_minion_install() { # checks for /usr/bin, then /usr/local/bin - # this catches 80% to 90% of the reqular cases + # this catches 80% to 90% of the regular cases # if salt-call is there, then so is a salt-minion # as they are installed together @@ -1135,17 +1380,21 @@ for idx in ${list_of_files_check} do - if [[ -f "${idx}" ]]; then + if [[ -h "${idx}" ]]; then + _debug_log "$0:${FUNCNAME[0]} found file '${idx}' "\ + "symbolic link, post-3005 installation" + break + elif [[ -f "${idx}" ]]; then #check size of file, if larger than 200, not script wrapper file local file_sz=0 file_sz=$(( $(wc -c < "${idx}") )) - _debug_log "$0:${FUNCNAME[0]} found file '${idx}',"\ + _debug_log "$0:${FUNCNAME[0]} found file '${idx}', "\ "size '${file_sz}'" if [[ ${file_sz} -gt ${max_file_sz} ]]; then # get salt-version local s_ver="" s_ver=$("${idx}" --local test.version |grep -v 'local:' |xargs) - _debug_log "$0:${FUNCNAME[0]} found standard salt-minion,"\ + _debug_log "$0:${FUNCNAME[0]} found standard salt-minion, "\ "Salt version: '${s_ver}'" echo "${s_ver}" _retn=1 @@ -1159,20 +1408,64 @@ # +# _check_onedir_minion_install +# +# Check if onedir pre_3006 or post_3005 salt-minion is installed on the OS +# for example: install salt-minion from rpm or deb package +# +# Results: +# Echos the following values: +# 0 - No onedir install found and empty string output +# 1 - pre_3006 onedir install found +# 2 - post_3005 onedir install found +# + +_check_onedir_minion_install() { + + # checks for following executables: + # post_3005 - /opt/saltstack/salt/salt-minion + # pre_3006 - /opt/saltstack/salt/run/run + + local _retn=0 + local pre_3006=1 + local post_3005=2 + + _info_log "$0:${FUNCNAME[0]} check if standard onedir-minion installed" + + if [[ -f "${list_of_onedir_locations_check[0]}" ]]; then + _debug_log "$0:${FUNCNAME[0]} found pre 3006 version of Salt, "\ + "at location ${list_of_onedir_locations_check[0]}" + _retn=${pre_3006} + elif [[ -f "${list_of_onedir_locations_check[1]}" ]]; then + _debug_log "$0:${FUNCNAME[0]} found post 3005 version of Salt, "\ + "at location ${list_of_onedir_locations_check[1]}" + _retn=${post_3005} + else + _debug_log "$0:${FUNCNAME[0]} failed to find a onedir installation" + fi + echo ${_retn} +} + + +# # _find_salt_pid # -# finds the pid for the salt process +# finds the pid for the Salt process # # Results: -# Echos ${salt_pid} which could be empty '' if salt process not found +# Echos ${salt_pid} which could be empty '' if Salt process not found # _find_salt_pid() { # find the pid for salt-minion if active local salt_pid=0 - salt_pid=$(pgrep -f "${salt_name}\/run\/run minion" | head -n 1 | - awk -F " " '{print $1}') - _debug_log "$0:${FUNCNAME[0]} checking for salt-minion process id,"\ + if [[ ${POST_3005_FLAG} -eq 1 ]]; then + salt_pid=$(pgrep -f "\/usr\/bin\/salt-minion" | head -n 1) + else + salt_pid=$(pgrep -f "${salt_name}\/run\/run minion" | head -n 1 | + awk -F " " '{print $1}') + fi + _debug_log "$0:${FUNCNAME[0]} checking for salt-minion process id, "\ "found '${salt_pid}'" echo "${salt_pid}" } @@ -1188,7 +1481,7 @@ # via systemd after it has been installed # # Side Effect: -# Updates salt-minion configuration file with generated identifer +# Updates salt-minion configuration file with generated identifier # if no valid FQDN # # Results: @@ -1203,18 +1496,18 @@ # quick check if id specified if grep -q '^id:' < "${salt_minion_conf_file}"; then - _debug_log "$0:${FUNCNAME[0]} salt-minion identifier found, no"\ + _debug_log "$0:${FUNCNAME[0]} salt-minion identifier found, no "\ "need to check further" return 0 fi - _debug_log "$0:${FUNCNAME[0]} ensuring salt-minion identifier or"\ + _debug_log "$0:${FUNCNAME[0]} ensuring salt-minion identifier or "\ "FQDN is specified for salt-minion configuration" minion_fqdn=$(/usr/bin/salt-call --local grains.get fqdn | grep -v 'local:' | xargs) if [[ -n "${minion_fqdn}" && "${minion_fqdn}" != "Unknown.example.org" ]]; then - _debug_log "$0:${FUNCNAME[0]} non-default salt-minion FQDN"\ + _debug_log "$0:${FUNCNAME[0]} non-default salt-minion FQDN "\ "'${minion_fqdn}' is specified for salt-minion configuration" return 0 fi @@ -1223,7 +1516,7 @@ local minion_genid="" minion_genid=$(_generate_minion_id) echo "id: ${minion_genid}" >> "${salt_minion_conf_file}" - _debug_log "$0:${FUNCNAME[0]} no salt-minion identifier found,"\ + _debug_log "$0:${FUNCNAME[0]} no salt-minion identifier found, "\ "generated identifier '${minion_genid}'" return 0 @@ -1231,35 +1524,35 @@ # -# _create_helper_scripts +# _create_pre_3006_helper_scripts # # Create helper scripts for salt-call and salt-minion # -# Example: _create_helper_scripts +# Example: _create_pre_3006_helper_scripts # # Results: # Exits with 0 or error code # -_create_helper_scripts() { +_create_pre_3006_helper_scripts() { for idx in ${salt_wrapper_file_list} do local abs_filepath="" abs_filepath="/usr/bin/salt-${idx}" - _debug_log "$0:${FUNCNAME[0]} creating helper file 'salt-${idx}'"\ + _debug_log "$0:${FUNCNAME[0]} creating helper file 'salt-${idx}' "\ "in directory /usr/bin" echo "#!/usr/bin/env bash # Copyright (c) 2021 VMware, Inc. All rights reserved. " > "${abs_filepath}" || { - _error_log "$0:${FUNCNAME[0]} failed to create helper file"\ + _error_log "$0:${FUNCNAME[0]} failed to create helper file "\ "'salt-${idx}' in directory /usr/bin, retcode '$?'"; } { - echo -n "exec /opt/saltstack/salt/run/run ${idx} "; + echo -n "exec /opt/saltstack/salt/run/run ${idx}"; echo -n "\"$"; echo -n "{"; echo -n "@"; @@ -1267,14 +1560,14 @@ echo -n "1}"; echo -n "\""; } >> "${abs_filepath}" || { - _error_log "$0:${FUNCNAME[0]} failed to finish creating helper"\ + _error_log "$0:${FUNCNAME[0]} failed to finish creating helper "\ "file 'salt-${idx}' in directory /usr/bin, retcode '$?'"; } echo "" >> "${abs_filepath}" # ensure executable chmod 755 "${abs_filepath}" || { - _error_log "$0:${FUNCNAME[0]} failed to make helper file"\ + _error_log "$0:${FUNCNAME[0]} failed to make helper file "\ "'salt-${idx}' executable in directory /usr/bin, retcode '$?'"; } done @@ -1293,6 +1586,7 @@ # 3 => installFailed # 4 => removing # 5 => removeFailed +# 6 => externalInstall # 126 => scriptFailed # # Side Effects: @@ -1305,42 +1599,55 @@ _status_fn() { # return status local _retn_status=${STATUS_CODES_ARY[notInstalled]} - local script_count=0 + local install_onedir_chk=0 + local found_salt_ver="" _info_log "$0:${FUNCNAME[0]} checking status for script" - script_count=$(_check_multiple_script_running) - if [[ ${script_count} -gt 3 ]]; then - _error_log "$0:${FUNCNAME[0]} failed to check status, " \ - "multiple versions of the script are running" - fi - svpid=$(_find_salt_pid) - if [[ ! -f "${test_exists_file}" && -z ${svpid} ]]; then - # check not installed and no process id - CURRENT_STATUS=${STATUS_CODES_ARY[notInstalled]} - _retn_status=${STATUS_CODES_ARY[notInstalled]} - elif [[ -f "${test_exists_file}" ]]; then - # check installed - CURRENT_STATUS=${STATUS_CODES_ARY[installed]} - _retn_status=${STATUS_CODES_ARY[installed]} - # normal case but double-check - svpid=$(_find_salt_pid) - if [[ -z ${svpid} ]]; then - # Note: someone could have stopped the salt-minion, - # so installed but not running, - # status codes don't allow for that case - CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} - _retn_status=${STATUS_CODES_ARY[installFailed]} + _check_multiple_script_running + + found_salt_ver=$(_check_classic_minion_install) + if [[ -n "${found_salt_ver}" ]]; then + _debug_log "$0:${FUNCNAME[0]}" \ + "existing Standard Salt Installation detected, "\ + "Salt version: '${found_salt_ver}'" + CURRENT_STATUS=${STATUS_CODES_ARY[externalInstall]} + _retn_status=${STATUS_CODES_ARY[externalInstall]} + else + _debug_log "$0:${FUNCNAME[0]} no standardized install found" + + install_onedir_chk=$(_check_onedir_minion_install) + if [[ ${install_onedir_chk} -eq 2 ]]; then + POST_3005_FLAG=1 # ensure note 3006 and above fi - elif [[ -z ${svpid} ]]; then - # check no process id and main directory still left, then removeFailed - if [[ -f "${test_exists_file}" ]]; then - CURRENT_STATUS=${STATUS_CODES_ARY[removeFailed]} - _retn_status=${STATUS_CODES_ARY[removeFailed]} + + svpid=$(_find_salt_pid) + if [[ ${install_onedir_chk} -eq 0 && -z ${svpid} ]]; then + # check not installed and no process id + CURRENT_STATUS=${STATUS_CODES_ARY[notInstalled]} + _retn_status=${STATUS_CODES_ARY[notInstalled]} + elif [[ ${install_onedir_chk} -ne 0 ]]; then + # check installed + CURRENT_STATUS=${STATUS_CODES_ARY[installed]} + _retn_status=${STATUS_CODES_ARY[installed]} + # normal case but double-check + svpid=$(_find_salt_pid) + if [[ -z ${svpid} ]]; then + # Note: someone could have stopped the salt-minion, + # so installed but not running, + # status codes don't allow for that case + CURRENT_STATUS=${STATUS_CODES_ARY[installFailed]} + _retn_status=${STATUS_CODES_ARY[installFailed]} + fi + elif [[ -z ${svpid} ]]; then + # check no process id and main directory still left, =>removeFailed + if [[ ${install_onedir_chk} -ne 0 ]]; then + CURRENT_STATUS=${STATUS_CODES_ARY[removeFailed]} + _retn_status=${STATUS_CODES_ARY[removeFailed]} + fi fi fi - return ${_retn_status} } @@ -1370,8 +1677,8 @@ } done if [[ -n "${error_missing_deps}" ]]; then - _error_log "$0:${FUNCNAME[0]} failed to find required"\ - "dependenices '${error_missing_deps}'"; + _error_log "$0:${FUNCNAME[0]} failed to find required "\ + "dependencies '${error_missing_deps}'"; fi return 0 } @@ -1408,7 +1715,7 @@ elif [[ -d "/usr/local/lib/systemd/system" ]]; then path_found="/usr/local/lib/systemd/system" else - _error_log "$0:${FUNCNAME[0]} unable to determine systemd"\ + _error_log "$0:${FUNCNAME[0]} unable to determine systemd "\ "library path to use" fi _debug_log "$0:${FUNCNAME[0]} found library path to use ${path_found}" @@ -1429,23 +1736,21 @@ _install_fn () { # execute install of Salt minion local _retn=0 - local script_count=0 local existing_chk="" local found_salt_ver="" + local install_onedir_chk=0 _info_log "$0:${FUNCNAME[0]} processing script install" - script_count=$(_check_multiple_script_running) - if [[ ${script_count} -gt 3 ]]; then - _error_log "$0:${FUNCNAME[0]} failed to install, " \ - "multiple versions of the script are running" - fi + _check_multiple_script_running - found_salt_ver=$(_check_std_minion_install) + found_salt_ver=$(_check_classic_minion_install) if [[ -n "${found_salt_ver}" ]]; then - _error_log "$0:${FUNCNAME[0]} failed to install, " \ - "existing Standard Salt Installation detected,"\ + _warning_log "$0:${FUNCNAME[0]} failed to install, "\ + "existing Standard Salt Installation detected, "\ "Salt version: '${found_salt_ver}'" + CURRENT_STATUS=${STATUS_CODES_ARY[externalInstall]} + exit ${STATUS_CODES_ARY[externalInstall]} else _debug_log "$0:${FUNCNAME[0]} no standardized install found" fi @@ -1458,52 +1763,70 @@ do local salt_fn="" salt_fn="$(basename "${idx}")" - _warning_log "$0:${FUNCNAME[0]} existing salt functionality"\ - "${salt_fn} shall be stopped and replaced when new"\ + _warning_log "$0:${FUNCNAME[0]} existing Salt functionality "\ + "${salt_fn} shall be stopped and replaced when new "\ "salt-minion is installed" done fi - # fetch salt-minion form repository + # fetch salt-minion from repository _fetch_salt_minion || { - _error_log "$0:${FUNCNAME[0]} failed to fetch salt-minion"\ + _error_log "$0:${FUNCNAME[0]} failed to fetch salt-minion "\ "from repository , retcode '$?'"; } # get configuration for salt-minion _fetch_vmtools_salt_minion_conf "$@" || { - _error_log "$0:${FUNCNAME[0]} failed, read configuration for"\ + _error_log "$0:${FUNCNAME[0]} failed, read configuration for "\ "salt-minion, retcode '$?'"; } - if [[ ${_retn} -eq 0 && -f "${test_exists_file}" ]]; then + if [[ ${_retn} -eq 0 && -f "${onedir_pre_3006_location}" ]]; then # create helper scripts for /usr/bin to ensure they are present # before attempting to use them in _ensure_id_or_fqdn - _debug_log "$0:${FUNCNAME[0]} creating helper files salt-call"\ + # this is for earlier than 3006 versions of Salt onedir + _debug_log "$0:${FUNCNAME[0]} creating helper files salt-call "\ "and salt-minion in directory /usr/bin" - _create_helper_scripts || { - _error_log "$0:${FUNCNAME[0]} failed to create helper files"\ + _create_pre_3006_helper_scripts || { + _error_log "$0:${FUNCNAME[0]} failed to create helper files "\ "salt-call or salt-minion in directory /usr/bin, retcode '$?'"; } + elif [[ ${_retn} -eq 0 && -f "${onedir_post_3005_location}" ]]; then + # create symbolic links for /usr/bin to ensure they are present + _debug_log "$0:${FUNCNAME[0]} creating symbolic links for salt-call "\ + "and salt-minion in directory /usr/bin" + ln -s -f "${salt_dir}/salt-minion" "/usr/bin/salt-minion" || { + _error_log "$0:${FUNCNAME[0]} failed to create symbolic link "\ + "for salt-minion in directory /usr/bin, retcode '$?'"; + } + ln -s -f "${salt_dir}/salt-call" "/usr/bin/salt-call" || { + _error_log "$0:${FUNCNAME[0]} failed to create symbolic link "\ + "for salt-call in directory /usr/bin, retcode '$?'"; + } + else + _error_log "$0:${FUNCNAME[0]} problems creating helper files "\ + "or symbolic links for salt-call or salt-minion in "\ + "directory /usr/bin, should not have reached this code point"; fi # ensure minion id or fqdn for salt-minion - _ensure_id_or_fqdn + _ensure_id_or_fqdn + install_onedir_chk=$(_check_onedir_minion_install) - if [[ ${_retn} -eq 0 && -f "${test_exists_file}" ]]; then + if [[ ${_retn} -eq 0 && ${install_onedir_chk} -ne 0 ]]; then if [[ -n "${existing_chk}" ]]; then - # be nice and stop any current salt functionalty found + # be nice and stop any current Salt functionality found for idx in ${existing_chk} do local salt_fn="" salt_fn="$(basename "${idx}")" - _warning_log "$0:${FUNCNAME[0]} stopping salt functionality"\ - " ${salt_fn} its replaced with new installed salt-minion" + _warning_log "$0:${FUNCNAME[0]} stopping Salt functionality "\ + "${salt_fn} it's replaced with new installed salt-minion" systemctl stop "${salt_fn}" || { - _warning_log "$0:${FUNCNAME[0]} stopping existing salt"\ - "functionality ${salt_fn} encountered difficulties"\ - "using systemctl, it will be over-written with the"\ - "new installed salt-minion regarlessly, retcode '$?'"; + _warning_log "$0:${FUNCNAME[0]} stopping existing Salt "\ + "functionality ${salt_fn} encountered difficulties "\ + "using systemctl, it will be over-written with the "\ + "new installed salt-minion regardless, retcode '$?'"; } done fi @@ -1513,44 +1836,35 @@ local systemd_lib_path="" systemd_lib_path=$(_find_system_lib_path) local name_service="salt-minion.service" - _debug_log "$0:${FUNCNAME[0]} copying systemd service script"\ + _debug_log "$0:${FUNCNAME[0]} copying systemd service script "\ "${name_service} to directory ${systemd_lib_path}" echo "${salt_minion_service_wrapper}" \ > "${systemd_lib_path}/${name_service}" || { - _error_log "$0:${FUNCNAME[0]} failed to copy systemd service"\ - "file ${name_service} to directory"\ + _error_log "$0:${FUNCNAME[0]} failed to copy systemd service "\ + "file ${name_service} to directory "\ "${systemd_lib_path}, retcode '$?'"; } - cd /etc/systemd/system || return $? - rm -f "${name_service}" - ln -s "${systemd_lib_path}/${name_service}" \ - "${name_service}" || { - _error_log "$0:${FUNCNAME[0]} failed to symbolic link"\ - "systemd service file ${name_service} in"\ - "directory /etc/systemd/system, retcode '$?'"; - } - _debug_log "$0:${FUNCNAME[0]} symbolically linked systemd service"\ - "file ${name_service} in directory /etc/systemd/system" + cd "${CURRDIR}" || return $? # start the salt-minion using systemd systemctl daemon-reload || { - _error_log "$0:${FUNCNAME[0]} reloading the systemd daemon"\ + _error_log "$0:${FUNCNAME[0]} reloading the systemd daemon "\ "failed , retcode '$?'"; } - _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl"\ + _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl "\ "daemon-reload" systemctl restart "${name_service}" || { - _error_log "$0:${FUNCNAME[0]} starting the salt-minion using"\ + _error_log "$0:${FUNCNAME[0]} starting the salt-minion using "\ "systemctl failed , retcode '$?'"; } - _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl"\ + _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl "\ "restart '${name_service}'" systemctl enable "${name_service}" || { - _error_log "$0:${FUNCNAME[0]} enabling the salt-minion using"\ + _error_log "$0:${FUNCNAME[0]} enabling the salt-minion using "\ "systemctl failed , retcode '$?'"; } - _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl"\ + _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl "\ "enable '${name_service}'" fi return ${_retn} @@ -1587,20 +1901,20 @@ local salt_source="" if [[ $# -ne 1 ]]; then - _error_log "$0:${FUNCNAME[0]} error expected one parameter"\ + _error_log "$0:${FUNCNAME[0]} error expected one parameter "\ "specifying the source for location of onedir files" fi - _info_log "$0:${FUNCNAME[0]} processing script source for location"\ + _info_log "$0:${FUNCNAME[0]} processing script source for location "\ "of onedir files" salt_source=$(echo "$1" | cut -d ' ' -f 1) - _debug_log "$0:${FUNCNAME[0]} input salt source is '${salt_source}'" + _debug_log "$0:${FUNCNAME[0]} input Salt source is '${salt_source}'" if [[ -n "${salt_source}" ]]; then base_url=${salt_source} fi - _debug_log "$0:${FUNCNAME[0]} input salt source for salt-minion to"\ + _debug_log "$0:${FUNCNAME[0]} input Salt source for salt-minion to "\ "install from is '${base_url}'" return ${_retn} @@ -1610,12 +1924,12 @@ # # _generate_minion_id # -# Searchs salt-minion configuration file for current id, and disables it -# and generates a new id based from the existng id found, +# Searches salt-minion configuration file for current id, and disables it +# and generates a new id based on the existing id found, # or an older commented out id, and provides it with a randomized 5 digit -# postpended to it, for example: myminion_12345 +# post-pended to it, for example: myminion_12345 # -# if no previous id found, a generated minion_ is output +# If no previous id found, a generated minion_ is output # # Side Effects: # Disables any id found in minion configuration file @@ -1648,7 +1962,7 @@ if [[ -n "${cfg_value}" ]]; then salt_id_flag=1 minion_id=$(_randomize_minion_id "${cfg_value}") - _debug_log "$0:${FUNCNAME[0]} found previously used id"\ + _debug_log "$0:${FUNCNAME[0]} found previously used id "\ "field, randomizing it" fi elif echo "${line_value}" | grep -q -w 'id:' ; then @@ -1659,7 +1973,7 @@ if [[ -n ${ifield} ]]; then minion_id=$(_randomize_minion_id "${ifield}") salt_id_flag=1 - _debug_log "$0:${FUNCNAME[0]} found previously used"\ + _debug_log "$0:${FUNCNAME[0]} found previously used "\ "id field, randomizing it" fi else @@ -1670,11 +1984,11 @@ if [[ ${salt_id_flag} -eq 0 ]]; then # no id field found, write minion_> "${salt_minion_conf_file}" - _debug_log "$0:${FUNCNAME[0]} updated salt-minion identifer"\ + _debug_log "$0:${FUNCNAME[0]} updated salt-minion identifier "\ "'${minion_id}' in configuration file '${salt_minion_conf_file}'" if [[ ${salt_minion_pre_active_flag} -eq 1 ]]; then # restart the stopped salt-minion using systemd systemctl restart salt-minion || { - _error_log "$0:${FUNCNAME[0]} failed to restart salt-minion"\ + _error_log "$0:${FUNCNAME[0]} failed to restart salt-minion "\ "using systemctl, retcode '$?'"; } - _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl"\ + _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl "\ "restart salt-minion" fi @@ -1791,12 +2102,12 @@ # _remove_installed_files_dirs() { - _debug_log "$0:${FUNCNAME[0]} removing directories and files"\ + _debug_log "$0:${FUNCNAME[0]} removing directories and files "\ "in '${list_file_dirs_to_remove}'" for idx in ${list_file_dirs_to_remove} do rm -fR "${idx}" || { - _error_log "$0:${FUNCNAME[0]} failed to remove file or"\ + _error_log "$0:${FUNCNAME[0]} failed to remove file or "\ "directory '${idx}' , retcode '$?'"; } done @@ -1820,58 +2131,78 @@ _uninstall_fn () { # remove Salt minion local _retn=0 - local script_count=0 + local found_salt_ver="" + local install_onedir_chk=0 _info_log "$0:${FUNCNAME[0]} processing script remove" - script_count=$(_check_multiple_script_running) - if [[ ${script_count} -gt 3 ]]; then - _error_log "$0:${FUNCNAME[0]} failed to remove,"\ - "multiple versions of the script are running" - fi + _check_multiple_script_running - found_salt_ver=$(_check_std_minion_install) + found_salt_ver=$(_check_classic_minion_install) if [[ -n "${found_salt_ver}" ]]; then - _error_log "$0:${FUNCNAME[0]} failed to remove,"\ - "existing Standard Salt Installation detected,"\ + _warning_log "$0:${FUNCNAME[0]} failed to install, "\ + "existing Standard Salt Installation detected, "\ "Salt version: '${found_salt_ver}'" + CURRENT_STATUS=${STATUS_CODES_ARY[externalInstall]} + exit ${STATUS_CODES_ARY[externalInstall]} else _debug_log "$0:${FUNCNAME[0]} no standardized install found" fi - if [[ ! -f "${test_exists_file}" ]]; then + install_onedir_chk=$(_check_onedir_minion_install) + if [[ ${install_onedir_chk} -eq 0 ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[notInstalled]} - # assumme rest is gone + # assume rest is gone # TBD enhancement, could loop thru and check all of files to remove # and if salt_pid empty but we error out if issues when uninstalling, # so safe for now. _retn=0 else CURRENT_STATUS=${STATUS_CODES_ARY[removing]} - svpid=$(_find_salt_pid) - if [[ -n ${svpid} ]]; then - # stop the active salt-minion using systemd - # and give it a little time to stop - systemctl stop salt-minion || { - _error_log "$0:${FUNCNAME[0]} failed to stop salt-minion"\ - "using systemctl, retcode '$?'"; - } - _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl"\ - "stop salt-minion" - systemctl disable salt-minion || { - _error_log "$0:${FUNCNAME[0]} disabling the salt-minion"\ - "using systemctl failed , retcode '$?'"; + # remove salt-minion from systemd + # and give it a little time to stop + systemctl stop salt-minion || { + _error_log "$0:${FUNCNAME[0]} failed to stop salt-minion "\ + "using systemctl, retcode '$?'"; + } + _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl "\ + "stop salt-minion" + systemctl disable salt-minion || { + _error_log "$0:${FUNCNAME[0]} disabling the salt-minion "\ + "using systemctl failed , retcode '$?'"; + } + _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl "\ + "disable salt-minion" + + _debug_log "$0:${FUNCNAME[0]} removing systemd directories and files "\ + "in '${list_files_systemd_to_remove}'" + for idx in ${list_files_systemd_to_remove} + do + rm -fR "${idx}" || { + _error_log "$0:${FUNCNAME[0]} failed to remove file or "\ + "directory '${idx}' , retcode '$?'"; } - _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl"\ - "disable salt-minion" - fi + done + + systemctl daemon-reload || { + _error_log "$0:${FUNCNAME[0]} reloading the systemd daemon "\ + "failed , retcode '$?'"; + } + _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl "\ + "daemon-reload" + systemctl reset-failed || { + _error_log "$0:${FUNCNAME[0]} reloading the systemd daemon "\ + "failed , retcode '$?'"; + } + _debug_log "$0:${FUNCNAME[0]} successfully executed systemctl "\ + "reset-failed" if [[ ${_retn} -eq 0 ]]; then svpid=$(_find_salt_pid) if [[ -n ${svpid} ]]; then - _debug_log "$0:${FUNCNAME[0]} found salt-minion process"\ - "id '${salt_pid}', systemctl stop should have"\ + _debug_log "$0:${FUNCNAME[0]} found salt-minion process "\ + "id '${salt_pid}', systemctl stop should have "\ "eliminated it, killing it now" kill "${svpid}" ## given it a little time @@ -1880,12 +2211,12 @@ svpid=$(_find_salt_pid) if [[ -n ${svpid} ]]; then CURRENT_STATUS=${STATUS_CODES_ARY[removeFailed]} - _error_log "$0:${FUNCNAME[0]} failed to kill the"\ + _error_log "$0:${FUNCNAME[0]} failed to kill the "\ "salt-minion, pid '${svpid}' during uninstall" else _remove_installed_files_dirs || { - _error_log "$0:${FUNCNAME[0]} failed to remove all"\ - "installed salt-minion files and directories,"\ + _error_log "$0:${FUNCNAME[0]} failed to remove all "\ + "installed salt-minion files and directories, "\ "retcode '$?'"; } CURRENT_STATUS=${STATUS_CODES_ARY[notInstalled]} @@ -1893,7 +2224,7 @@ fi fi - _info_log "$0:${FUNCNAME[0]} successfuly removed salt-minion and"\ + _info_log "$0:${FUNCNAME[0]} successfully removed salt-minion and "\ "associated files and directories" return ${_retn} } @@ -1923,20 +2254,20 @@ if [[ ${count_f} -gt ${LOG_FILE_NUMBER} ]]; then # allow for org-0 for ((i=count_f-1; i>=LOG_FILE_NUMBER; i--)); do - _debug_log "$0:${FUNCNAME[0]} removing log file"\ - "'${found_f_ary[i]}', for count '${i}',"\ + _debug_log "$0:${FUNCNAME[0]} removing log file "\ + "'${found_f_ary[i]}', for count '${i}', "\ "limit '${LOG_FILE_NUMBER}'" rm -f "${found_f_ary[i]}" || { - _error_log "$0:${FUNCNAME[0]} failed to remove file"\ - "'${found_f_ary[i]}', for count '${i}',"\ + _error_log "$0:${FUNCNAME[0]} failed to remove file "\ + "'${found_f_ary[i]}', for count '${i}', "\ "limit '${LOG_FILE_NUMBER}'" } done else - _debug_log "$0:${FUNCNAME[0]} found '${count_f}'"\ - "log files starting with"\ - "${log_dir}/vmware-${SCRIPTNAME}-${idx}-"\ - ", limit '${LOG_FILE_NUMBER}'" + _debug_log "$0:${FUNCNAME[0]} found '${count_f}' "\ + "log files starting with "\ + "${log_dir}/vmware-${SCRIPTNAME}-${idx}-, "\ + "limit '${LOG_FILE_NUMBER}'" fi done return 0 @@ -1948,6 +2279,20 @@ CURRDIR=$(pwd) +# get machine architecture once +MACHINE_ARCH=$(uname -m) + +# setup work-area +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# the temp working directory used, within $DIR +WORK_DIR=$(mktemp -d -p "$DIR") + +# check if temp working dir was created +if [[ ! "${WORK_DIR}" || ! -d "${WORK_DIR}" ]]; then + echo "Could not create temp dir" + exit 1 +fi + # default status is notInstalled CURRENT_STATUS=${STATUS_CODES_ARY[notInstalled]} export CURRENT_STATUS @@ -1956,7 +2301,7 @@ ## YearMontDayHourMinuteSecondMicrosecond aka jid logdate=$(date -u +%Y%m%d%H%M%S) -# set logging infomation +# set logging information LOG_FILE_NUMBER=5 SCRIPTNAME=$(basename "$0") mkdir -p "${log_dir}" @@ -2056,7 +2401,6 @@ retn=$? fi if [[ ${SOURCE_FLAG} -eq 1 ]]; then - echo "DGM SOURCE source params ${SOURCE_PARAMS}" CLI_ACTION=1 LOG_ACTION="install" # ensure this is processed before install @@ -2098,7 +2442,7 @@ # since none presented on the command line gvar_action=$(vmtoolsd --cmd "info-get ${guestvars_salt_desiredstate}" \ 2>/dev/null) || { - _warning_log "$0 unable to retrieve any action arguments from"\ + _warning_log "$0 unable to retrieve any action arguments from "\ "guest variables ${guestvars_salt_desiredstate}, retcode '$?'"; } diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/containerInfo.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/containerInfo.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/containerInfo.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/containerInfo.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2021-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/containerInfo_docker.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/containerInfo_docker.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/containerInfo_docker.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/containerInfo_docker.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/containerInfo_grpc.cc open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/containerInfo_grpc.cc --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/containerInfo_grpc.cc 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/containerInfo_grpc.cc 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2021-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/containerInfoInt.h open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/containerInfoInt.h --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/containerInfoInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/containerInfoInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/Makefile.am open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/containerInfo/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/containerInfo/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (c) 2021-2022 VMware, Inc. All rights reserved. +### Copyright (c) 2021-2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -36,7 +36,7 @@ libcontainerInfo_la_SOURCES += containerInfo.c libcontainerInfo_la_SOURCES += containerInfo_docker.c -libcontainerInfo_la_LDFLAGS += -lcurl +libcontainerInfo_la_LIBADD += -lcurl libcontainerInfo_la_CPPFLAGS += @CURL_CPPFLAGS@ libcontainerInfo_la_LIBADD += ../../../lib/jsmn/libJsmn.la @@ -60,9 +60,9 @@ libcontainerInfo_la_SOURCES += containers.grpc.pb.cc libcontainerInfo_la_SOURCES += containerInfo_grpc.cc -libcontainerInfo_la_CPPFLAGS += @GRPC_CPPFLAGS@ -libcontainerInfo_la_LDFLAGS += -lprotobuf -libcontainerInfo_la_LDFLAGS += -lgrpc++ +libcontainerInfo_la_CPPFLAGS += ${grpcxx_CFLAGS} +libcontainerInfo_la_LIBADD += -lprotobuf +libcontainerInfo_la_LIBADD += ${grpcxx_LIBS} tasks.grpc.pb.cc containers.grpc.pb.cc: %.grpc.pb.cc : %.proto %.pb.cc $(PROTOC) -I. -I$(GOGO_PROTOPATH) \ diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/desktopEvents/x11Lock.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/desktopEvents/x11Lock.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/desktopEvents/x11Lock.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/desktopEvents/x11Lock.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2018,2022 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2018,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/copyPasteCompatX11.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2005-2019,2022 VMware, Inc. All rights reserved. + * Copyright (c) 2005-2019,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2009-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.h open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.h --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2018 VMware, Inc. All rights reserved. + * Copyright (c) 2009-2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2019 VMware, Inc. All rights reserved. + * Copyright (c) 2007-2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -381,7 +381,7 @@ DnDReadBuffer(&r, &msg->cmd, sizeof msg->cmd) && DnDReadBuffer(&r, &msg->nargs, sizeof msg->nargs) && DnDReadBuffer(&r, &msg->expectedArgsSz, sizeof msg->expectedArgsSz)) { - /* Sanity checks. */ + /* Confidence checks. */ if (msg->expectedArgsSz < DNDMSG_MAX_ARGSZ && (msg->cmd < DND_MAX || msg->cmd < CP_MAX) && 0 < msg->cmd && diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.h open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.h --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2017 VMware, Inc. All rights reserved. + * Copyright (c) 2007-2017, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -46,7 +46,7 @@ DNDMSG_ERR, DNDMSG_NOMEM, DNDMSG_INPUT_TOO_SMALL, /* Input buffer needs to be bigger. */ - DNDMSG_INPUT_ERR, /* Serialize/unserialized failed sanity checks. */ + DNDMSG_INPUT_ERR, /* Serialize/unserialized failed confidence checks. */ } DnDMsgErr; /* diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dndcp.cpp open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dndcp.cpp --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dndcp.cpp 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dndcp.cpp 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2017,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2017,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2009-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/stringxx/autoCPtr.hh open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/stringxx/autoCPtr.hh --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/stringxx/autoCPtr.hh 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/stringxx/autoCPtr.hh 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2014-2018 VMware, Inc. All rights reserved. + * Copyright (c) 2014-2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/stringxx/string.cc open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/stringxx/string.cc --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/stringxx/string.cc 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/stringxx/string.cc 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2019,2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2019,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/stringxx/ubstr_t.hh open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/stringxx/ubstr_t.hh --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/dndcp/stringxx/ubstr_t.hh 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/dndcp/stringxx/ubstr_t.hh 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2019,2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2019,2021-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/gdp/gdpPlugin.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/gdp/gdpPlugin.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/gdp/gdpPlugin.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/gdp/gdpPlugin.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/guestInfo/guestInfoServer.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/guestInfo/guestInfoServer.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/guestInfo/guestInfoServer.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/guestInfo/guestInfoServer.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2022 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -93,7 +93,7 @@ #if defined(_WIN32) #define GUESTINFO_DEFAULT_IFACE_EXCLUDES "vEthernet*" #else -#define GUESTINFO_DEFAULT_IFACE_EXCLUDES "docker*,veth*,virbr*" +#define GUESTINFO_DEFAULT_IFACE_EXCLUDES "docker*,veth*,virbr*,antrea-*,cali*" #endif /* diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2019,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2019,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2019-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/powerOps/powerOps.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/powerOps/powerOps.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/powerOps/powerOps.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/powerOps/powerOps.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2016, 2018-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2016, 2018-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/resolutionSet/resolutionCommon.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/resolutionSet/resolutionCommon.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/resolutionSet/resolutionCommon.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/resolutionSet/resolutionCommon.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2016-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2016-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/resolutionSet/resolutionRandR12.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/resolutionSet/resolutionRandR12.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/resolutionSet/resolutionRandR12.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/resolutionSet/resolutionRandR12.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2017,2019-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2017,2019-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/resolutionSet/resolutionX11.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/resolutionSet/resolutionX11.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/resolutionSet/resolutionX11.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/resolutionSet/resolutionX11.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2021 VMware, Inc. All rights reserved. + * Copyright (C) 2020-2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -24,6 +24,7 @@ */ #include +#include "str.h" #include "serviceDiscoveryInt.h" #include "vmware.h" @@ -45,21 +46,24 @@ VM_EMBED_VERSION(VMTOOLSD_VERSION_STRING); #endif +#if defined(_WIN32) +#include +#endif + + #define NSDB_PRIV_GET_VALUES_CMD "namespace-priv-get-values" #define NSDB_PRIV_SET_KEYS_CMD "namespace-priv-set-keys" #if defined (_WIN32) -#define SCRIPT_EXTN ".bat" +#define SCRIPT_EXTN ".ps1" /* * Scripts used by plugin in Windows guests to capture information about * running services. */ -#define SERVICE_DISCOVERY_SCRIPT_PERFORMANCE_METRICS \ - "get-performance-metrics" SCRIPT_EXTN -#define SERVICE_DISCOVERY_WIN_SCRIPT_RELATIONSHIP "get-parent-child-rels" \ - SCRIPT_EXTN +#define SERVICE_DISCOVERY_SCRIPT_PERFORMANCE_METRICS "get-performance-metrics" SCRIPT_EXTN +#define SERVICE_DISCOVERY_WIN_SCRIPT_RELATIONSHIP "get-parent-child-rels" SCRIPT_EXTN #define SERVICE_DISCOVERY_WIN_SCRIPT_NET "net-share" SCRIPT_EXTN #define SERVICE_DISCOVERY_WIN_SCRIPT_IIS_PORTS "get-iis-ports-info" SCRIPT_EXTN #define SERVICE_DISCOVERY_WIN_SCRIPT_SHAREPOINT_PORTS "get-sharepoint-ports-info" SCRIPT_EXTN @@ -79,12 +83,13 @@ #endif +static gchar* scriptInstallDir = NULL; + /* * Scripts used by plugin in both Windows and Linux guests to capture * information about running services. */ -#define SERVICE_DISCOVERY_SCRIPT_PROCESSES "get-listening-process-info" \ - SCRIPT_EXTN +#define SERVICE_DISCOVERY_SCRIPT_PROCESSES "get-listening-process-info" SCRIPT_EXTN #define SERVICE_DISCOVERY_SCRIPT_CONNECTIONS "get-connection-info" SCRIPT_EXTN #define SERVICE_DISCOVERY_SCRIPT_VERSIONS "get-versions" SCRIPT_EXTN @@ -947,7 +952,7 @@ cycle++; for (i = 0; i < gFullPaths->len; i++) { KeyNameValue tmp = g_array_index(gFullPaths, KeyNameValue, i); - if (!ExecuteScript(ctx, tmp.keyName, tmp.val)) { + if (!ExecuteScript(ctx, tmp.keyName, tmp.val, scriptInstallDir)) { g_debug("%s: ExecuteScript failed for script %s\n", __FUNCTION__, tmp.val); if (isGDPWriteReady && gSkipThisTask && !isNDBWriteReady) { @@ -1214,6 +1219,9 @@ gServiceDiscoveryTimeoutSource = NULL; } + g_free(scriptInstallDir); + scriptInstallDir = NULL; + if (gFullPaths != NULL) { int i = 0; guint len = gFullPaths->len; @@ -1225,7 +1233,6 @@ } } - /* ***************************************************************************** * ConstructScriptPaths -- @@ -1239,7 +1246,6 @@ ConstructScriptPaths(void) { int i; - gchar *scriptInstallDir; #if !defined(OPEN_VM_TOOLS) gchar *toolsInstallDir; #endif @@ -1250,30 +1256,26 @@ gFullPaths = g_array_sized_new(FALSE, TRUE, sizeof(KeyNameValue), ARRAYSIZE(gKeyScripts)); - + if (scriptInstallDir == NULL) { #if defined(OPEN_VM_TOOLS) - scriptInstallDir = Util_SafeStrdup(VMTOOLS_SERVICE_DISCOVERY_SCRIPTS); + scriptInstallDir = Util_SafeStrdup(VMTOOLS_SERVICE_DISCOVERY_SCRIPTS); #else - toolsInstallDir = GuestApp_GetInstallPath(); - scriptInstallDir = g_strdup_printf("%s%s%s%s%s", toolsInstallDir, DIRSEPS, + toolsInstallDir = GuestApp_GetInstallPath(); + scriptInstallDir = g_strdup_printf("%s%s%s%s%s", toolsInstallDir, DIRSEPS, "serviceDiscovery", DIRSEPS, "scripts"); - g_free(toolsInstallDir); + g_free(toolsInstallDir); #endif - + } for (i = 0; i < ARRAYSIZE(gKeyScripts); ++i) { KeyNameValue tmp; tmp.keyName = g_strdup_printf("%s", gKeyScripts[i].keyName); #if defined(_WIN32) - tmp.val = g_strdup_printf("\"%s%s%s\"", scriptInstallDir, - DIRSEPS, gKeyScripts[i].val); + tmp.val = ConstructPWSScriptCommand(gKeyScripts[i].val); #else - tmp.val = g_strdup_printf("%s%s%s", scriptInstallDir, DIRSEPS, - gKeyScripts[i].val); + tmp.val = g_strdup_printf("%s%s%s", scriptInstallDir, DIRSEPS, gKeyScripts[i].val); #endif g_array_insert_val(gFullPaths, i, tmp); } - - g_free(scriptInstallDir); } @@ -1324,7 +1326,7 @@ */ if (!TOOLS_IS_MAIN_SERVICE(ctx)) { g_info("%s: Not running in vmsvc daemon: container name='%s'.\n", - __FUNCTION__, ctx->name); + __FUNCTION__, ctx->name); return NULL; } if (ctx->rpc != NULL) { @@ -1343,7 +1345,7 @@ sizeof *regs, ARRAYSIZE(regs)); /* - * Append scripts absolute paths based on installation dirs. + * Append scripts execution command line */ ConstructScriptPaths(); diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryInt.h open-vm-tools-12.3.0/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryInt.h --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -61,6 +61,13 @@ Bool ExecuteScript(ToolsAppCtx *ctx, const char *key, - const char *script); + const char *script, + const char *workingDir); + +#if defined (_WIN32) + +char* ConstructPWSScriptCommand(const char *scriptFileName); + +#endif #endif /* _SERVICEDISCOVERYINT_H_ */ diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -80,6 +80,7 @@ * @param[in] ctx The application context * @param[in] key Script name * @param[in] script Script to be executed + * @param[in] workingDir Script working dir * * @retval TRUE Successfully executed script and sent output to gdp daemon. * @retval FALSE Otherwise. @@ -90,7 +91,8 @@ Bool ExecuteScript(ToolsAppCtx *ctx, const char *key, - const char *script) + const char *script, + const char *workingDir) { Bool status; gchar *command = g_strdup(script); @@ -101,7 +103,7 @@ GError *p_error = NULL; DynBuf err; - status = g_spawn_async_with_pipes(NULL, // const gchar *working_directory + status = g_spawn_async_with_pipes(workingDir, // const gchar *working_directory cmd, // gchar **argv NULL, // gchar **envp G_SPAWN_DEFAULT, // GSpawnFlags flags @@ -169,4 +171,4 @@ g_free(command); return status; -} +} \ No newline at end of file diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/foundryToolsDaemon.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/foundryToolsDaemon.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/foundryToolsDaemon.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/foundryToolsDaemon.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2003-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -545,6 +545,8 @@ GKeyFile *confDictRef = ctx->config; Bool enableNullDriver; GSource *timer; + char *excludedFileSystems; + Bool ignoreFrozenFS; /* * Parse the arguments @@ -581,10 +583,18 @@ "vmbackup", "enableNullDriver", FALSE); + excludedFileSystems = VMTools_ConfigGetString(confDictRef, + "vmbackup", + "excludedFileSystems", + NULL); + ignoreFrozenFS = VMTools_ConfigGetBoolean(confDictRef, + "vmbackup", + "ignoreFrozenFileSystems", + FALSE); /* Perform the actual freeze. */ if (!SyncDriver_Freeze(driveList, enableNullDriver, &gSyncDriverHandle, - NULL) || + excludedFileSystems, ignoreFrozenFS) || SyncDriver_QueryStatus(gSyncDriverHandle, INFINITE) != SYNCDRIVER_IDLE) { g_warning("%s: Failed to Freeze drives '%s'\n", __FUNCTION__, driveList); diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/vixPlugin.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/vixPlugin.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/vixPlugin.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/vixPlugin.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2019 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -76,6 +76,31 @@ /** + * Sends vix capabilites. + * + * @param[in] src The source object. + * @param[in] ctx Unused. + * @param[in] set Whether capabilities are being set. + * @param[in] data Unused. + * + * @return List of capabilities. + */ + +static GArray * +VixCapabilitiesCb(gpointer src, + ToolsAppCtx *ctx, + gboolean set, + gpointer data) +{ + const ToolsAppCapability caps[] = { + { TOOLS_CAP_NEW, NULL, CAP_HOST_VERIFIED_SAML_TOKEN, 1}, + }; + + return VMTools_WrapArray(caps, sizeof *caps, ARRAYSIZE(caps)); +} + + +/** * Returns the registration data for either the guestd or userd process. * * @param[in] ctx The application context. @@ -103,7 +128,8 @@ ToolsDaemonTcloMountHGFS, NULL, NULL, NULL, 0 }, }; ToolsPluginSignalCb sigs[] = { - { TOOLS_CORE_SIG_SHUTDOWN, VixShutdown, ®Data } + { TOOLS_CORE_SIG_SHUTDOWN, VixShutdown, ®Data }, + { TOOLS_CORE_SIG_CAPABILITIES, VixCapabilitiesCb, NULL } }; ToolsAppReg regs[] = { { TOOLS_APP_GUESTRPC, VMTools_WrapArray(rpcs, sizeof *rpcs, ARRAYSIZE(rpcs)) }, diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/vixTools.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/vixTools.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/vixTools.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/vixTools.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2023 VMware, Inc. All rights reserved. + * Copyright (c) 2007-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -132,9 +132,11 @@ /* * No support for userworld. Enable support for open vm tools when * USE_VGAUTH is defined. + * + * XXX - Currently no support for vgauth in Windows on arm64. */ #if ((defined(__linux__) && !defined(USERWORLD)) || defined(_WIN32)) && \ - (!defined(OPEN_VM_TOOLS) || defined(USE_VGAUTH)) + (!defined(OPEN_VM_TOOLS) || defined(USE_VGAUTH)) && !defined(_ARM64_) #define SUPPORT_VGAUTH 1 #else #define SUPPORT_VGAUTH 0 @@ -161,32 +163,6 @@ static gboolean gSupportVGAuth = USE_VGAUTH_DEFAULT; static gboolean QueryVGAuthConfig(GKeyFile *confDictRef); -#ifdef _WIN32 -/* - * Check bug 2508431 for more details. If an application is not built - * with proper flags, 'creating a remote thread' to get the process - * command line will crash the target process. To avoid any such crash, - * 'remote thread' approach is not used by default. - * - * But 'remote thread' approach can be turned on (for whatever reason) - * by setting the following option to true in the tools.conf file. - * - * For few processes, 'WMI' can provide detailed commandline information. - * But using 'WMI' is a heavy weight approach and may affect the CPU - * performance and hence it is disabled by default. It can always be - * turned on by a setting (as mentioned below) in the tools.conf file. - */ -#define VIXTOOLS_CONFIG_USE_REMOTE_THREAD_PROCESS_COMMAND_LINE \ - "useRemoteThreadForProcessCommandLine" - -#define VIXTOOLS_CONFIG_USE_WMI_PROCESS_COMMAND_LINE \ - "useWMIForProcessCommandLine" - -#define USE_REMOTE_THREAD_PROCESS_COMMAND_LINE_DEFAULT FALSE -#define USE_WMI_PROCESS_COMMAND_LINE_DEFAULT FALSE - -#endif - #if ALLOW_LOCAL_SYSTEM_IMPERSONATION_BYPASS static gchar *gCurrentUsername = NULL; @@ -221,6 +197,32 @@ #endif +#ifdef _WIN32 +/* + * Check bug 2508431 for more details. If an application is not built + * with proper flags, 'creating a remote thread' to get the process + * command line will crash the target process. To avoid any such crash, + * 'remote thread' approach is not used by default. + * + * But 'remote thread' approach can be turned on (for whatever reason) + * by setting the following option to true in the tools.conf file. + * + * For few processes, 'WMI' can provide detailed commandline information. + * But using 'WMI' is a heavy weight approach and may affect the CPU + * performance and hence it is disabled by default. It can always be + * turned on by a setting (as mentioned below) in the tools.conf file. + */ +#define VIXTOOLS_CONFIG_USE_REMOTE_THREAD_PROCESS_COMMAND_LINE \ + "useRemoteThreadForProcessCommandLine" + +#define VIXTOOLS_CONFIG_USE_WMI_PROCESS_COMMAND_LINE \ + "useWMIForProcessCommandLine" + +#define USE_REMOTE_THREAD_PROCESS_COMMAND_LINE_DEFAULT FALSE +#define USE_WMI_PROCESS_COMMAND_LINE_DEFAULT FALSE + +#endif + /* * This should be an allocated string containing the impersonated username * while impersonation is active, and NULL when its not. @@ -724,6 +726,7 @@ VixError GuestAuthSAMLAuthenticateAndImpersonate( char const *obfuscatedNamePassword, Bool loadUserProfile, + Bool hostVerified, void **userToken); void GuestAuthUnimpersonate(); @@ -8043,6 +8046,7 @@ } #if SUPPORT_VGAUTH case VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN: + case VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN_HOST_VERIFIED: { VixCommandSAMLToken *samlStruct = (VixCommandSAMLToken *) credentialField; @@ -8237,10 +8241,16 @@ } #if SUPPORT_VGAUTH - else if (VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN == credentialType) { + else if ((VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN == credentialType) + || (VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN_HOST_VERIFIED == credentialType) + ) { if (GuestAuthEnabled()) { + Bool hostVerified = + (credentialType == VIX_USER_CREDENTIAL_SAML_BEARER_TOKEN_HOST_VERIFIED) + ? TRUE : FALSE; err = GuestAuthSAMLAuthenticateAndImpersonate(obfuscatedNamePassword, loadUserProfile, + hostVerified, userToken); } else { err = VIX_E_NOT_SUPPORTED; @@ -11860,6 +11870,7 @@ GuestAuthSAMLAuthenticateAndImpersonate( char const *obfuscatedNamePassword, // IN Bool loadUserProfile, // IN + Bool hostVerified, // IN void **userToken) // OUT { #if SUPPORT_VGAUTH @@ -11870,6 +11881,7 @@ VGAuthError vgErr; VGAuthUserHandle *newHandle = NULL; VGAuthExtraParams extraParams[1]; + VGAuthExtraParams hostVerfiedParams[1]; Bool impersonated = FALSE; extraParams[0].name = VGAUTH_PARAM_LOAD_USER_PROFILE; @@ -11891,11 +11903,14 @@ goto done; } + hostVerfiedParams[0].name = VGAUTH_PARAM_SAML_HOST_VERIFIED; + hostVerfiedParams[0].value = hostVerified ? VGAUTH_PARAM_VALUE_TRUE : + VGAUTH_PARAM_VALUE_FALSE; vgErr = VGAuth_ValidateSamlBearerToken(ctx, token, username, - 0, - NULL, + (int)ARRAYSIZE(hostVerfiedParams), + hostVerfiedParams, &newHandle); #if ALLOW_LOCAL_SYSTEM_IMPERSONATION_BYPASS /* @@ -11941,6 +11956,7 @@ token, username, gCurrentUsername, + hostVerified, userToken, ¤tUserHandle); goto done; diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/vixToolsEnvVars.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/vixToolsEnvVars.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/vixToolsEnvVars.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/vixToolsEnvVars.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2018, 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2018, 2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/vixToolsInt.h open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/vixToolsInt.h --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vix/vixToolsInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vix/vixToolsInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2020,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -204,6 +204,9 @@ const char *token, const char *username, char *serviceUsername, +#ifdef VMTOOLS_FS_VGAUTH_HOST_VERIFICATION + Bool hostVerified, +#endif void **userToken, VGAuthUserHandle **curUserHandle); #endif // _WIN32 diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vmbackup/nullProvider.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/vmbackup/nullProvider.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vmbackup/nullProvider.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vmbackup/nullProvider.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2016, 2022 VMware, Inc. All rights reserved. + * Copyright (c) 2010-2016, 2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vmbackup/stateMachine.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/vmbackup/stateMachine.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vmbackup/stateMachine.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vmbackup/stateMachine.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2007-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -1073,9 +1073,13 @@ #if defined(__linux__) gBackupState->excludedFileSystems = VMBACKUP_CONFIG_GET_STR(ctx->config, "excludedFileSystems", NULL); - g_debug("Using excludedFileSystems = \"%s\"\n", + gBackupState->ignoreFrozenFS = + VMBACKUP_CONFIG_GET_BOOL(ctx->config, "ignoreFrozenFileSystems", FALSE); + + g_debug("Using excludedFileSystems = \"%s\", ignoreFrozenFileSystems = %d\n", (gBackupState->excludedFileSystems != NULL) ? - gBackupState->excludedFileSystems : "(null)"); + gBackupState->excludedFileSystems : "(null)", + gBackupState->ignoreFrozenFS); #endif g_debug("Quiescing volumes: %s", (gBackupState->volumes) ? gBackupState->volumes : "(null)"); @@ -1506,7 +1510,7 @@ g_debug("%s - vmbackup NVMe feature is %s\n", __FUNCTION__, enableNVMe ? "enabled" : "disabled"); - caps[0].value = enableNVMe && set ? 1 : 0; + caps[0].value = enableNVMe && set ? 1 : 0; return VMTools_WrapArray(caps, sizeof *caps, ARRAYSIZE(caps)); } diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vmbackup/syncDriverOps.c open-vm-tools-12.3.0/open-vm-tools/services/plugins/vmbackup/syncDriverOps.c --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vmbackup/syncDriverOps.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vmbackup/syncDriverOps.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2019, 2021 VMware, Inc. All rights reserved. + * Copyright (C) 2007-2019, 2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -276,7 +276,8 @@ useNullDriverPrefs ? state->enableNullDriver : FALSE, op->syncHandle, - state->excludedFileSystems); + state->excludedFileSystems, + state->ignoreFrozenFS); break; case OP_THAW: op->manifest = SyncNewManifest(state, *op->syncHandle); diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/plugins/vmbackup/vmBackupInt.h open-vm-tools-12.3.0/open-vm-tools/services/plugins/vmbackup/vmBackupInt.h --- open-vm-tools-12.2.5/open-vm-tools/services/plugins/vmbackup/vmBackupInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/plugins/vmbackup/vmBackupInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2019 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -100,18 +100,22 @@ * Don't modify the fields directly - rather, use VmBackup_SetCurrentOp, * which does most of the handling needed by users of the state machine. * - * NOTE: The thread for freeze operation modifies currentOp in BackupState - * which is also accessed by the AsyncCallback driving the state - * machine (run by main thread). Also, gcc might generate two - * instructions for writing a 64-bit value. Therefore, protect the - * access to currentOp and related fields using opLock mutex. + * NOTE 1: The thread for freeze operation modifies currentOp in BackupState + * which is also accessed by the AsyncCallback driving the state + * machine (run by main thread). Also, gcc might generate two + * instructions for writing a 64-bit value. Therefore, protect the + * access to currentOp and related fields using opLock mutex. + * + * NOTE 2: Only used by Linux guests, ignored on Windows guests and is + * initialized to "false" when the VmBackupState is initialized + * at the start of a backup operation. */ typedef struct VmBackupState { ToolsAppCtx *ctx; VmBackupOp *currentOp; const char *currentOpName; - GMutex opLock; // See note above + GMutex opLock; // See note 1 above char *volumes; char *snapshots; guint pollPeriod; @@ -127,6 +131,7 @@ Bool allowHWProvider; Bool execScripts; Bool enableNullDriver; + Bool ignoreFrozenFS; // See note 2 above Bool needsPriv; gchar *scriptArg; guint timeout; diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/vmtoolsd/cmdLine.c open-vm-tools-12.3.0/open-vm-tools/services/vmtoolsd/cmdLine.c --- open-vm-tools-12.2.5/open-vm-tools/services/vmtoolsd/cmdLine.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/vmtoolsd/cmdLine.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/vmtoolsd/mainLoop.c open-vm-tools-12.3.0/open-vm-tools/services/vmtoolsd/mainLoop.c --- open-vm-tools-12.2.5/open-vm-tools/services/vmtoolsd/mainLoop.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/vmtoolsd/mainLoop.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -45,8 +45,8 @@ #include "vmware/tools/utils.h" #include "vmware/tools/vmbackup.h" -#if defined(_WIN32) || \ - (defined(__linux__) && !defined(USERWORLD)) +#if (defined(_WIN32) && !defined(_ARM64_)) || \ + (defined(__linux__) && !defined(USERWORLD)) # include "vmware/tools/guestStore.h" # include "globalConfig.h" #endif @@ -55,7 +55,7 @@ * guestStoreClient library is needed for both GuestStore-based tools upgrade * and also for GlobalConfig module. */ -#if defined(_WIN32) || defined(GLOBALCONFIG_SUPPORTED) +#if (defined(_WIN32) && !defined(_ARM64_)) || defined(GLOBALCONFIG_SUPPORTED) # include "guestStoreClient.h" #endif @@ -118,8 +118,8 @@ static void ToolsCoreCleanup(ToolsServiceState *state) { -#if defined(_WIN32) || \ - (defined(__linux__) && !defined(USERWORLD)) +#if (defined(_WIN32) && !defined(_ARM64_)) || \ + (defined(__linux__) && !defined(USERWORLD)) if (state->mainService) { /* * Shut down guestStore plugin first to prevent worker threads from being @@ -137,7 +137,7 @@ } #endif -#if defined(_WIN32) || defined(GLOBALCONFIG_SUPPORTED) +#if (defined(_WIN32) && !defined(_ARM64_)) || defined(GLOBALCONFIG_SUPPORTED) /* * guestStoreClient library is needed for both GuestStore-based tools * upgrade and also for GlobalConfig module. @@ -472,7 +472,7 @@ } #endif -#if defined(_WIN32) || defined(GLOBALCONFIG_SUPPORTED) +#if (defined(_WIN32) && !defined(_ARM64_)) || defined(GLOBALCONFIG_SUPPORTED) /* * guestStoreClient library is needed for both GuestStore-based tools * upgrade and also for GlobalConfig module. @@ -1201,6 +1201,9 @@ #else state->ctx.mainLoop = g_main_loop_new(gctx, FALSE); #endif + /* + * TODO: Build vmcheck library + */ state->ctx.isVMware = VmCheck_IsVirtualWorld(); g_main_context_unref(gctx); diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/vmtoolsd/mainPosix.c open-vm-tools-12.3.0/open-vm-tools/services/vmtoolsd/mainPosix.c --- open-vm-tools-12.2.5/open-vm-tools/services/vmtoolsd/mainPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/vmtoolsd/mainPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2020,2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2020,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/services/vmtoolsd/toolsCoreInt.h open-vm-tools-12.3.0/open-vm-tools/services/vmtoolsd/toolsCoreInt.h --- open-vm-tools-12.2.5/open-vm-tools/services/vmtoolsd/toolsCoreInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/services/vmtoolsd/toolsCoreInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -32,7 +32,8 @@ #include #include #include -#if defined(_WIN32) || (defined(__linux__) && !defined(USERWORLD)) +#if (defined(_WIN32) && !defined(_ARM64_)) || \ + (defined(__linux__) && !defined(USERWORLD)) /* Need this header for GLOBALCONFIG_SUPPORTED definition.*/ #include "globalConfig.h" #endif diff -Nru open-vm-tools-12.2.5/open-vm-tools/tests/Makefile.am open-vm-tools-12.3.0/open-vm-tools/tests/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/tests/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/tests/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -24,6 +24,7 @@ + STATICLIBS = *.a LTLIBS = *.la diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/de.vmsg open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/de.vmsg --- open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/de.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/de.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2010-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/en.vmsg open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/en.vmsg --- open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/en.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/en.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2010-2017,2020-2021 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017,2020-2021 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/es.vmsg open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/es.vmsg --- open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/es.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/es.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2010-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/fr.vmsg open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/fr.vmsg --- open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/fr.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/fr.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2010-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/it.vmsg open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/it.vmsg --- open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/it.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/it.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2010-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/ja.vmsg open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/ja.vmsg --- open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/ja.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/ja.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2010-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/ko.vmsg open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/ko.vmsg --- open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/ko.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/ko.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2010-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/zh_CN.vmsg open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/zh_CN.vmsg --- open-vm-tools-12.2.5/open-vm-tools/toolbox/l10n/zh_CN.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/l10n/zh_CN.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2010-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2010-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/toolbox-cmd.c open-vm-tools-12.3.0/open-vm-tools/toolbox/toolbox-cmd.c --- open-vm-tools-12.2.5/open-vm-tools/toolbox/toolbox-cmd.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/toolbox-cmd.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-config.c open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-config.c --- open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-config.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-config.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2016,2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2016,2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-globalconf.c open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-globalconf.c --- open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-globalconf.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-globalconf.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-gueststore.c open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-gueststore.c --- open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-gueststore.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-gueststore.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2019-2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-info.c open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-info.c --- open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-info.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-info.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2015-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2015-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxCmdInt.h open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxCmdInt.h --- open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxCmdInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxCmdInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-logging.c open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-logging.c --- open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-logging.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-logging.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2015-2016,2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2015-2016,2020-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -22,11 +22,11 @@ * Various logging operations for toolbox-cmd. * * Note: - * Servicenames are not sanity checked. This means it can report + * Servicenames are not confidence checked. This means it can report * the default value for a bogus servicename, or setting values for - * an unsupported servicename. But any sanity checking would require + * an unsupported servicename. But any confidence checking would require * all possible servicenames to #define themselves. Lack of - * a sanity check overrrides this complexity. + * a confidence check overrrides this complexity. * * TODO: This currently just modifies the tools.conf file, which means * that if tools is running, it can talke up to 5 seconds to react @@ -49,7 +49,7 @@ * * LoggingCheckLevel -- * - * Sanity check logging level. + * Confidence check logging level. * * Results: * Returns TRUE if its a valid logging level, FALSE if not. diff -Nru open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-scripts.c open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-scripts.c --- open-vm-tools-12.2.5/open-vm-tools/toolbox/toolboxcmd-scripts.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/toolbox/toolboxcmd-scripts.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2016,2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2016,2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/tools.conf open-vm-tools-12.3.0/open-vm-tools/tools.conf --- open-vm-tools-12.2.5/open-vm-tools/tools.conf 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/tools.conf 2023-08-31 14:38:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2019-2023 VMware, Inc. All rights reserved. # "CAUTION: tools.conf is highly syntax sensitive file. Use extreme caution # while editing it. If modified, it is automatically re-loaded by @@ -232,7 +232,7 @@ # Set a comma separated list of network interface names that shall be ignored. # Interface names can use wildcards like '*' and '?'. # Default for Linux and all non-Windows: -#exclude-nics=veth*,docker*,virbr* +#exclude-nics=veth*,docker*,virbr*,antrea-*,cali* # Default for Windows: #exclude-nics=vEthernet* @@ -395,6 +395,29 @@ #excludedFileSystems= +# Linux: +# It is possible that filesystems are being frozen in pre-freeze scripts +# to control the order in which those specific filesystems are to be frozen. +# The vmtoolsd process must be informed of all such filesystems with the help +# of "excludedFileSystems" setting of tools.conf. +# +# A temporary workaround is available (starting from 12.3.0) for admins to allow +# quiesceing operation to succeed until the "excludedFileSystems" list +# is configured. +# +# If another process thaws the file system while a quiescing operation +# operation is ongoing, the snapshot may be compromised. Once the +# "excludedFileSystems" list is configured this setting MUST be unset (or set +# to false). +# +# The value of ignoreFrozenFileSystems is a true or false; the default is +# false. +# +# Set to true to ignore pre-frozen file systems during the quiescing operation. +# +# ignoreFrozenFileSystems is Linux only (Not supported on Windows). +#ignoreFrozenFileSystems=false + # execScripts specifies whether to execute scripts as part of the quiescing # operation. Scripts are executed from the scripts directory along with the # legacy scripts. @@ -508,3 +531,13 @@ # Set to true to deactivate the deviceHelper plugin. #disabled=false + +[gitray] + +# The gitray plugin is only available for Windows +# with Complete VMTools install or with File +# Introspection Custom install. + +# By default the gitray plugin is enabled +# To disable gitray user plugin set +#enabled=false diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/de.vmsg open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/de.vmsg --- open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/de.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/de.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2011-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2011-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/es.vmsg open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/es.vmsg --- open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/es.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/es.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2011-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2011-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/fr.vmsg open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/fr.vmsg --- open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/fr.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/fr.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2011-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2011-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/ja.vmsg open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/ja.vmsg --- open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/ja.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/ja.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2011-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2011-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/ko.vmsg open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/ko.vmsg --- open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/ko.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/ko.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2011-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2011-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/zh_CN.vmsg open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/zh_CN.vmsg --- open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/zh_CN.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/zh_CN.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2011-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2011-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/zh_TW.vmsg open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/zh_TW.vmsg --- open-vm-tools-12.2.5/open-vm-tools/vgauth/cli/l10n/zh_TW.vmsg 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/cli/l10n/zh_TW.vmsg 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ########################################################## -# Copyright (C) 2011-2017,2020-2022 VMware, Inc. All rights reserved. +# Copyright (c) 2011-2017,2020-2022 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/common/certverify.c open-vm-tools-12.3.0/open-vm-tools/vgauth/common/certverify.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/common/certverify.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/common/certverify.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016, 2018-2019, 2021-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016, 2018-2019, 2021-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/common/usercheck.c open-vm-tools-12.3.0/open-vm-tools/vgauth/common/usercheck.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/common/usercheck.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/common/usercheck.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016,2019 VMware, Inc. All rights reserved. + * Copyright (C) 2011-2016,2019,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -347,19 +347,14 @@ * The illegal character list appears to be: * * Windows /\@[]:;|=,+*?<>" - * Note that '\' is valid with a domain username; this is - * the restricted list for local usernames. * Ubuntu /\[]:;|=,*<>"!(){}?$@%^&' * Rhel /\[]:;|=,*<>"!(){}?$@%^&'+ * + * Note that '\' is valid with a domain username; this is the + * restricted list for local usernames. */ size_t len; -#ifdef _WIN32 - // allow '\' in for Windows domain usernames char *illegalChars = "<>/"; -#else - char *illegalChars = "\\<>/"; -#endif len = strlen(userName); if (strcspn(userName, illegalChars) != len) { diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/common/VGAuthProto.h open-vm-tools-12.3.0/open-vm-tools/vgauth/common/VGAuthProto.h --- open-vm-tools-12.2.5/open-vm-tools/vgauth/common/VGAuthProto.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/common/VGAuthProto.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -21,6 +21,8 @@ #include "VGAuthError.h" +/* clang-format off */ + /* * @file VGAuthProto.h * @@ -107,6 +109,7 @@ #define VGAUTH_COMMENT_ELEMENT_NAME "comment" #define VGAUTH_ALIAS_ELEMENT_NAME "alias" #define VGAUTH_VALIDATE_ONLY_ELEMENT_NAME "validateOnly" +#define VGAUTH_HOST_VERIFIED_ELEMENT_NAME "hostVerified" /* * Complex types @@ -603,10 +606,14 @@ * SAML token, and does not create an access token on Windows. This * flag is ignored on *ix. * + * If hostVerified is set, then the service will skip the signature + * check in the SAML token. + * * Request: * SAML token * user * validateOnly (bool) + * hostVerified (bool) * => * user * token (empty for non-Windows) @@ -615,14 +622,17 @@ #define VGAUTH_REQUESTVALIDATESAMLBEARERTOKEN_ELEMENT_NAME "ValidateSamlBToken" + #define VGAUTH_VALIDATESAMLBEARERTOKEN_REQUEST_FORMAT \ VGAUTH_REQUEST_FORMAT_START \ "<"VGAUTH_REQUESTNAME_ELEMENT_NAME">"VGAUTH_REQUESTVALIDATESAMLBEARERTOKEN_ELEMENT_NAME"" \ "<"VGAUTH_SAMLTOKEN_ELEMENT_NAME">%s" \ "<"VGAUTH_USERNAME_ELEMENT_NAME">%s" \ "<"VGAUTH_VALIDATE_ONLY_ELEMENT_NAME">%s" \ + "<"VGAUTH_HOST_VERIFIED_ELEMENT_NAME">%s" \ VGAUTH_REQUEST_FORMAT_END + #define VGAUTH_VALIDATESAMLBEARERTOKEN_REPLY_FORMAT_START \ VGAUTH_REPLY_FORMAT_START \ "<"VGAUTH_USERNAME_ELEMENT_NAME">%s" \ @@ -637,4 +647,5 @@ VGAUTH_USERHANDLESAMLINFO_FORMAT_END \ VGAUTH_REPLY_FORMAT_END +/* clang-format on */ #endif // _VGAUTHPROTO_H_ diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/common/vmxlog.c open-vm-tools-12.3.0/open-vm-tools/vgauth/common/vmxlog.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/common/vmxlog.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/common/vmxlog.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2018-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2018-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/common/vmxrpc.c open-vm-tools-12.3.0/open-vm-tools/vgauth/common/vmxrpc.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/common/vmxrpc.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/common/vmxrpc.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2022 VMware, Inc. All rights reserved. + * Copyright (c) 2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/common/vmxrpc.h open-vm-tools-12.3.0/open-vm-tools/vgauth/common/vmxrpc.h --- open-vm-tools-12.2.5/open-vm-tools/vgauth/common/vmxrpc.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/common/vmxrpc.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2022 VMware, Inc. All rights reserved. + * Copyright (c) 2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/alias.c open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/alias.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/alias.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/alias.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -220,7 +220,7 @@ ****************************************************************************** * VGAuthValidateSubject -- */ /** * - * @brief Does a sanity check on a Subject paramter. + * @brief Does a confidence check on a Subject parameter. * * @remark Can be called by any user. * diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/auth.c open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/auth.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/auth.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/auth.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2017 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2017,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -409,13 +409,18 @@ * authenticated. * * - * @remark One @a extraParams is supported: + * @remark Supported @a extraParams: * VGAUTH_PARAM_VALIDATE_INFO_ONLY, which must have the value * VGAUTH_PARAM_VALUE_TRUE or VGAUTH_PARAM_VALUE_FALSE. * If set, SAML token validation is done, but the returned * @a handle cannot be used for impersonation or ticket * creation. * + * VGAUTH_PARAM_SAML_HOST_VERIFIED, which must have the value + * VGAUTH_PARAM_VALUE_TRUE or VGAUTH_PARAM_VALUE_FALSE. + * If set, the SAML token has been verified by the host + * and this service will skip that step when validating. + * * @param[in] ctx The VGAuthContext. * @param[in] samlToken The SAML token to be validated. * @param[in] userName The user to authenticate as. Optional. @@ -453,6 +458,7 @@ VGAuthError err; VGAuthUserHandle *newHandle = NULL; gboolean validateOnly; + gboolean hostVerified; /* * arg check @@ -491,9 +497,17 @@ if (VGAUTH_E_OK != err) { return err; } + err = VGAuthGetBoolExtraParam(numExtraParams, extraParams, + VGAUTH_PARAM_SAML_HOST_VERIFIED, + FALSE, + &hostVerified); + if (VGAUTH_E_OK != err) { + return err; + } err = VGAuth_SendValidateSamlBearerTokenRequest(ctx, validateOnly, + hostVerified, samlToken, userName, &newHandle); diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/common.c open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/common.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/common.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/common.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2017 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2017, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -553,7 +553,7 @@ * @li VGAuth debug messages will use the glib loglevel @b G_LOG_LEVEL_DEBUG. * * Note that any bad utf8 string arguments will be passed through - * unmodified, so an error handler may want to sanity check the data. + * unmodified, so an error handler may want to confidence check the data. * * @remark Can be called by any user. * diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/Makefile.am open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2014-2016 VMware, Inc. All rights reserved. +### Copyright (C) 2014-2016,2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as @@ -59,7 +59,7 @@ libvgauth_la_LDFLAGS += -Wl,-z,defs # Needed for OS's that don't link shared libraries against libc by #default, e.g. FreeBSD -libvgauth_la_LDFLAGS += -Wl,-lc +libvgauth_la_LIBADD += -lc # Message catalogs. install-data-hook: diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/netPosix.c open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/netPosix.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/netPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/netPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016,2019,2022 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016,2019,2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/proto.c open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/proto.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/proto.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/proto.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2012-2017, 2019-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2012-2017, 2019-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -108,7 +108,7 @@ /* * The client knows what its expecting back, which is - * used as a sanity check against what's actually read, + * used as a confidence check against what's actually read, * as well as telling us what to allocate for complex replies. */ ProtoReplyType expectedReplyType; @@ -1141,7 +1141,7 @@ /* ****************************************************************************** - * Proto_SanityCheckReply -- */ /** + * Proto_ConfidenceCheckReply -- */ /** * * Verifies a reply is internally consistent and the type is what we expected. * @@ -1155,7 +1155,7 @@ */ static VGAuthError -Proto_SanityCheckReply(ProtoReply *reply, +Proto_ConfidenceCheckReply(ProtoReply *reply, int expectedSequenceNumber) { #if VGAUTH_PROTO_TRACE @@ -1274,10 +1274,10 @@ Proto_DumpReply(reply); #endif - err = Proto_SanityCheckReply(reply, ctx->comm.sequenceNumber); + err = Proto_ConfidenceCheckReply(reply, ctx->comm.sequenceNumber); if (VGAUTH_E_OK != err) { - Warning("%s: reply sanity check failed\n", __FUNCTION__); + Warning("%s: reply confidence check failed\n", __FUNCTION__); goto quit; } @@ -2066,6 +2066,7 @@ VGAuthError VGAuth_SendValidateSamlBearerTokenRequest(VGAuthContext *ctx, gboolean validateOnly, + gboolean hostVerified, const char *samlToken, const char *userName, VGAuthUserHandle **userHandle) @@ -2097,7 +2098,8 @@ ctx->comm.sequenceNumber, samlToken, userName ? userName : "", - validateOnly ? "1" : "0"); + validateOnly ? "1" : "0", + hostVerified ? "1" : "0"); err = VGAuth_CommSendData(ctx, packet); if (VGAUTH_E_OK != err) { diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/VGAuthInt.h open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/VGAuthInt.h --- open-vm-tools-12.2.5/open-vm-tools/vgauth/lib/VGAuthInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/lib/VGAuthInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2017 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2017,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -243,12 +243,17 @@ int *num, // OUT VGAuthMappedAlias **maList); // OUT +/* clang-format off */ VGAuthError VGAuth_SendValidateSamlBearerTokenRequest(VGAuthContext *ctx, gboolean validateOnly, + gboolean hostVerified, const char *samlToken, const char *userName, VGAuthUserHandle **userHandle); + +/* clang-format on */ + VGAuthError VGAuth_CreateHandleForUsername(VGAuthContext *ctx, const char *userName, VGAuthUserHandleType type, diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/Makefile.am open-vm-tools-12.3.0/open-vm-tools/vgauth/Makefile.am --- open-vm-tools-12.2.5/open-vm-tools/vgauth/Makefile.am 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/Makefile.am 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ ################################################################################ -### Copyright (C) 2014-2017 VMware, Inc. All rights reserved. +### Copyright (c) 2014-2017,2023 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/public/VGAuthAuthentication.h open-vm-tools-12.3.0/open-vm-tools/vgauth/public/VGAuthAuthentication.h --- open-vm-tools-12.2.5/open-vm-tools/vgauth/public/VGAuthAuthentication.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/public/VGAuthAuthentication.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2019 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2019,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -198,6 +198,8 @@ #define VGAUTH_PARAM_VALIDATE_INFO_ONLY "validateInfoOnly" +# define VGAUTH_PARAM_SAML_HOST_VERIFIED "hostVerified" + VGAuthError VGAuth_ValidateSamlBearerToken(VGAuthContext *ctx, const char *samlToken, const char *userName, diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/alias.c open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/alias.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/alias.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/alias.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -420,7 +420,7 @@ * ServiceLoadAliasFileContents -- */ /** * * Securely loads an alias or mapping file, preventing TOCTOU (Time of Check, - * Time of Use) bugs. This also provides a size sanity check, preventing + * Time of Use) bugs. This also provides a size confidence check, preventing * a DoS attack. * * Steps: @@ -518,7 +518,7 @@ goto done; } - // sanity check size + // confidence check size if ((fileAttrs.nFileSizeHigh != 0) || (fileAttrs.nFileSizeLow > ALIASSTORE_FILE_MAX_SIZE)) { Warning("%s: size of %s too large %d %d; failing read\n", __FUNCTION__, @@ -781,7 +781,7 @@ } /* - * Now the sanity checks. + * Now the confidence checks. */ if (lstatBuf.st_size != fstatBuf.st_size) { Warning("%s: size of %s changed (%d vs %d)\n", __FUNCTION__, @@ -818,7 +818,7 @@ } /* - * All sanity checks passed; read the bits. + * All confidence checks passed; read the bits. */ toRead = lstatBuf.st_size; buf = g_malloc0(toRead + 1); @@ -1879,7 +1879,7 @@ /* - * Do some sanity checks on the files. + * Do some confidence checks on the files. */ if (NULL != srcAliasFilename) { if (g_file_test(aliasFilename, G_FILE_TEST_EXISTS) && @@ -3086,7 +3086,7 @@ * * If we fail to rename a bad file, the function returns an error. * - * XXX add contents/XML sanity check too? + * XXX add contents/XML confidence check too? * * @return VGAUTH_E_OK on success, VGAuthError on failure * @@ -3396,7 +3396,7 @@ } /* - * Sanity check the alias store. + * Confidence check the alias store. */ err = ServiceValidateAliases(); } diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/filePosix.c open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/filePosix.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/filePosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/filePosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -293,7 +293,7 @@ * be looked up, assume the user has been removed or we have a network * user issue, and ignore the ownership check. * - * Returns the uids found for subsequent sanity checks. + * Returns the uids found for subsequent confidence checks. * * @param[in] fileName The file name. * @param[in] userName The expected owner. diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/netPosix.c open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/netPosix.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/netPosix.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/netPosix.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2017, 2019-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2017, 2019-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/proto.c open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/proto.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/proto.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/proto.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016,2019-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016,2019-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -80,6 +80,7 @@ PARSE_STATE_USERHANDLESAMLINFO, PARSE_STATE_USERHANDLESAMLSUBJECT, PARSE_STATE_SAML_VALIDATE_ONLY, + PARSE_STATE_SAML_HOST_VERIFIED, } ProtoParseState; /* @@ -146,6 +147,7 @@ gchar *samlToken; gchar *userName; gboolean validateOnly; + gboolean hostVerified; } validateSamlBToken; } reqData; @@ -310,6 +312,8 @@ Log("username '%s'\n", req->reqData.validateSamlBToken.userName); Log("validate Only '%s'\n", req->reqData.validateSamlBToken.validateOnly ? "TRUE" : "FALSE"); + Log("hostVerified '%s'\n", + req->reqData.validateSamlBToken.hostVerified ? "TRUE" : "FALSE"); break; default: Warning("Unknown request type -- no request specific data\n"); @@ -436,6 +440,8 @@ req->parseState = PARSE_STATE_SAMLTOKEN; } else if (g_strcmp0(elementName, VGAUTH_VALIDATE_ONLY_ELEMENT_NAME) == 0) { req->parseState = PARSE_STATE_SAML_VALIDATE_ONLY; + } else if (g_strcmp0(elementName, VGAUTH_HOST_VERIFIED_ELEMENT_NAME) == 0) { + req->parseState = PARSE_STATE_SAML_HOST_VERIFIED; } else if (g_strcmp0(elementName, VGAUTH_ALIASINFO_ELEMENT_NAME) == 0) { req->parseState = PARSE_STATE_ALIASINFO; } else if (g_strcmp0(elementName, VGAUTH_SUBJECT_ELEMENT_NAME) == 0) { @@ -566,6 +572,7 @@ case PARSE_STATE_TOKEN: case PARSE_STATE_SAMLTOKEN: case PARSE_STATE_SAML_VALIDATE_ONLY: + case PARSE_STATE_SAML_HOST_VERIFIED: case PARSE_STATE_USERHANDLEINFO: req->parseState = PARSE_STATE_REQUEST; break; @@ -875,6 +882,17 @@ iVal = atoi(val); req->reqData.validateSamlBToken.validateOnly = (iVal) ? TRUE : FALSE; break; + case PARSE_STATE_SAML_HOST_VERIFIED: + + if (req->reqType != PROTO_REQUEST_VALIDATE_SAML_BEARER_TOKEN) { + g_set_error(error, G_MARKUP_ERROR_PARSE, VGAUTH_E_INVALID_ARGUMENT, + "Found hostVerified option in req type %d", + req->reqType); + goto done; + } + iVal = atoi(val); + req->reqData.validateSamlBToken.hostVerified = (iVal) ? TRUE : FALSE; + break; case PARSE_STATE_USERHANDLETYPE: { ServiceValidationResultsType t = VALIDATION_RESULTS_TYPE_UNKNOWN; @@ -1044,7 +1062,7 @@ /* ****************************************************************************** - * Proto_SanityCheckRequest - */ /** + * Proto_ConfidenceCheckRequest - */ /** * * Verifies a request is internally consistent and the type is what we expected. * @@ -1056,7 +1074,7 @@ */ static VGAuthError -Proto_SanityCheckRequest(ProtoRequest *request) +Proto_ConfidenceCheckRequest(ProtoRequest *request) { /* * There's not much else to do here for now. The parser does @@ -1149,12 +1167,12 @@ */ if (req->complete) { Proto_DumpRequest(req); - err = Proto_SanityCheckRequest(req); + err = Proto_ConfidenceCheckRequest(req); if (err != VGAUTH_E_OK) { - Warning("%s: request sanity check failed\n", __FUNCTION__); + Warning("%s: request confidence check failed\n", __FUNCTION__); } - // only try to handle it if the sanity check passed + // only try to handle it if the confidence check passed if (err == VGAUTH_E_OK) { err = ServiceProtoDispatchRequest(conn, req); } @@ -2123,6 +2141,7 @@ */ err = SAML_VerifyBearerTokenAndChain(req->reqData.validateSamlBToken.samlToken, req->reqData.validateSamlBToken.userName, + req->reqData.validateSamlBToken.hostVerified, &userName, &subjectName, &ai); diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/samlInt.hpp open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/samlInt.hpp --- open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/samlInt.hpp 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/samlInt.hpp 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2011-2016,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -136,6 +136,7 @@ auto_ptr SAMLCreateAndPopulateGrammarPool(); VGAuthError SAMLVerifyAssertion(const char *xmlText, + gboolean hostVerified, SAMLTokenData &token, vector &certs); #endif // ifndef _SAMLINT_H_ diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c --- open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2016-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2016-2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -266,7 +266,7 @@ * xmlLoadCatalog() just adds to the default catalog, and won't return an * error if it doesn't exist so long as a default catalog is set. * - * So sanity check its existence. + * So confidence check its existence. */ if (!g_file_test(catalogPath, G_FILE_TEST_EXISTS)) { g_warning("Error: catalog file not found at \"%s\"\n", catalogPath); @@ -570,6 +570,18 @@ /* + * Public API for use by the unit tests. + */ + +void +SAML_FreeCertArray(int num, + gchar **certs) +{ + FreeCertArray(num, certs); +} + + +/* ****************************************************************************** * FindAttrValue -- */ /** * @@ -1230,10 +1242,11 @@ * * Verifies the signature on an XML document. * - * @param[in] doc Parsed XML document. - * @param[out] numCerts Number of certs in the token. - * @param[out] certChain Certs in the token. Caller should g_free() array and - * contents. + * @param[in] doc Parsed XML document. + * @param[in] hostVerified If set, signature verifcation can be skipped. + * @param[out] numCerts Number of certs in the token. + * @param[out] certChain Certs in the token. Caller should g_free() array and + * contents. * * @return TRUE on success. * @@ -1242,6 +1255,7 @@ static gboolean VerifySignature(xmlDocPtr doc, + gboolean hostVerified, int *numCerts, gchar ***certChain) { @@ -1314,6 +1328,13 @@ goto done; } + if (hostVerified) { + // XXX add a check that the sig is replaced with the expected value + g_debug("%s: token is hostVerified, skipping signature check", + __FUNCTION__); + goto verified; + } + /* * Create a signature context with the key manager */ @@ -1335,7 +1356,14 @@ */ bRet = RegisterID(xmlDocGetRootElement(doc), "ID"); if (bRet == FALSE) { - g_warning("failed to register ID\n"); + g_warning("Failed to register ID\n"); + goto done; + } + + /* Use only X509 certs to validate the signature */ + if (xmlSecPtrListAdd(&(dsigCtx->keyInfoReadCtx.enabledKeyData), + BAD_CAST xmlSecKeyDataX509Id) < 0) { + g_warning("Failed to limit allowed key data\n"); goto done; } @@ -1376,6 +1404,7 @@ goto done; } +verified: retCode = TRUE; *numCerts = num; *certChain = certList; @@ -1395,17 +1424,35 @@ /* + * Public API for use by the unit tests. + */ + +gboolean +SAML_VerifySignature(xmlDocPtr doc, + gboolean hostVerified, + int *numCerts, + gchar ***certChain) +{ + return VerifySignature(doc, + hostVerified, + numCerts, + certChain); +} + + +/* ****************************************************************************** * VerifySAMLToken -- */ /** * * Verifies a XML text as a SAML token. * Parses the XML, then verifies Subject, Conditions and Signature. * - * @param[in] token Text of SAML token. - * @param[out] subject Subject of SAML token, Caller must g_free(). - * @param[out] numCerts Number of certs in the token. - * @param[out] certChain Certs in the token. Caller should g_free() array and - * contents. + * @param[in] token Text of SAML token. + * @param[in] hostVerfied If true, the signature check can be skipped. + * @param[out] subject Subject of SAML token, Caller must g_free(). + * @param[out] numCerts Number of certs in the token. + * @param[out] certChain Certs in the token. Caller should g_free() + * array and contents. * * @return matching TRUE on success. * @@ -1414,6 +1461,7 @@ static gboolean VerifySAMLToken(const gchar *token, + gboolean hostVerified, gchar **subject, int *numCerts, gchar ***certChain) @@ -1470,7 +1518,9 @@ } #endif - bRet = VerifySignature(doc, numCerts, certChain); + bRet = VerifySignature(doc, + hostVerified, + numCerts, certChain); if (FALSE == bRet) { g_warning("Failed to verify Signature\n"); // XXX Can we log the token at this point without risking security? @@ -1496,6 +1546,60 @@ } +// XXX remove this? hostVerified can be tested just fine with the 'real' +// API, the test-only shortcut may be overkill. Though once this is +// out of dev, we could add the extra param to SAML_VerifyBearerToken() +// and fix all the test calls. + +/* + ****************************************************************************** + * SAML_VerifyBearerTokenEx -- */ /** + * + * Determines whether the SAML bearer token can be used to authenticate. + * A token consists of a single SAML assertion. + * + * This is currently only used from the test code. + * + * @param[in] xmlText The text of the SAML assertion. + * @param[in] userName Optional username to authenticate as. + * @param[in] hostVerified If set, then the signature verification will + * be skipped. + * @param[out] userNameOut The user that the token has authenticated as. + * @param[out] subjNameOut The subject in the token. Caller must g_free(). + * @param[out] verifyAi The alias info associated with the entry + * in the alias store used to verify the + * SAML cert. + * + * @return VGAUTH_E_OK on success, VGAuthError on failure + * + ****************************************************************************** + */ + +VGAuthError +SAML_VerifyBearerTokenEx(const char *xmlText, + const char *userName, // UNUSED + gboolean hostVerified, + char **userNameOut, // UNUSED + char **subjNameOut, + ServiceAliasInfo **verifyAi) // UNUSED +{ + gboolean ret; + gchar **certChain = NULL; + int num = 0; + + ret = VerifySAMLToken(xmlText, + hostVerified, + subjNameOut, + &num, + &certChain); + + // clean up -- this code doesn't look at the chain + FreeCertArray(num, certChain); + + return (ret == TRUE) ? VGAUTH_E_OK : VGAUTH_E_AUTHENTICATION_DENIED; +} + + /* ****************************************************************************** * SAML_VerifyBearerToken -- */ /** @@ -1530,6 +1634,7 @@ int num = 0; ret = VerifySAMLToken(xmlText, + FALSE, // XXX keep original to minimze test changes subjNameOut, &num, &certChain); @@ -1550,13 +1655,14 @@ * The token must first be verified, then the certificate chain used * verify it must be checked against the appropriate certificate store. * - * @param[in] xmlText The text of the SAML assertion. - * @param[in] userName Optional username to authenticate as. - * @param[out] userNameOut The user that the token has authenticated as. - * @param[out] subjNameOut The subject in the token. Caller must g_free(). - * @param[out] verifyAi The alias info associated with the entry - * in the alias store used to verify the - * SAML cert. + * @param[in] xmlText The text of the SAML assertion. + * @param[in] userName Optional username to authenticate as. + * @param[in] hostVerified If true, skip signature verification. + * @param[out] userNameOut The user that the token has authenticated as. + * @param[out] subjNameOut The subject in the token. Caller must g_free(). + * @param[out] verifyAi The alias info associated with the entry + * in the alias store used to verify the + * SAML cert. * * @return VGAUTH_E_OK on success, VGAuthError on failure * @@ -1566,6 +1672,7 @@ VGAuthError SAML_VerifyBearerTokenAndChain(const char *xmlText, const char *userName, + gboolean hostVerified, char **userNameOut, char **subjNameOut, ServiceAliasInfo **verifyAi) @@ -1581,6 +1688,7 @@ *verifyAi = NULL; bRet = VerifySAMLToken(xmlText, + hostVerified, subjNameOut, &num, &certChain); diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/saml-xml-security-c.cpp open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/saml-xml-security-c.cpp --- open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/saml-xml-security-c.cpp 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/saml-xml-security-c.cpp 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2017 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2017,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -209,6 +209,7 @@ static bool SAMLCheckAudience(const XMLCh *audience); static bool SAMLCheckSignature(DOMDocument *doc, + gboolean hostVerified, vector &certs); static bool SAMLCheckReference(const DOMDocument *doc, DSIGSignature *sig); @@ -463,7 +464,9 @@ VGAuthError err; SAMLTokenData token; - err = SAMLVerifyAssertion(xmlText, token, certs); + err = SAMLVerifyAssertion(xmlText, + FALSE, // use original mode + token, certs); if (VGAUTH_E_OK != err) { return err; } @@ -497,13 +500,14 @@ * The token must first be verified, then the certificate chain used * verify it must be checked against the appropriate certificate store. * - * @param[in] xmlText The text of the SAML assertion. - * @param[in] userName Optional username to authenticate as. - * @param[out] userNameOut The user that the token has authenticated as. - * @param[out] subjNameOut The subject in the token. - * @param[out] verifySi The subjectInfo associated with the entry - * in the ID provider store used to verify the - * SAML cert. + * @param[in] xmlText The text of the SAML assertion. + * @param[in] userName Optional username to authenticate as. + * @param[in] hostVerified If true, skip signature verification. + * @param[out] userNameOut The user that the token has authenticated as. + * @param[out] subjNameOut The subject in the token. + * @param[out] verifySi The subjectInfo associated with the entry + * in the ID provider store used to verify the + * SAML cert. * * @return VGAUTH_E_OK on success, VGAuthError on failure * @@ -513,6 +517,7 @@ VGAuthError SAML_VerifyBearerTokenAndChain(const char *xmlText, const char *userName, + gboolean hostVerified, char **userNameOut, char **subjNameOut, ServiceAliasInfo **verifyAi) @@ -529,7 +534,9 @@ ServiceSubject subj; int i; - err = SAMLVerifyAssertion(xmlText, token, certs); + err = SAMLVerifyAssertion(xmlText, + hostVerified, + token, certs); if (VGAUTH_E_OK != err) { return err; } @@ -595,6 +602,7 @@ * certs. * * @param[in] xmlText + * @param[in] hostVerified If true, skip signature verification. * @param[out] token The interesting bits extracted from the xmlText. * @param[out] certs If the SAML assertion is verified, then this will * contain the certificate chain for the issuer. @@ -609,6 +617,7 @@ VGAuthError SAMLVerifyAssertion(const char *xmlText, + gboolean hostVerified, SAMLTokenData &token, vector &certs) { @@ -656,7 +665,9 @@ return VGAUTH_E_AUTHENTICATION_DENIED; } - if (!SAMLCheckSignature(doc, certs)) { + if (!SAMLCheckSignature(doc, + hostVerified, + certs)) { return VGAUTH_E_AUTHENTICATION_DENIED; } @@ -1055,6 +1066,7 @@ * from that, then checks that the signature is valid. * * @param[in] doc The document of which to check the signature. + * @param[in] hostVerified If true, skip signature verification. * @param[out] certs The base64 encoded certificates present in the * signature. * @@ -1065,6 +1077,7 @@ static bool SAMLCheckSignature(DOMDocument *doc, + gboolean hostVerified, vector &certs) { DOMElement *sigElem = SAMLFindChildByName(doc->getDocumentElement(), @@ -1088,6 +1101,9 @@ __FUNCTION__); return false; } + if (hostVerified) { + Debug("hostVerified is set, skipping signtaure check"); + } else { const XSECCryptoX509 *x509 = keyInfo->getCertificateCryptoItem(0); ASSERT(NULL != x509); @@ -1108,6 +1124,7 @@ return false; } + } for (int i = 0; i < keyInfo->getCertificateListSize(); i++) { const XSECCryptoX509 *cert = keyInfo->getCertificateCryptoItem(i); certs.push_back(string(cert->getDEREncodingSB().rawCharBuffer())); diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/serviceInt.h open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/serviceInt.h --- open-vm-tools-12.2.5/open-vm-tools/vgauth/serviceImpl/serviceInt.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauth/serviceImpl/serviceInt.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2017 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2017,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -479,6 +479,14 @@ gchar *ServiceDecodeUserName(const char *userName); VGAuthError SAML_Init(void); + +/* clang-format off */ +VGAuthError SAML_VerifyBearerTokenEx(const char *xmlText, + const char *userName, + gboolean hostVerified, + char **userNameOut, + char **subjectNameOut, + ServiceAliasInfo **verifyAi); VGAuthError SAML_VerifyBearerToken(const char *xmlText, const char *userName, char **userNameOut, @@ -486,9 +494,12 @@ ServiceAliasInfo **verifyAi); VGAuthError SAML_VerifyBearerTokenAndChain(const char *xmlText, const char *userName, + gboolean hostVerified, char **userNameOut, char **subjectNameOut, ServiceAliasInfo **verifyAi); +/* clang-format on */ + void SAML_Shutdown(void); void SAML_Reload(void); diff -Nru open-vm-tools-12.2.5/open-vm-tools/vgauthImport/vgauthImport.c open-vm-tools-12.3.0/open-vm-tools/vgauthImport/vgauthImport.c --- open-vm-tools-12.2.5/open-vm-tools/vgauthImport/vgauthImport.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vgauthImport/vgauthImport.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2012,2018-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2012,2018-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmblock-fuse/fsops.c open-vm-tools-12.3.0/open-vm-tools/vmblock-fuse/fsops.c --- open-vm-tools-12.2.5/open-vm-tools/vmblock-fuse/fsops.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmblock-fuse/fsops.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmblock-fuse/fsops.h open-vm-tools-12.3.0/open-vm-tools/vmblock-fuse/fsops.h --- open-vm-tools-12.2.5/open-vm-tools/vmblock-fuse/fsops.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmblock-fuse/fsops.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2018,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2018,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmblock-fuse/main.c open-vm-tools-12.3.0/open-vm-tools/vmblock-fuse/main.c --- open-vm-tools-12.2.5/open-vm-tools/vmblock-fuse/main.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmblock-fuse/main.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2016,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2016,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmblockmounter/vmblockmounter.c open-vm-tools-12.3.0/open-vm-tools/vmblockmounter/vmblockmounter.c --- open-vm-tools-12.2.5/open-vm-tools/vmblockmounter/vmblockmounter.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmblockmounter/vmblockmounter.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016, 2021 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2016, 2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -186,7 +186,7 @@ sourceDir = argv[optind]; mountPoint = argv[optind + 1]; - /* Do some sanity checks on our desired mount point. */ + /* Do some confidence checks on our desired mount point. */ if (stat(mountPoint, &statBuf)) { perror("Error: cannot stat mount point"); goto out; diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/config.c open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/config.c --- open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/config.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/config.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2015-2018,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2015-2018,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/dir.c open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/dir.c --- open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/dir.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/dir.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013,2019,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2013,2019,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/file.c open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/file.c --- open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/file.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/file.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013,2018-2019 VMware, Inc. All rights reserved. + * Copyright (c) 2013,2018-2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -612,7 +612,7 @@ payload = ((HgfsReplyRead *)HGFS_REQ_PAYLOAD(req))->payload; } - /* Sanity check on read size. */ + /* Confidence check on read size. */ if (actualSize > count) { LOG(4, ("Server reply: read too big!\n")); result = -EPROTO; diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/main.c open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/main.c --- open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/main.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/main.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2013,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/module.h open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/module.h --- open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/module.h 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/module.h 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013,2021 VMware, Inc. All rights reserved. + * Copyright (c) 2013,2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/request.c open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/request.c --- open-vm-tools-12.2.5/open-vm-tools/vmhgfs-fuse/request.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/vmhgfs-fuse/request.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013,2019 VMware, Inc. All rights reserved. + * Copyright (C) 2013,2019, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -164,7 +164,7 @@ { HgfsHeader *header = (HgfsHeader *)serverReply; - /* First some sanity checking. */ + /* First some confidence checking. */ if ((replySize < sizeof (HgfsHeader)) || (header->dummy != HGFS_OP_NEW_HEADER) || (header->packetSize > replySize) || diff -Nru open-vm-tools-12.2.5/open-vm-tools/xferlogs/xferlogs.c open-vm-tools-12.3.0/open-vm-tools/xferlogs/xferlogs.c --- open-vm-tools-12.2.5/open-vm-tools/xferlogs/xferlogs.c 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/open-vm-tools/xferlogs/xferlogs.c 2023-08-31 14:38:59.000000000 +0000 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2006-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published diff -Nru open-vm-tools-12.2.5/ReleaseNotes.md open-vm-tools-12.3.0/ReleaseNotes.md --- open-vm-tools-12.2.5/ReleaseNotes.md 2023-06-12 23:13:35.000000000 +0000 +++ open-vm-tools-12.3.0/ReleaseNotes.md 2023-08-31 14:38:59.000000000 +0000 @@ -1,8 +1,8 @@ -# open-vm-tools 12.2.5 Release Notes +# open-vm-tools 12.3.0 Release Notes -Updated on: 13 June 2023 +Updated on: 31 August 2023 -open-vm-tools | 13 JUNE 2023 | Build 21855600 +open-vm-tools | 31 AUGUST 2023 | Build 22234872 Check back for additions and updates to these release notes. @@ -10,28 +10,35 @@ The release notes cover the following topics: -* [What's New](#whatsnew) -* [Internationalization](#i18n) -* [Guest Operating System Customization Support](#guestop) -* [Interoperability Matrix](#interop) -* [Resolved Issues](#resolvedissues) -* [Known Issues](#knownissues) +- [open-vm-tools 12.3.0 Release Notes](#open-vm-tools-1230-release-notes) + - [What's in the Release Notes](#whats-in-the-release-notes) + - [What's New](#whats-new) + - [End of Feature Support Notice](#end-of-feature-support-notice) + - [Internationalization](#internationalization) + - [Guest Operating System Customization Support](#guest-operating-system-customization-support) + - [Interoperability Matrix](#interoperability-matrix) + - [ Resolved Issues](#-resolved-issues) + - [Known Issues](#known-issues) ## What's New -This release resolves CVE-2023-20867. For more information on this vulnerability and its impact on VMware products, see https://www.vmware.com/security/advisories/VMSA-2023-0013.html. - -There are no new features in the open-vm-tools 12.2.5 release. +This release resolves CVE-2023-20900. For more information on this vulnerability and its impact on VMware products, see https://www.vmware.com/security/advisories/VMSA-2023-0019.html. * Please see the [Resolved Issues](#resolvedissues) and [Known Issues](#knownissues) sections below. -* A complete list of the granular changes in the open-vm-tools 12.2.5 release is available at: +* A complete list of the granular changes in the open-vm-tools 12.3.0 release is available at: + + [open-vm-tools ChangeLog](https://github.com/vmware/open-vm-tools/blob/stable-12.3.0/open-vm-tools/ChangeLog) + +## End of Feature Support Notice + +* Deprecated: Using "xml-security-c" and "xerces-c" to build the VMware Guest Authentication Service (VGAuth) - [open-vm-tools ChangeLog](https://github.com/vmware/open-vm-tools/blob/stable-12.2.5/open-vm-tools/ChangeLog) + Starting with open-vm-tools 12.4.0, and going forward, the VGAuth service build will require the "xmlsec1" and "libxml2" development and runtime packages. If still using the "xml-security-c" and "xerces-c" open source projects to build open-vm-tools, now is the time to plan for the change. The open-vm-tools 12.3.x series will be the last version that can use "xml-security-c" and "xerces-c". ## Internationalization -open-vm-tools 12.2.5 is available in the following languages: +open-vm-tools 12.3.0 is available in the following languages: * English * French @@ -53,10 +60,66 @@ ## Resolved Issues -* **This release resolves CVE-2023-20867. +* **This release resolves CVE-2023-20900.** + + For more information on this vulnerability and its impact on VMware products, see https://www.vmware.com/security/advisories/VMSA-2023-0019.html. + +* **Linux quiesced snapshot: "SyncDriver: failed to freeze '_filesystem_'"** + + The open-vm-tools 12.2.0 release had an update to the Linux quiesced snapshot operation that would avoid starting a quiesced snapshot if a filesystem had already been frozen by another process. See the [Resolved Issues](https://github.com/vmware/open-vm-tools/blob/stable-12.2.0/ReleaseNotes.md#-resolved-issues) section in the open-vm-tools 12.2.0 Release Notes. That fix may have been backported into earlier versions of open-vm-tools by Linux vendors. + + It is possible that filesystems are being frozen in custom pre-freeze scripts to control the order in which those specific filesystems are to be frozen. The vmtoolsd process **must be informed** of all such filesystems with the help of "excludedFileSystems" setting of tools.conf. + + ``` + [vmbackup] + + excludedFileSystems=/opt/data,/opt/app/project-*,... + ``` + + A temporary workaround is available (starting from open-vm-tools 12.3.0) for system administrators to quickly allow a quiescing operation to succeed until the "excludedFileSystems" list can be configured. Note, if another process thaws the file system while a quiescing snapshot operation is ongoing, the snapshot may be compromised. Once the "excludedFileSystems" list is configured this setting MUST be unset (or set to false). + + ``` + [vmbackup] + + ignoreFrozenFileSystems = true + ``` + + This workaround is provided in the source file changes in + + https://github.com/vmware/open-vm-tools/commit/60c3a80ddc2b400366ed05169e16a6bed6501da2 - For more information on this vulnerability and its impact on VMware products, see https://www.vmware.com/security/advisories/VMSA-2023-0013.html. + and at Linux vendors' discretion, may be backported to earlier versions of open-vm-tools. +* **A number of Coverity reported issues have been addressed.** + +* **Component Manager / salt-minion: New InstallStatus "UNMANAGED".** + + Salt-minion added support for "ExternalInstall" (106) to indicate an older version of salt-minion is installed on the vm and cannot be managed by the svtminion.* scripts. The Component Manager will track that as "UNMANAGED" and take no action. + +* **The following pull requests and issues have been addressed** + + * Add antrea and calico interface pattern to GUESTINFO_DEFAULT_IFACE_EXCLUDES + + [Issue #638](https://github.com/vmware/open-vm-tools/issues/638) + [Pull request #639](https://github.com/vmware/open-vm-tools/pull/639) + + * Invalid argument with "\\" in Linux username (Active Directory user) + + [Issue #641](https://github.com/vmware/open-vm-tools/issues/641) + + * Improve POSIX guest identification + + [Issue #647](https://github.com/vmware/open-vm-tools/issues/647) + [Issue #648](https://github.com/vmware/open-vm-tools/issues/648) + + * Remove appUtil library which depends on deprecated "gdk-pixbuf-xlib" + + [Issue #658](https://github.com/vmware/open-vm-tools/issues/658) + + * Fix build problems with grpc + + [Pull request #664](https://github.com/vmware/open-vm-tools/pull/664) + [Issue #676](https://github.com/vmware/open-vm-tools/issues/676) ## Known Issues @@ -71,5 +134,4 @@ If the VM is powered on, disable and enable the **Shared Folders** feature from the interface. For resolving the issue permanently, edit **/etc/fstab** and add an entry to mount the Shared Folders automatically on boot. For example, add the line: - vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0 - + vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0 \ No newline at end of file