Package new upstream version open-vm-tools-10.3.5-10430147.

Removed cloud-init.patch which is no longer needed.
Removed hgfsPlugin-crash.patch which is no longer needed.
Removed linuxDeploymentUtils-strncat.patch which is no longer needed.
Added quiescing-combined.patch for quiesced snapshot fixes.
Updated hgfsServer-aligned.patch for open-vm-tools-10.3.5.
This commit is contained in:
Ravindra Kumar 2019-02-13 00:10:02 -08:00
parent ac88f820f8
commit 641131e593
7 changed files with 22 additions and 256 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@
/open-vm-tools-10.2.0-7253323.tar.gz /open-vm-tools-10.2.0-7253323.tar.gz
/open-vm-tools-10.2.5-8068406.tar.gz /open-vm-tools-10.2.5-8068406.tar.gz
/open-vm-tools-10.3.0-8931395.tar.gz /open-vm-tools-10.3.0-8931395.tar.gz
/open-vm-tools-10.3.5-10430147.tar.gz

View File

@ -1,184 +0,0 @@
diff --git a/libDeployPkg/linuxDeployment.c b/libDeployPkg/linuxDeployment.c
index 996f184c..34c8b956 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 @@ CloudInitSetup(const char *tmpDirPath)
"/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 83f942da..93e1b0aa 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 <regex.h>
#include "linuxDeploymentUtilities.h"
-extern int ForkExecAndWaitCommand(const char* command);
extern LogFunction sLog;
/**

View File

@ -1,17 +0,0 @@
diff -ru open-vm-tools-10.3.0-8931395.orig/services/plugins/hgfsServer/hgfsPlugin.c open-vm-tools-10.3.0-8931395/services/plugins/hgfsServer/hgfsPlugin.c
--- open-vm-tools-10.3.0-8931395.orig/services/plugins/hgfsServer/hgfsPlugin.c 2018-06-23 03:03:48.000000000 -0700
+++ open-vm-tools-10.3.0-8931395/services/plugins/hgfsServer/hgfsPlugin.c 2018-08-06 11:50:03.917850541 -0700
@@ -1090,6 +1090,13 @@
}
/*
+ * 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.
*/

View File

