diff --git a/.gitignore b/.gitignore index 67325fe..8a2e58d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/open-vm-tools-10.2.5-8068406.tar.gz +SOURCES/open-vm-tools-10.3.0-8931395.tar.gz diff --git a/.open-vm-tools.metadata b/.open-vm-tools.metadata index b6cc40d..8e6b47c 100644 --- a/.open-vm-tools.metadata +++ b/.open-vm-tools.metadata @@ -1 +1 @@ -6199d6d3227540192f2fcdf53684f7bfbbd82655 SOURCES/open-vm-tools-10.2.5-8068406.tar.gz +236d8159882ab2663043232a59f84eba144d0345 SOURCES/open-vm-tools-10.3.0-8931395.tar.gz diff --git a/SOURCES/0002-Update-cloud-init-handling.patch b/SOURCES/0002-Update-cloud-init-handling.patch new file mode 100644 index 0000000..59ce6dc --- /dev/null +++ b/SOURCES/0002-Update-cloud-init-handling.patch @@ -0,0 +1,198 @@ +From 266e578b8480d520ecb694bd1f9dfaf88c1febc7 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Tue, 16 Oct 2018 07:20:56 +0200 +Subject: Update cloud-init handling + +This update of cloud-init changes for 10.3.0. +--- + open-vm-tools/libDeployPkg/linuxDeployment.c | 57 ++++++++++++++-------- + .../libDeployPkg/linuxDeploymentUtilities.c | 3 +- + 2 files changed, 38 insertions(+), 22 deletions(-) + +diff --git a/libDeployPkg/linuxDeployment.c b/libDeployPkg/linuxDeployment.c +index 996f184..34c8b95 100644 +--- a/libDeployPkg/linuxDeployment.c ++++ b/libDeployPkg/linuxDeployment.c +@@ -139,7 +139,7 @@ static bool CopyFileToDirectory(const char* srcPath, const char* destPath, + const char* fileName); + static DeployPkgStatus Deploy(const char* pkgName); + static char** GetFormattedCommandLine(const char* command); +-int ForkExecAndWaitCommand(const char* command); ++int ForkExecAndWaitCommand(const char* command, bool ignoreStdErr); + static void SetDeployError(const char* format, ...); + static const char* GetDeployError(void); + static void NoLogging(int level, const char* fmtstr, ...); +@@ -920,7 +920,7 @@ CloudInitSetup(const char *tmpDirPath) + "/bin/mkdir -p %s", cloudInitTmpDirPath); + command[sizeof(command) - 1] = '\0'; + +- forkExecResult = ForkExecAndWaitCommand(command); ++ forkExecResult = ForkExecAndWaitCommand(command, false); + if (forkExecResult != 0) { + SetDeployError("Error creating %s dir: %s", + cloudInitTmpDirPath, +@@ -937,7 +937,7 @@ CloudInitSetup(const char *tmpDirPath) + "/usr/bin/test -f %s/nics.txt", tmpDirPath); + command[sizeof(command) - 1] = '\0'; + +- forkExecResult = ForkExecAndWaitCommand(command); ++ forkExecResult = ForkExecAndWaitCommand(command, false); + + /* + * /usr/bin/test -f returns 0 if the file exists +@@ -946,7 +946,7 @@ CloudInitSetup(const char *tmpDirPath) + */ + if (forkExecResult == 0) { + sLog(log_info, "nics.txt file exists. Copying.."); +- if(!CopyFileToDirectory(tmpDirPath, cloudInitTmpDirPath, "nics.txt")) { ++ if (!CopyFileToDirectory(tmpDirPath, cloudInitTmpDirPath, "nics.txt")) { + goto done; + } + } +@@ -973,7 +973,7 @@ CloudInitSetup(const char *tmpDirPath) + } + + sLog(log_info, "Copying main configuration file cust.cfg"); +- if(!CopyFileToDirectory(tmpDirPath, cloudInitTmpDirPath, "cust.cfg")) { ++ if (!CopyFileToDirectory(tmpDirPath, cloudInitTmpDirPath, "cust.cfg")) { + goto done; + } + +@@ -992,7 +992,7 @@ done: + "/bin/rm -rf %s", + cloudInitTmpDirPath); + command[sizeof(command) - 1] = '\0'; +- ForkExecAndWaitCommand(command); ++ ForkExecAndWaitCommand(command, false); + } + sLog(log_error, "Setting generic error status in vmx. \n"); + SetCustomizationStatusInVmx(TOOLSDEPLOYPKG_RUNNING, +@@ -1016,7 +1016,7 @@ CopyFileToDirectory(const char* srcPath, const char* destPath, + snprintf(command, sizeof(command), "/bin/cp %s/%s %s/%s.tmp", srcPath, + fileName, destPath, fileName); + command[sizeof(command) - 1] = '\0'; +- forkExecResult = ForkExecAndWaitCommand(command); ++ forkExecResult = ForkExecAndWaitCommand(command, false); + if (forkExecResult != 0) { + SetDeployError("Error while copying file %s: %s", fileName, + strerror(errno)); +@@ -1026,7 +1026,7 @@ CopyFileToDirectory(const char* srcPath, const char* destPath, + fileName, destPath, fileName); + command[sizeof(command) - 1] = '\0'; + +- forkExecResult = ForkExecAndWaitCommand(command); ++ forkExecResult = ForkExecAndWaitCommand(command, false); + if (forkExecResult != 0) { + SetDeployError("Error while renaming temp file %s: %s", fileName, + strerror(errno)); +@@ -1090,7 +1090,7 @@ UseCloudInitWorkflow(const char* dirPath) + sLog(log_info, "cust.cfg is found in '%s' directory.", dirPath); + } + +- forkExecResult = ForkExecAndWaitCommand(cloudInitCommand); ++ forkExecResult = ForkExecAndWaitCommand(cloudInitCommand, true); + if (forkExecResult != 0) { + sLog(log_info, "cloud-init is not installed"); + free(cfgFullPath); +@@ -1194,7 +1194,7 @@ Deploy(const char* packageName) + deployPkgStatus = CloudInitSetup(tmpDirPath); + } else { + sLog(log_info, "Executing traditional GOSC workflow"); +- deploymentResult = ForkExecAndWaitCommand(command); ++ deploymentResult = ForkExecAndWaitCommand(command, false); + free(command); + + if (deploymentResult != CUST_SUCCESS) { +@@ -1260,7 +1260,7 @@ Deploy(const char* packageName) + strcat(cleanupCommand, tmpDirPath); + + sLog(log_info, "Launching cleanup. \n"); +- if (ForkExecAndWaitCommand(cleanupCommand) != 0) { ++ if (ForkExecAndWaitCommand(cleanupCommand, false) != 0) { + sLog(log_warning, "Error while clean up tmp directory %s: (%s)", + tmpDirPath, strerror (errno)); + } +@@ -1289,7 +1289,7 @@ Deploy(const char* packageName) + int rebootComandResult = 0; + do { + sLog(log_info, "Rebooting\n"); +- rebootComandResult = ForkExecAndWaitCommand("/sbin/telinit 6"); ++ rebootComandResult = ForkExecAndWaitCommand("/sbin/telinit 6", false); + sleep(1); + } while (rebootComandResult == 0); + sLog(log_error, "telinit returned error %d\n", rebootComandResult); +@@ -1499,12 +1499,13 @@ GetFormattedCommandLine(const char* command) + * Fork off the command and wait for it to finish. Classical Linux/Unix + * fork-and-exec. + * +- * @param [IN] command Command to execute ++ * @param [IN] command Command to execute ++ * @param [IN] ignoreStdErr If we ignore stderr when cmd's return code is 0 + * @return Return code from the process (or -1) + * + **/ + int +-ForkExecAndWaitCommand(const char* command) ++ForkExecAndWaitCommand(const char* command, bool ignoreStdErr) + { + ProcessHandle hp; + int retval; +@@ -1522,14 +1523,30 @@ ForkExecAndWaitCommand(const char* command) + + Process_RunToComplete(hp, 100); + sLog(log_info, "Customization command output: %s\n", Process_GetStdout(hp)); +- +- if(Process_GetExitCode(hp) == 0 && strlen(Process_GetStderr(hp)) > 0) { +- // Assume command failed if it wrote to stderr, even if exitCode is 0 +- sLog(log_error, "Customization command failed: %s\n", Process_GetStderr(hp)); +- retval = -1; ++ retval = Process_GetExitCode(hp); ++ ++ if (retval == 0) { ++ if (strlen(Process_GetStderr(hp)) > 0) { ++ if (!ignoreStdErr) { ++ // Assume command failed if it wrote to stderr, even if exitCode is 0 ++ sLog(log_error, ++ "Customization command failed with stderr: %s\n", ++ Process_GetStderr(hp)); ++ retval = -1; ++ } else { ++ // If we choose to ignore stderr, we do not return -1 when return ++ // code is 0. e.g, PR2148977, "cloud-init -v" will return 0 ++ // even there is output in stderr ++ sLog(log_info, "Ignoring stderr output: %s\n", Process_GetStderr(hp)); ++ } ++ } + } else { +- retval = Process_GetExitCode(hp); ++ sLog(log_error, ++ "Customization command failed with exitcode: %d, stderr: %s\n", ++ retval, ++ Process_GetStderr(hp)); + } ++ + Process_Destroy(hp); + return retval; + } +diff --git a/libDeployPkg/linuxDeploymentUtilities.c b/libDeployPkg/linuxDeploymentUtilities.c +index 83f942d..93e1b0a 100644 +--- a/libDeployPkg/linuxDeploymentUtilities.c ++++ b/libDeployPkg/linuxDeploymentUtilities.c +@@ -1,5 +1,5 @@ + /********************************************************* +- * Copyright (C) 2016-2017 VMware, Inc. All rights reserved. ++ * Copyright (C) 2016-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 +@@ -24,7 +24,6 @@ + #include + #include "linuxDeploymentUtilities.h" + +-extern int ForkExecAndWaitCommand(const char* command); + extern LogFunction sLog; + + /** +-- +1.8.3.1 + diff --git a/SOURCES/0003-hgfsPlugin-crash-fix.patch b/SOURCES/0003-hgfsPlugin-crash-fix.patch new file mode 100644 index 0000000..e5d2af1 --- /dev/null +++ b/SOURCES/0003-hgfsPlugin-crash-fix.patch @@ -0,0 +1,30 @@ +From d415faf0c4aaad8d8ea7b5ffeb225965e30a4628 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Tue, 16 Oct 2018 07:22:40 +0200 +Subject: hgfsPlugin crash fix + +--- + open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/services/plugins/hgfsServer/hgfsPlugin.c b/services/plugins/hgfsServer/hgfsPlugin.c +index c5ef872..129fa75 100644 +--- a/services/plugins/hgfsServer/hgfsPlugin.c ++++ b/services/plugins/hgfsServer/hgfsPlugin.c +@@ -1090,6 +1090,13 @@ ToolsOnLoad(ToolsAppCtx *ctx) + } + + /* ++ * If not running in a VMware VM, return NULL to disable the plugin. ++ */ ++ if (!ctx->isVMware) { ++ return NULL; ++ } ++ ++ /* + * Check for VM is running in a hosted environment and if so initialize + * the Shared Folders HGFS client redirector. + */ +-- +1.8.3.1 + diff --git a/SOURCES/ovt-Fix-RELRO-flag.patch b/SOURCES/ovt-Fix-RELRO-flag.patch new file mode 100644 index 0000000..8f47973 --- /dev/null +++ b/SOURCES/ovt-Fix-RELRO-flag.patch @@ -0,0 +1,110 @@ +From 0e4b153006ee5a88e1a60ff8e13b954bc88692ff Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 1 Mar 2019 09:46:11 +0100 +Subject: [PATCH 2/2] Fix RELRO flag + +RH-Author: Miroslav Rezanina +Message-id: <1551433571-31547-1-git-send-email-mrezanin@redhat.com> +Patchwork-id: 84750 +O-Subject: [RHEL-7.7 open-vm-tools PATCH] Fix RELRO flag +Bugzilla: 1678576 +RH-Acked-by: Cathy Avery +RH-Acked-by: Richard Jones + +From: Miroslav Rezanina + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1678576 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=20410856 +Upstream: n/a + +rpmdiff for 10.3.0 based open-vm-tools reports partial RELRO on several binaries. +This patch ensure proper hardening is used and files have full RELRO flag. + +Signed-off-by: Miroslav Rezanina +Signed-off-by: Miroslav Rezanina +--- + configure.ac | 2 +- + libDeployPkg/Makefile.am | 2 +- + libguestlib/Makefile.am | 2 +- + libhgfs/Makefile.am | 2 +- + libvmtools/Makefile.am | 2 +- + vgauth/lib/Makefile.am | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 72dc4ff..82e2bc6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1526,7 +1526,7 @@ VMTOOLS_LIBS="$BUILDDIR/libvmtools/libvmtools.la $GLIB2_LIBS" + VMTOOLS_CPPFLAGS="-DVMTOOLS_USE_GLIB $GLIB2_CPPFLAGS" + + PLUGIN_CPPFLAGS="$VMTOOLS_CPPFLAGS $PLUGIN_CPPFLAGS" +-PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -Wl,--as-needed -shared -module -avoid-version" ++PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -Wl,--as-needed -shared -module -avoid-version -Wl,-z,relro,-z,now" + + # Installation directories for core services plugins. + TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests +diff --git a/libDeployPkg/Makefile.am b/libDeployPkg/Makefile.am +index b4d5c9d..f4e8f8b 100644 +--- a/libDeployPkg/Makefile.am ++++ b/libDeployPkg/Makefile.am +@@ -39,7 +39,7 @@ 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_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now + + libDeployPkg_includedir = $(includedir)/libDeployPkg + +diff --git a/libguestlib/Makefile.am b/libguestlib/Makefile.am +index 5181409..a21a3ff 100644 +--- a/libguestlib/Makefile.am ++++ b/libguestlib/Makefile.am +@@ -32,7 +32,7 @@ libguestlib_la_SOURCES += vmGuestLib.c + libguestlib_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 +-libguestlib_la_LDFLAGS += -Wl,-lc ++libguestlib_la_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now + + libguestlib_includedir = $(includedir)/vmGuestLib + +diff --git a/libhgfs/Makefile.am b/libhgfs/Makefile.am +index 7609145..50573ee 100644 +--- a/libhgfs/Makefile.am ++++ b/libhgfs/Makefile.am +@@ -41,5 +41,5 @@ libhgfs_la_LDFLAGS = + 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_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now + +diff --git a/libvmtools/Makefile.am b/libvmtools/Makefile.am +index 1971942..6a4ca74 100644 +--- a/libvmtools/Makefile.am ++++ b/libvmtools/Makefile.am +@@ -91,5 +91,5 @@ libvmtools_la_LDFLAGS = + 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_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now + +diff --git a/vgauth/lib/Makefile.am b/vgauth/lib/Makefile.am +index bce97aa..6c0c265 100644 +--- a/vgauth/lib/Makefile.am ++++ b/vgauth/lib/Makefile.am +@@ -59,7 +59,7 @@ libvgauth_la_LDFLAGS = + 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_LDFLAGS += -Wl,-lc -Wl,-z,relro,-z,now + + # Message catalogs. + install-data-hook: +-- +1.8.3.1 + diff --git a/SOURCES/ovt-Workaround-for-false-negative-result-when-detecting.patch b/SOURCES/ovt-Workaround-for-false-negative-result-when-detecting.patch deleted file mode 100644 index 3fb6a84..0000000 --- a/SOURCES/ovt-Workaround-for-false-negative-result-when-detecting.patch +++ /dev/null @@ -1,218 +0,0 @@ -From c567bef4b4f7721ef5c0444f464a9843ba609ae2 Mon Sep 17 00:00:00 2001 -From: Miroslav Rezanina -Date: Thu, 2 Aug 2018 17:14:28 +0200 -Subject: [PATCH] Workaround for false negative result when detecting - cloud-init existance - -RH-Author: Miroslav Rezanina -Message-id: <1533230068-14044-1-git-send-email-mrezanin@redhat.com> -Patchwork-id: 81615 -O-Subject: [RHEL-7.6 open-vm-tools PATCH] Workaround for false negative result when detecting cloud-init existance -Bugzilla: 1601559 -RH-Acked-by: Richard Jones -RH-Acked-by: Cathy Avery - -From: Oliver Kurth - -"cloud-init -v" cmd is used to detect if cloud-init is properly configured and -it works on most linux distros. However in some linux distro like Amazon Linux 2, -"cloud-init -v" will print result to stderr instead of stdout and it makes -"forkExecAndWaitCommand" give false negative result. - -1. added a new bool switch in "ForkExecAndWaitCommand" to choose - if we should ignore the stderr output when the return code is 0 -2. removed unnecessary reference for "ForkExecAndWaitCommand" in linuxDeploymentUtilities.c -3. trivial change for some formatting - -(cherry picked from commit 443eced089b634176c6ad1f56512a43381997abc) -Signed-off-by: Miroslav Rezanina ---- - libDeployPkg/linuxDeployment.c | 55 ++++++++++++++-------- - libDeployPkg/linuxDeploymentUtilities.c | 3 +- - 2 files changed, 37 insertions(+), 21 deletions(-) - -diff --git a/libDeployPkg/linuxDeployment.c b/libDeployPkg/linuxDeployment.c -index 023d41f..7bcdd0a 100644 ---- a/libDeployPkg/linuxDeployment.c -+++ b/libDeployPkg/linuxDeployment.c -@@ -143,7 +143,7 @@ static bool CopyFileToDirectory(const char* srcPath, const char* destPath, - const char* fileName); - static int Deploy(const char* pkgName); - static char** GetFormattedCommandLine(const char* command); --int ForkExecAndWaitCommand(const char* command); -+int ForkExecAndWaitCommand(const char* command, bool ignoreStdErr); - static void SetDeployError(const char* format, ...); - static const char* GetDeployError(void); - static void NoLogging(int level, const char* fmtstr, ...); -@@ -920,7 +920,7 @@ CloudInitSetup(const char *tmpDirPath) - "/bin/mkdir -p %s", cloudInitTmpDirPath); - command[sizeof(command) - 1] = '\0'; - -- forkExecResult = ForkExecAndWaitCommand(command); -+ forkExecResult = ForkExecAndWaitCommand(command, false); - if (forkExecResult != 0) { - SetDeployError("Error creating %s dir: %s", - cloudInitTmpDirPath, -@@ -937,7 +937,7 @@ CloudInitSetup(const char *tmpDirPath) - "/usr/bin/test -f %s/nics.txt", tmpDirPath); - command[sizeof(command) - 1] = '\0'; - -- forkExecResult = ForkExecAndWaitCommand(command); -+ forkExecResult = ForkExecAndWaitCommand(command, false); - - /* - * /usr/bin/test -f returns 0 if the file exists -@@ -946,7 +946,7 @@ CloudInitSetup(const char *tmpDirPath) - */ - if (forkExecResult == 0) { - sLog(log_info, "nics.txt file exists. Copying.."); -- if(!CopyFileToDirectory(tmpDirPath, cloudInitTmpDirPath, "nics.txt")) { -+ if (!CopyFileToDirectory(tmpDirPath, cloudInitTmpDirPath, "nics.txt")) { - goto done; - } - } -@@ -973,7 +973,7 @@ CloudInitSetup(const char *tmpDirPath) - } - - sLog(log_info, "Copying main configuration file cust.cfg"); -- if(!CopyFileToDirectory(tmpDirPath, cloudInitTmpDirPath, "cust.cfg")) { -+ if (!CopyFileToDirectory(tmpDirPath, cloudInitTmpDirPath, "cust.cfg")) { - goto done; - } - -@@ -992,7 +992,7 @@ done: - "/bin/rm -rf %s", - cloudInitTmpDirPath); - command[sizeof(command) - 1] = '\0'; -- ForkExecAndWaitCommand(command); -+ ForkExecAndWaitCommand(command, false); - } - sLog(log_error, "Setting generic error status in vmx. \n"); - SetCustomizationStatusInVmx(TOOLSDEPLOYPKG_RUNNING, -@@ -1016,7 +1016,7 @@ CopyFileToDirectory(const char* srcPath, const char* destPath, - snprintf(command, sizeof(command), "/bin/cp %s/%s %s/%s.tmp", srcPath, - fileName, destPath, fileName); - command[sizeof(command) - 1] = '\0'; -- forkExecResult = ForkExecAndWaitCommand(command); -+ forkExecResult = ForkExecAndWaitCommand(command, false); - if (forkExecResult != 0) { - SetDeployError("Error while copying file %s: %s", fileName, - strerror(errno)); -@@ -1026,7 +1026,7 @@ CopyFileToDirectory(const char* srcPath, const char* destPath, - fileName, destPath, fileName); - command[sizeof(command) - 1] = '\0'; - -- forkExecResult = ForkExecAndWaitCommand(command); -+ forkExecResult = ForkExecAndWaitCommand(command, false); - if (forkExecResult != 0) { - SetDeployError("Error while renaming temp file %s: %s", fileName, - strerror(errno)); -@@ -1090,7 +1090,7 @@ UseCloudInitWorkflow(const char* dirPath) - sLog(log_info, "cust.cfg is found in '%s' directory.", dirPath); - } - -- forkExecResult = ForkExecAndWaitCommand(cloudInitCommand); -+ forkExecResult = ForkExecAndWaitCommand(cloudInitCommand, true); - if (forkExecResult != 0) { - sLog(log_info, "cloud-init is not installed"); - free(cfgFullPath); -@@ -1191,7 +1191,7 @@ Deploy(const char* packageName) - deployStatus = CloudInitSetup(tmpDirPath); - } else { - sLog(log_info, "Executing traditional GOSC workflow"); -- deploymentResult = ForkExecAndWaitCommand(command); -+ deploymentResult = ForkExecAndWaitCommand(command, false); - free(command); - - if (deploymentResult != CUST_SUCCESS) { -@@ -1257,7 +1257,7 @@ Deploy(const char* packageName) - strcat(cleanupCommand, tmpDirPath); - - sLog(log_info, "Launching cleanup. \n"); -- if (ForkExecAndWaitCommand(cleanupCommand) != 0) { -+ if (ForkExecAndWaitCommand(cleanupCommand, false) != 0) { - sLog(log_warning, "Error while clean up tmp directory %s: (%s)", - tmpDirPath, strerror (errno)); - } -@@ -1286,7 +1286,7 @@ Deploy(const char* packageName) - int rebootComandResult = 0; - do { - sLog(log_info, "Rebooting\n"); -- rebootComandResult = ForkExecAndWaitCommand("/sbin/telinit 6"); -+ rebootComandResult = ForkExecAndWaitCommand("/sbin/telinit 6", false); - sleep(1); - } while (rebootComandResult == 0); - sLog(log_error, "telinit returned error %d\n", rebootComandResult); -@@ -1497,11 +1497,12 @@ GetFormattedCommandLine(const char* command) - * fork-and-exec. - * - * @param [IN] command Command to execute -+ * @param [IN] ignoreStdErr If we ignore stderr when cmd's return code is 0 - * @return Return code from the process (or DEPLOY_ERROR) - * - **/ - int --ForkExecAndWaitCommand(const char* command) -+ForkExecAndWaitCommand(const char* command, bool ignoreStdErr) - { - ProcessHandle hp; - int retval; -@@ -1519,14 +1520,30 @@ ForkExecAndWaitCommand(const char* command) - - Process_RunToComplete(hp, 100); - sLog(log_info, "Customization command output: %s\n", Process_GetStdout(hp)); -- -- if(Process_GetExitCode(hp) == 0 && strlen(Process_GetStderr(hp)) > 0) { -- // Assume command failed if it wrote to stderr, even if exitCode is 0 -- sLog(log_error, "Customization command failed: %s\n", Process_GetStderr(hp)); -- retval = -1; -+ retval = Process_GetExitCode(hp); -+ -+ if (retval == 0) { -+ if (strlen(Process_GetStderr(hp)) > 0) { -+ if (!ignoreStdErr) { -+ // Assume command failed if it wrote to stderr, even if exitCode is 0 -+ sLog(log_error, -+ "Customization command failed with stderr: %s\n", -+ Process_GetStderr(hp)); -+ retval = -1; -+ } else { -+ // If we choose to ignore stderr, we do not return -1 when return -+ // code is 0. e.g, PR2148977, "cloud-init -v" will return 0 -+ // even there is output in stderr -+ sLog(log_info, "Ignoring stderr output: %s\n", Process_GetStderr(hp)); -+ } -+ } - } else { -- retval = Process_GetExitCode(hp); -+ sLog(log_error, -+ "Customization command failed with exitcode: %d, stderr: %s\n", -+ retval, -+ Process_GetStderr(hp)); - } -+ - Process_Destroy(hp); - return retval; - } -diff --git a/libDeployPkg/linuxDeploymentUtilities.c b/libDeployPkg/linuxDeploymentUtilities.c -index 83f942d..93e1b0a 100644 ---- a/libDeployPkg/linuxDeploymentUtilities.c -+++ b/libDeployPkg/linuxDeploymentUtilities.c -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2016-2017 VMware, Inc. All rights reserved. -+ * Copyright (C) 2016-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 -@@ -24,7 +24,6 @@ - #include - #include "linuxDeploymentUtilities.h" - --extern int ForkExecAndWaitCommand(const char* command); - extern LogFunction sLog; - - /** --- -1.8.3.1 - diff --git a/SOURCES/use-tirpc.patch b/SOURCES/use-tirpc.patch deleted file mode 100644 index bc28c11..0000000 --- a/SOURCES/use-tirpc.patch +++ /dev/null @@ -1,460 +0,0 @@ -diff -ru open-vm-tools-10.2.5-8068406.orig/configure.ac open-vm-tools-10.2.5-8068406/configure.ac ---- open-vm-tools-10.2.5-8068406.orig/configure.ac 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/configure.ac 2018-05-08 18:10:45.650397285 -0700 -@@ -586,6 +586,11 @@ - [enable_vgauth=no], - [with_xml2=yes]) - -+AC_ARG_WITH([tirpc], -+ [AS_HELP_STRING([--without-tirpc], -+ [compiles without tirpc support.])], -+ [with_tirpc="$withval"], -+ [with_tirpc="auto"]) - - # Make sure we are building with openssl 1.0.1 and above so that - # we use only TLSv1_2. -@@ -1066,10 +1071,45 @@ - - fi - -+have_tirpc="no" -+if test "x$with_tirpc" != "xno"; then -+ AC_VMW_CHECK_LIB([libtirpc], -+ [TIRPC], -+ [libtirpc], -+ [], -+ [], -+ [], -+ [], -+ [have_tirpc="yes"], -+ [have_tirpc="no"]) -+fi -+ -+if test "$with_tirpc" = "no"; then -+ use_tirpc="no" -+elif test "$with_tirpc" = "auto"; then -+ use_tirpc=$have_tirpc -+elif test "$with_tirpc" = "yes"; then -+ if test "$have_tirpc" = "no"; then -+ AC_MSG_ERROR([libtirpc is required, but not found.]) -+ else -+ use_tirpc="yes" -+ fi -+fi -+ -+if test "$use_tirpc" = "yes"; then -+ AC_MSG_NOTICE([Building with libtirpc]) -+else -+ AC_MSG_NOTICE([Building without libtirpc]) -+fi -+ - AC_PATH_PROG( - [RPCGEN], - [rpcgen], -- [ AC_MSG_ERROR([rpcgen not found. Please install the libc devel package.]) ]) -+ [not_found]) -+ -+if test "$RPCGEN" = "not_found"; then -+ AC_MSG_ERROR([rpcgen not found. Please install libc-devel or libc-rpcgen package.]) -+fi - - ### - ### Headers -@@ -1406,6 +1446,7 @@ - AM_CONDITIONAL(HAVE_UDEV, test "$have_udev" = "yes") - AM_CONDITIONAL(ENABLE_RESOLUTIONKMS, test "x$enable_resolutionkms" = "xyes") - AM_CONDITIONAL(VGAUTH_USE_CXX, test "$with_icu" = "yes" -o "$use_xmlsec1" != "yes") -+AM_CONDITIONAL(HAVE_TIRPC, test "$use_tirpc" = "yes") - - if test "$have_xsm" != "yes"; then - AC_DEFINE([NO_XSM], 1, []) -@@ -1454,6 +1495,13 @@ - XDR_LIBS="-lnsl -lrpcsvc" - fi - -+# In newer Linux distros Sun RPC has been removed from libc -+XDR_CPPFLAGS= -+if test "$os" = "linux" -a "$use_tirpc" = "yes"; then -+ XDR_CPPFLAGS="-DUSE_TIRPC $TIRPC_CPPFLAGS" -+ XDR_LIBS="$TIRPC_LIBS" -+fi -+ - # Installation directories for core services plugins. - TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests - COMMON_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/common -@@ -1492,6 +1540,7 @@ - AC_SUBST([VMTOOLS_CPPFLAGS]) - AC_SUBST([VMTOOLS_LIBS]) - AC_SUBST([RPCGENFLAGS]) -+AC_SUBST([XDR_CPPFLAGS]) - AC_SUBST([XDR_LIBS]) - AC_SUBST([TEST_PLUGIN_INSTALLDIR]) - AC_SUBST([COMMON_PLUGIN_INSTALLDIR]) -diff -ru open-vm-tools-10.2.5-8068406.orig/lib/dynxdr/dynxdr.c open-vm-tools-10.2.5-8068406/lib/dynxdr/dynxdr.c ---- open-vm-tools-10.2.5-8068406.orig/lib/dynxdr/dynxdr.c 2018-03-22 02:08:52.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/lib/dynxdr/dynxdr.c 2018-05-09 11:03:11.700032698 -0700 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2008-2017 VMware, Inc. All rights reserved. -+ * Copyright (C) 2008-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 -@@ -55,7 +55,7 @@ - * Mac OS X, FreeBSD and Solaris don't take a const parameter to the - * "x_getpostn" function. - */ --#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) -+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) || defined(USE_TIRPC) - # define DYNXDR_GETPOS_CONST - #else - # define DYNXDR_GETPOS_CONST const -@@ -172,7 +172,11 @@ - } - - --#if defined(__GLIBC__) || (defined(sun) && (defined(_LP64) || defined(_KERNEL))) -+#if !defined(USE_TIRPC) && \ -+ defined(__GLIBC__) || \ -+ (defined(sun) && \ -+ (defined(_LP64) || \ -+ defined(_KERNEL))) - /* - *----------------------------------------------------------------------------- - * -@@ -322,11 +326,11 @@ - DynXdrSetPos, /* x_setpostn */ - DynXdrInline, /* x_inline */ - NULL, /* x_destroy */ --#if defined(__GLIBC__) -+#if defined(__APPLE__) || defined (USE_TIRPC) -+ NULL, /* x_control */ -+#elif defined(__GLIBC__) - NULL, /* x_getint32 */ - DynXdrPutInt32, /* x_putint32 */ --#elif defined(__APPLE__) -- NULL, /* x_control */ - #elif defined(sun) && (defined(_LP64) || defined(_KERNEL)) - NULL, /* x_control */ - NULL, /* x_getint32 */ -diff -ru open-vm-tools-10.2.5-8068406.orig/lib/dynxdr/Makefile.am open-vm-tools-10.2.5-8068406/lib/dynxdr/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/lib/dynxdr/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/lib/dynxdr/Makefile.am 2018-05-09 11:03:50.510199020 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2008-2016 VMware, Inc. All rights reserved. -+### Copyright (C) 2008-2018 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 -@@ -21,3 +21,5 @@ - libDynxdr_la_SOURCES += dynxdr.c - libDynxdr_la_SOURCES += xdrutil.c - -+libDynxdr_la_CPPFLAGS = @XDR_CPPFLAGS@ -+libDynxdr_la_LIBADD = @XDR_LIBS@ -diff -ru open-vm-tools-10.2.5-8068406.orig/lib/guestRpc/Makefile.am open-vm-tools-10.2.5-8068406/lib/guestRpc/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/lib/guestRpc/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/lib/guestRpc/Makefile.am 2018-05-09 11:04:33.695343248 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2008-2016 VMware, Inc. All rights reserved. -+### Copyright (C) 2008-2018 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 -@@ -20,6 +20,10 @@ - libGuestRpc_la_SOURCES = - libGuestRpc_la_SOURCES += nicinfo_xdr.c - -+libGuestRpc_la_CPPFLAGS = @XDR_CPPFLAGS@ -+ -+libGuestRpc_la_LIBADD = @XDR_LIBS@ -+ - # XXX: Autoreconf complains about this and recommends using AM_CFLAGS instead. - # Problem is, $(CFLAGS) is appended to the compiler command line after AM_CFLAGS - # and after libGuestRpc_la_CFLAGS, so "-Wall -Werror" will override this flag. -diff -ru open-vm-tools-10.2.5-8068406.orig/lib/netUtil/Makefile.am open-vm-tools-10.2.5-8068406/lib/netUtil/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/lib/netUtil/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/lib/netUtil/Makefile.am 2018-05-09 11:05:22.720325766 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2007-2016 VMware, Inc. All rights reserved. -+### Copyright (C) 2007-2018 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 -@@ -20,3 +20,6 @@ - libNetUtil_la_SOURCES = - libNetUtil_la_SOURCES += netUtilLinux.c - -+libNetUtil_la_CPPFLAGS = @XDR_CPPFLAGS@ -+ -+libNetUtil_la_LIBADD = @XDR_LIBS@ -diff -ru open-vm-tools-10.2.5-8068406.orig/lib/nicInfo/Makefile.am open-vm-tools-10.2.5-8068406/lib/nicInfo/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/lib/nicInfo/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/lib/nicInfo/Makefile.am 2018-05-09 11:16:45.873499080 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2014-2016 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 version 2 of the GNU General Public License as -@@ -25,6 +25,9 @@ - - libNicInfo_la_CPPFLAGS = - libNicInfo_la_CPPFLAGS += @GLIB2_CPPFLAGS@ -+libNicInfo_la_CPPFLAGS += @XDR_CPPFLAGS@ -+ -+libNicInfo_la_LIBADD = @XDR_LIBS@ - - AM_CFLAGS = $(DNET_CPPFLAGS) - if USE_SLASH_PROC -diff -ru open-vm-tools-10.2.5-8068406.orig/lib/rpcChannel/Makefile.am open-vm-tools-10.2.5-8068406/lib/rpcChannel/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/lib/rpcChannel/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/lib/rpcChannel/Makefile.am 2018-05-09 11:06:28.808588597 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2009-2016 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 version 2 of the GNU General Public License as -@@ -27,3 +27,6 @@ - - libRpcChannel_la_CPPFLAGS = - libRpcChannel_la_CPPFLAGS += @VMTOOLS_CPPFLAGS@ -+libRpcChannel_la_CPPFLAGS += @XDR_CPPFLAGS@ -+ -+libRpcChannel_la_LIBADD = @XDR_LIBS@ -diff -ru open-vm-tools-10.2.5-8068406.orig/lib/slashProc/net.c open-vm-tools-10.2.5-8068406/lib/slashProc/net.c ---- open-vm-tools-10.2.5-8068406.orig/lib/slashProc/net.c 2018-03-22 02:05:41.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/lib/slashProc/net.c 2018-05-09 11:06:37.592208338 -0700 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2009-2016 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 -@@ -36,7 +36,6 @@ - #include "panic.h" - #include "slashProc.h" - #include "slashProcNetInt.h" --#include "netutil.h" - - - /* -diff -ru open-vm-tools-10.2.5-8068406.orig/libguestlib/Makefile.am open-vm-tools-10.2.5-8068406/libguestlib/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/libguestlib/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/libguestlib/Makefile.am 2018-05-09 11:07:16.200301424 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2007-2016 VMware, Inc. All rights reserved. -+### Copyright (C) 2007-2018 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 -@@ -22,6 +22,7 @@ - - libguestlib_la_LIBADD = - libguestlib_la_LIBADD += @VMTOOLS_LIBS@ -+libguestlib_la_LIBADD += @XDR_LIBS@ - - libguestlib_la_SOURCES = - libguestlib_la_SOURCES += guestlibV3_xdr.c -@@ -56,6 +57,7 @@ - libguestlib_la_CPPFLAGS = - libguestlib_la_CPPFLAGS += -DVMTOOLS_USE_GLIB - libguestlib_la_CPPFLAGS += @GLIB2_CPPFLAGS@ -+libguestlib_la_CPPFLAGS += @XDR_CPPFLAGS@ - - EXTRA_DIST = vmguestlib.pc.in - -diff -ru open-vm-tools-10.2.5-8068406.orig/services/plugins/dndcp/Makefile.am open-vm-tools-10.2.5-8068406/services/plugins/dndcp/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/services/plugins/dndcp/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/services/plugins/dndcp/Makefile.am 2018-05-09 11:08:54.693686707 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2009-2016 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 version 2 of the GNU General Public License as -@@ -28,6 +28,7 @@ - libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/stringxx - libdndcp_la_CPPFLAGS += -I$(top_srcdir)/services/plugins/dndcp/xutils - libdndcp_la_CPPFLAGS += -I$(top_srcdir)/include -+libdndcp_la_CPPFLAGS += @XDR_CPPFLAGS@ - - # Passing C++ related flags to CPPFLAGS generates error. - # So, we need to pass these to C++ compilation only. -@@ -45,6 +46,7 @@ - libdndcp_la_LIBADD += @VMTOOLS_LIBS@ - libdndcp_la_LIBADD += @HGFS_LIBS@ - libdndcp_la_LIBADD += $(top_builddir)/lib/hgfsUri/hgfsUriPosix.lo -+libdndcp_la_LIBADD += @XDR_LIBS@ - - libdndcp_la_SOURCES = - -diff -ru open-vm-tools-10.2.5-8068406.orig/services/plugins/guestInfo/Makefile.am open-vm-tools-10.2.5-8068406/services/plugins/guestInfo/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/services/plugins/guestInfo/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/services/plugins/guestInfo/Makefile.am 2018-05-09 11:09:40.650361114 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2009-2017 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 version 2 of the GNU General Public License as -@@ -22,6 +22,7 @@ - - libguestInfo_la_CPPFLAGS = - libguestInfo_la_CPPFLAGS += @PLUGIN_CPPFLAGS@ -+libguestInfo_la_CPPFLAGS += @XDR_CPPFLAGS@ - - libguestInfo_la_LDFLAGS = - libguestInfo_la_LDFLAGS += @PLUGIN_LDFLAGS@ -diff -ru open-vm-tools-10.2.5-8068406.orig/services/plugins/resolutionKMS/resolutionKMS.c open-vm-tools-10.2.5-8068406/services/plugins/resolutionKMS/resolutionKMS.c ---- open-vm-tools-10.2.5-8068406.orig/services/plugins/resolutionKMS/resolutionKMS.c 2018-03-22 02:05:41.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/services/plugins/resolutionKMS/resolutionKMS.c 2018-05-09 11:09:53.202894953 -0700 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2008-2017 VMware, Inc. All rights reserved. -+ * Copyright (C) 2008-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 -@@ -29,16 +29,13 @@ - #include - #include - -+#include - #include - #include - - #include "vmware.h" --#include "debug.h" --#include "rpcout.h" --#include "str.h" - #include "strutil.h" - --#include "xdrutil.h" - #include "vmware/guestrpc/tclodefs.h" - #include "vmware/tools/plugin.h" - #include "vmware/tools/utils.h" -diff -ru open-vm-tools-10.2.5-8068406.orig/services/plugins/resolutionSet/resolutionSet.c open-vm-tools-10.2.5-8068406/services/plugins/resolutionSet/resolutionSet.c ---- open-vm-tools-10.2.5-8068406.orig/services/plugins/resolutionSet/resolutionSet.c 2018-03-22 02:05:41.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/services/plugins/resolutionSet/resolutionSet.c 2018-05-09 11:09:59.737718774 -0700 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2008-2017 VMware, Inc. All rights reserved. -+ * Copyright (C) 2008-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 -@@ -34,7 +34,6 @@ - - #include "resolutionInt.h" - --#include "xdrutil.h" - #include "vmware/guestrpc/tclodefs.h" - #include "vmware/tools/plugin.h" - #include "vmware/tools/utils.h" -diff -ru open-vm-tools-10.2.5-8068406.orig/services/plugins/vix/Makefile.am open-vm-tools-10.2.5-8068406/services/plugins/vix/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/services/plugins/vix/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/services/plugins/vix/Makefile.am 2018-05-09 11:10:15.184453099 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2009-2016 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 version 2 of the GNU General Public License as -@@ -20,6 +20,7 @@ - - libvix_la_CPPFLAGS = - libvix_la_CPPFLAGS += @PLUGIN_CPPFLAGS@ -+libvix_la_CPPFLAGS += @XDR_CPPFLAGS@ - libvix_la_CPPFLAGS += -I$(top_srcdir)/vgauth/public - - libvix_la_LDFLAGS = -@@ -32,6 +33,7 @@ - libvix_la_LIBADD += $(top_builddir)/lib/auth/libAuth.la - libvix_la_LIBADD += $(top_builddir)/lib/foundryMsg/libFoundryMsg.la - libvix_la_LIBADD += $(top_builddir)/lib/impersonate/libImpersonate.la -+libvix_la_LIBADD += @XDR_LIBS@ - if ENABLE_VGAUTH - libvix_la_LIBADD += $(top_builddir)/vgauth/lib/libvgauth.la - endif -diff -ru open-vm-tools-10.2.5-8068406.orig/services/plugins/vix/vixTools.c open-vm-tools-10.2.5-8068406/services/plugins/vix/vixTools.c ---- open-vm-tools-10.2.5-8068406.orig/services/plugins/vix/vixTools.c 2018-03-22 02:05:41.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/services/plugins/vix/vixTools.c 2018-05-09 00:12:44.258433002 -0700 -@@ -91,7 +91,6 @@ - #include "str.h" - #include "file.h" - #include "err.h" --#include "guestInfo.h" // MAX_VALUE_LEN - #include "hostinfo.h" - #include "guest_os.h" - #include "guest_msg_def.h" -diff -ru open-vm-tools-10.2.5-8068406.orig/services/plugins/vmbackup/Makefile.am open-vm-tools-10.2.5-8068406/services/plugins/vmbackup/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/services/plugins/vmbackup/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/services/plugins/vmbackup/Makefile.am 2018-05-09 11:10:27.959367162 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2009-2017 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 version 2 of the GNU General Public License as -@@ -20,6 +20,7 @@ - - libvmbackup_la_CPPFLAGS = - libvmbackup_la_CPPFLAGS += @PLUGIN_CPPFLAGS@ -+libvmbackup_la_CPPFLAGS += @XDR_CPPFLAGS@ - - libvmbackup_la_LDFLAGS = - libvmbackup_la_LDFLAGS += @PLUGIN_LDFLAGS@ -@@ -27,6 +28,7 @@ - libvmbackup_la_LIBADD = - libvmbackup_la_LIBADD += @GOBJECT_LIBS@ - libvmbackup_la_LIBADD += @VMTOOLS_LIBS@ -+libvmbackup_la_LIBADD += @XDR_LIBS@ - - libvmbackup_la_SOURCES = - libvmbackup_la_SOURCES += nullProvider.c -diff -ru open-vm-tools-10.2.5-8068406.orig/services/plugins/vmbackup/stateMachine.c open-vm-tools-10.2.5-8068406/services/plugins/vmbackup/stateMachine.c ---- open-vm-tools-10.2.5-8068406.orig/services/plugins/vmbackup/stateMachine.c 2018-03-22 02:05:41.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/services/plugins/vmbackup/stateMachine.c 2018-05-09 10:14:03.721823229 -0700 -@@ -35,7 +35,6 @@ - - #include "vmBackupInt.h" - --#include "dynxdr.h" - #include - #include - #include "guestApp.h" -diff -ru open-vm-tools-10.2.5-8068406.orig/toolbox/Makefile.am open-vm-tools-10.2.5-8068406/toolbox/Makefile.am ---- open-vm-tools-10.2.5-8068406.orig/toolbox/Makefile.am 2018-03-22 02:05:02.000000000 -0700 -+++ open-vm-tools-10.2.5-8068406/toolbox/Makefile.am 2018-05-09 11:11:30.514058368 -0700 -@@ -1,5 +1,5 @@ - ################################################################################ --### Copyright (C) 2007-2016 VMware, Inc. All rights reserved. -+### Copyright (C) 2007-2018 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 -@@ -20,9 +20,11 @@ - vmware_toolbox_cmd_LDADD = - vmware_toolbox_cmd_LDADD += ../libguestlib/libguestlib.la - vmware_toolbox_cmd_LDADD += @VMTOOLS_LIBS@ -+vmware_toolbox_cmd_LDADD += @XDR_LIBS@ - - vmware_toolbox_cmd_CPPFLAGS = - vmware_toolbox_cmd_CPPFLAGS += @VMTOOLS_CPPFLAGS@ -+vmware_toolbox_cmd_CPPFLAGS += @XDR_CPPFLAGS@ - - vmware_toolbox_cmd_SOURCES = - vmware_toolbox_cmd_SOURCES += toolbox-cmd.c diff --git a/SOURCES/vmtoolsd-init.service b/SOURCES/vmtoolsd-init.service new file mode 100644 index 0000000..08dd10d --- /dev/null +++ b/SOURCES/vmtoolsd-init.service @@ -0,0 +1,14 @@ +[Unit] +Description=One-time configuration for vmtoolsd +ConditionVirtualization=vmware +ConditionPathExists=|!/etc/vmware-tools/GuestProxyData/server/cert.pem +ConditionPathExists=|!/etc/vmware-tools/GuestProxyData/server/key.pem +PartOf=vmtoolsd.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/vmware-guestproxycerttool -g + +[Install] +RequiredBy=vmtoolsd.service diff --git a/SOURCES/vmtoolsd.service b/SOURCES/vmtoolsd.service index 54c7312..773040d 100644 --- a/SOURCES/vmtoolsd.service +++ b/SOURCES/vmtoolsd.service @@ -4,6 +4,8 @@ Documentation=http://github.com/vmware/open-vm-tools ConditionVirtualization=vmware Requires=vgauthd.service After=vgauthd.service +DefaultDependencies=no +Before=cloud-init-local.service [Service] ExecStart=/usr/bin/vmtoolsd diff --git a/SPECS/open-vm-tools.spec b/SPECS/open-vm-tools.spec index 233187a..e676073 100644 --- a/SPECS/open-vm-tools.spec +++ b/SPECS/open-vm-tools.spec @@ -19,31 +19,30 @@ ################################################################################ %global _hardened_build 1 -%global majorversion 10.2 -%global minorversion 5 -%global toolsbuild 8068406 +%global majorversion 10.3 +%global minorversion 0 +%global toolsbuild 8931395 %global toolsversion %{majorversion}.%{minorversion} %global toolsdaemon vmtoolsd %global vgauthdaemon vgauthd Name: open-vm-tools Version: %{toolsversion} -Release: 3%{?dist} +Release: 2%{?dist} Summary: Open Virtual Machine Tools for virtual machines hosted on VMware Group: Applications/System License: GPLv2 URL: https://github.com/vmware/%{name} Source0: https://github.com/vmware/%{name}/releases/download/stable-%{version}/%{name}-%{version}-%{toolsbuild}.tar.gz -Source1: %{toolsdaemon}.service -Source2: %{vgauthdaemon}.service -%if 0%{?rhel} >= 7 +Source1: %{toolsdaemon}-init.service +Source2: %{toolsdaemon}.service +Source3: %{vgauthdaemon}.service ExclusiveArch: x86_64 -%else -ExclusiveArch: %{ix86} x86_64 -%endif -Patch1: use-tirpc.patch -Patch2: ovt-Workaround-for-false-negative-result-when-detecting.patch +Patch0002: 0002-Update-cloud-init-handling.patch +Patch0003: 0003-hgfsPlugin-crash-fix.patch +# For bz#1678576 - [ESXi][RHEL7.6] Several files lost Full RELRO +Patch4: ovt-Fix-RELRO-flag.patch BuildRequires: autoconf BuildRequires: automake @@ -138,8 +137,10 @@ machines. %prep %setup -q -n %{name}-%{version}-%{toolsbuild} -%patch1 -p1 -%patch2 -p1 + +%patch0002 -p1 +%patch0003 -p1 +%patch4 -p1 %build # Required for regenerating configure script when @@ -193,8 +194,10 @@ rm -fr %{buildroot}%{_sbindir} %{buildroot}/sbin/mount.vmhgfs mv %{buildroot}%{_sysconfdir}/vmware-tools/vm-support %{buildroot}%{_bindir} # Systemd unit files -install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{toolsdaemon}.service -install -p -m 644 -D %{SOURCE2} %{buildroot}%{_unitdir}/%{vgauthdaemon}.service +install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{toolsdaemon}-init.service +install -p -m 644 -D %{SOURCE2} %{buildroot}%{_unitdir}/%{toolsdaemon}.service +install -p -m 644 -D %{SOURCE3} %{buildroot}%{_unitdir}/%{vgauthdaemon}.service + # 'make check' in open-vm-tools rebuilds docs and ends up regenerating # the font file. We can add %%check secion once 'make check' is fixed @@ -220,10 +223,12 @@ if [ -f %{_bindir}/vmware-checkvm -a \ fi /sbin/ldconfig +%systemd_post %{toolsdaemon}-init.service %systemd_post %{vgauthdaemon}.service %systemd_post %{toolsdaemon}.service %preun +%systemd_preun %{toolsdaemon}-init.service %systemd_preun %{toolsdaemon}.service %systemd_preun %{vgauthdaemon}.service @@ -247,6 +252,7 @@ fi %postun /sbin/ldconfig +%systemd_postun_with_restart %{toolsdaemon}-init.service %systemd_postun_with_restart %{toolsdaemon}.service %systemd_postun_with_restart %{vgauthdaemon}.service # Cleanup GuestProxy certs if open-vm-tools is being uninstalled @@ -297,6 +303,7 @@ fi %{_libdir}/%{name}/plugins/vmsvc/*.so %{_datadir}/%{name}/ %{_udevrulesdir}/99-vmware-scsi-udev.rules +%{_unitdir}/%{toolsdaemon}-init.service %{_unitdir}/%{toolsdaemon}.service %{_unitdir}/%{vgauthdaemon}.service @@ -322,6 +329,19 @@ fi %{_bindir}/vmware-vgauth-smoketest %changelog +* Wed Mar 13 2019 Miroslav Rezanina - 10.3.0-2.el7 +- ovt-Enable-cloud-init-by-default-to-change-the-systemd-u.patch [bz#1662278] +- ovt-Fix-RELRO-flag.patch [bz#1678576] +- Resolves: bz#1662278 + ([ESXi][RHEL7.7]Enable cloud-init by default to change the systemd unit file vmtoolsd.service) +- Resolves: bz#1678576 + ([ESXi][RHEL7.6] Several files lost Full RELRO) + +* Tue Feb 12 2019 Miroslav Rezanina - 10.3.0-1 +- Updated RHEL version +- Resolves: bz#1667549 + ([RHEL 7.7, ESXi] Rebase open-vm-tools to 10.3.0) + * Tue Aug 21 2018 Miroslav Rezanina - 10-2.5-3 - ovt-Workaround-for-false-negative-result-when-detecting.patch [bz#1601559] - Resolves: bz#1601559