@ -93,14 +93,3 @@
replyPayloadSize = sizeof *reply + reply->actualSize; replyPayloadSize = sizeof *reply + reply->actualSize;
} else { } else {
LOG(4, ("%s: V1 Failed to read-> %d.\n", __FUNCTION__, status)); LOG(4, ("%s: V1 Failed to read-> %d.\n", __FUNCTION__, status));
@@ -7246,8 +7250,8 @@
if (HGFS_ERROR_SUCCESS != status) {
LOG(4, ("%s: could not map cached handle %d, error %u\n",
__FUNCTION__, fileHandle, status));
- } else if (!HgfsHandle2FileNameMode(fileHandle, session, &shareInfo->writePermissions,
- &shareInfo->readPermissions, localFileName,
+ } else if (!HgfsHandle2FileNameMode(fileHandle, session, &shareInfo->readPermissions,
+ &shareInfo->writePermissions, localFileName,
localNameLength)) {
/*
* HgfsPlatformRename requires valid source file name even when file handle

View File

@ -1,29 +0,0 @@
diff -ru open-vm-tools-10.3.0-8931395-orig/libDeployPkg/linuxDeploymentUtilities.c open-vm-tools-10.3.0-8931395/libDeployPkg/linuxDeploymentUtilities.c
--- open-vm-tools-10.3.0-8931395-orig/libDeployPkg/linuxDeploymentUtilities.c 2018-06-23 03:04:54.000000000 -0700
+++ open-vm-tools-10.3.0-8931395/libDeployPkg/linuxDeploymentUtilities.c 2019-02-02 15:45:50.228320875 -0800
@@ -102,7 +102,6 @@
HasCustomScript(const char* dirPath, char** scriptName)
{
bool hasScript = false;
- size_t scriptSize;
static const char *customScriptRegex = "^script[A-Za-z0-9]*\\.bat";
DIR *tempDir;
struct dirent *dir;
@@ -124,16 +123,13 @@
}
while ((dir = readdir(tempDir)) != NULL) {
if (!regexec(&scriptRegex, dir->d_name, 0, NULL, 0)) {
- scriptSize = strlen(dir->d_name);
- *scriptName = malloc(sizeof(char) * scriptSize + 1);
+ *scriptName = strdup(dir->d_name);
if (*scriptName == NULL) {
sLog(log_warning, "Could not allocate memory for scriptName: %s",
strerror(errno));
closedir(tempDir);
goto done;
}
- **scriptName = '\0';
- strncat(*scriptName, dir->d_name, scriptSize);
hasScript = true;
}
}

View File

@ -20,15 +20,15 @@
%global _hardened_build 1 %global _hardened_build 1
%global majorversion 10.3 %global majorversion 10.3
%global minorversion 0 %global minorversion 5
%global toolsbuild 8931395 %global toolsbuild 10430147
%global toolsversion %{majorversion}.%{minorversion} %global toolsversion %{majorversion}.%{minorversion}
%global toolsdaemon vmtoolsd %global toolsdaemon vmtoolsd
%global vgauthdaemon vgauthd %global vgauthdaemon vgauthd
Name: open-vm-tools Name: open-vm-tools
Version: %{toolsversion} Version: %{toolsversion}
Release: 8%{?dist} Release: 1%{?dist}
Summary: Open Virtual Machine Tools for virtual machines hosted on VMware Summary: Open Virtual Machine Tools for virtual machines hosted on VMware
License: GPLv2 License: GPLv2
URL: https://github.com/vmware/%{name} URL: https://github.com/vmware/%{name}
@ -44,17 +44,15 @@ ExclusiveArch: x86_64
ExclusiveArch: %{ix86} x86_64 ExclusiveArch: %{ix86} x86_64
%endif %endif
Patch1: cloud-init.patch Patch1: hgfsServer-aligned.patch
Patch2: hgfsPlugin-crash.patch Patch2: util-misc-format.patch
Patch3: hgfsServer-aligned.patch Patch3: hgfsmounter-aligned.patch
Patch4: util-misc-format.patch Patch4: filesystem-aligned.patch
Patch5: hgfsmounter-aligned.patch Patch5: file-aligned.patch
Patch6: linuxDeploymentUtils-strncat.patch Patch6: fsutil-aligned.patch
Patch7: filesystem-aligned.patch Patch7: dir-aligned.patch
Patch8: file-aligned.patch Patch8: link-aligned.patch
Patch9: fsutil-aligned.patch Patch9: quiescing-combined.patch
Patch10: dir-aligned.patch
Patch11: link-aligned.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
@ -331,6 +329,14 @@ fi
%{_bindir}/vmware-vgauth-smoketest %{_bindir}/vmware-vgauth-smoketest
%changelog %changelog
* Tue Feb 12 2019 Ravindra Kumar <ravindrakumar@vmware.com> - 10.3.5-1
- Package new upstream version open-vm-tools-10.3.5-10430147.
- Removed cloud-init.patch which is no longer needed.
- Removed hgfsPlugin-crash.patch which is no longer needed.
- Removed linuxDeploymentUtils-strncat.patch which is no longer needed.
- Added quiescing-combined.patch for quiesced snapshot fixes.
- Updated hgfsServer-aligned.patch for open-vm-tools-10.3.5.
* Tue Feb 12 2019 Ravindra Kumar <ravindrakumar@vmware.com> - 10.3.0-8 * Tue Feb 12 2019 Ravindra Kumar <ravindrakumar@vmware.com> - 10.3.0-8
- Updated *-aligned.patch files with more tweaks. - Updated *-aligned.patch files with more tweaks.
- Filed a regression in readdir operation in dir-aligned.patch. - Filed a regression in readdir operation in dir-aligned.patch.

View File

@ -1 +1 @@
SHA512 (open-vm-tools-10.3.0-8931395.tar.gz) = 627056db94b79aa7782324ed1a71e7f0c2420f0a0d76d3e65b84035b1350e29757a1412cbf195ef3d79fae37ddd6f17c6892ea2c64dbfa331854ded016965604 SHA512 (open-vm-tools-10.3.5-10430147.tar.gz) = 2f2b3d9a8d39b01904cf845936b51a468ba61a29ca64635f842451ca9fd90bf5a770967e4c332319327c6f920ac4fb06d304e185c18ab8898aeb4fcd491a4a1f