Change-Id: Iba93941c4eb2d6ada1e9ad7dc99c12766b41e8bb
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3610
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Kumar Kaushik <kaushikk@vmware.com>
... | ... |
@@ -1,8 +1,9 @@ |
1 |
-+++ open-vm-tools-10.1.5-5055683-modified/libDeployPkg/linuxDeployment.c 2017-04-06 19:14:38.000403000 -0700 |
|
2 |
-@@ -580,13 +580,17 @@ |
|
1 |
+diff -ru open-vm-tools-stable-10.1.10/open-vm-tools/libDeployPkg/linuxDeployment.c open-vm-tools-stable-10.1.10-modified/open-vm-tools/libDeployPkg/linuxDeployment.c |
|
2 |
+--- open-vm-tools-stable-10.1.10/open-vm-tools/libDeployPkg/linuxDeployment.c 2017-07-28 14:59:15.000000000 -0700 |
|
3 |
+@@ -582,13 +582,17 @@ |
|
3 | 4 |
close(fd); |
4 |
- |
|
5 |
+ |
|
5 | 6 |
// Create space and copy the command |
6 | 7 |
- *command = malloc(VMWAREDEPLOYPKG_CMD_LENGTH); |
7 | 8 |
+ *command = malloc(VMWAREDEPLOYPKG_CMD_LENGTH + 1); |
... | ... |
@@ -10,7 +11,7 @@ |
10 | 10 |
SetDeployError("Error allocating memory."); |
11 | 11 |
return FALSE; |
12 | 12 |
} |
13 |
- |
|
13 |
+ |
|
14 | 14 |
- memcpy(*command, hdr.command, VMWAREDEPLOYPKG_CMD_LENGTH); |
15 | 15 |
+ // will pad with '\0' if necessary |
16 | 16 |
+ strncpy(*command, hdr.command, VMWAREDEPLOYPKG_CMD_LENGTH); |
... | ... |
@@ -19,11 +20,11 @@ |
19 | 19 |
+ |
20 | 20 |
*archiveType = hdr.payloadType; |
21 | 21 |
*flags = hdr.reserved; |
22 |
- |
|
23 |
-@@ -1074,6 +1078,20 @@ |
|
24 |
- free(command); |
|
25 |
- deployStatus = CloudInitSetup(tmpDirPath); |
|
22 |
+ |
|
23 |
+@@ -1094,6 +1098,20 @@ |
|
26 | 24 |
} else { |
25 |
+ sLog(log_info, "cloud-init is either not installed or the flag to enable \ |
|
26 |
+ cloud-init is not set.\n Executing traditional GOSC workflow"); |
|
27 | 27 |
+ if ((strstr(command, "scripts/Customize.pl") != NULL) || (strstr(command, "scripts/customize.sh") != NULL)) { |
28 | 28 |
+ free (command); |
29 | 29 |
+ const char* PHOTON_OS_LAUNCH_COMMAND = "/bin/bash /usr/share/open-vm-tools/GOSC/gosc-scripts/imc-shell/imgcust-scripts/customize.sh /tmp/.vmware/linux/deploy/cust.cfg"; |
... | ... |
@@ -40,3 +41,4 @@ |
40 | 40 |
+ sLog(log_info, "Launching deployment %s. \n", command); |
41 | 41 |
deploymentResult = ForkExecAndWaitCommand(command); |
42 | 42 |
free(command); |
43 |
+ |
43 | 44 |
deleted file mode 100644 |
... | ... |
@@ -1,11 +0,0 @@ |
1 |
-diff -Naur open-vm-tools.orig/lib/wiper/wiperPosix.c open-vm-tools/lib/wiper/wiperPosix.c |
|
2 |
-+++ open-vm-tools/lib/wiper/wiperPosix.c 2017-03-24 13:13:29.118630435 -0700 |
|
3 |
-@@ -29,6 +29,7 @@ |
|
4 |
- |
|
5 |
- #include <stdio.h> |
|
6 |
- #include <sys/stat.h> |
|
7 |
-+#include <sys/sysmacros.h> |
|
8 |
- #if defined(__linux__) || defined(sun) |
|
9 |
- # include <sys/vfs.h> |
|
10 |
- #elif defined(__FreeBSD__) || defined(__APPLE__) |
11 | 1 |
deleted file mode 100755 |
... | ... |
@@ -1,267 +0,0 @@ |
1 |
-+++ libDeployPkg/linuxDeployment.c.ORIG 2016-10-11 14:08:49.000097000 -0400 |
|
2 |
-@@ -43,6 +43,8 @@ |
|
3 |
- #include "mspackWrapper.h" |
|
4 |
- #include "rpcout.h" |
|
5 |
- #include "toolsDeployPkg.h" |
|
6 |
-+#include <strutil.h> |
|
7 |
-+#include <util.h> |
|
8 |
- |
|
9 |
- /* |
|
10 |
- * These are covered by #ifndef to give the ability to change these |
|
11 |
-@@ -52,12 +54,17 @@ |
|
12 |
- |
|
13 |
- #define CLEANUPCMD "/bin/rm -r -f " |
|
14 |
- |
|
15 |
--#ifndef EXTRACTPATH |
|
16 |
--#define EXTRACTPATH "/tmp/.vmware/linux/deploy" |
|
17 |
-+#ifndef TMP_PATH_VAR |
|
18 |
-+#define TMP_PATH_VAR "/tmp/.vmware/linux/deploy" |
|
19 |
- #endif |
|
20 |
- |
|
21 |
--#ifndef CLEANUPPATH |
|
22 |
--#define CLEANUPPATH "/tmp/.vmware" |
|
23 |
-+#ifndef IMC_TMP_PATH_VAR |
|
24 |
-+#define IMC_TMP_PATH_VAR "@@IMC_TMP_PATH_VAR@@" |
|
25 |
-+#endif |
|
26 |
-+ |
|
27 |
-+// '/tmp' below will be addressed by PR 1601405. |
|
28 |
-+#ifndef TMP_DIR_PATH_PATTERN |
|
29 |
-+#define TMP_DIR_PATH_PATTERN "/tmp/.vmware-imgcust-dXXXXXX" |
|
30 |
- #endif |
|
31 |
- |
|
32 |
- #ifndef BASEFILENAME |
|
33 |
-@@ -115,7 +122,6 @@ |
|
34 |
- // Private functions |
|
35 |
- static Bool GetPackageInfo(const char* pkgName, char** cmd, uint8* type, uint8* flags); |
|
36 |
- static Bool ExtractZipPackage(const char* pkg, const char* dest); |
|
37 |
--static Bool CreateDir(const char *path); |
|
38 |
- static void Init(void); |
|
39 |
- static struct List* AddToList(struct List* head, const char* token); |
|
40 |
- static int ListSize(struct List* head); |
|
41 |
-@@ -151,8 +157,17 @@ |
|
42 |
- NORETURN void |
|
43 |
- Panic(const char *fmtstr, ...) |
|
44 |
- { |
|
45 |
-- /* Ignored */ |
|
46 |
-- sLog(log_warning, "Panic callback invoked. \n"); |
|
47 |
-+ va_list args; |
|
48 |
-+ |
|
49 |
-+ char *tmp = Util_SafeMalloc(MAXSTRING); |
|
50 |
-+ |
|
51 |
-+ va_start(args, fmtstr); |
|
52 |
-+ vsprintf(tmp, fmtstr, args); |
|
53 |
-+ |
|
54 |
-+ sLog(log_error, "Panic callback invoked: %s\n", tmp); |
|
55 |
-+ |
|
56 |
-+ free(tmp); |
|
57 |
-+ |
|
58 |
- exit(1); |
|
59 |
- } |
|
60 |
- |
|
61 |
-@@ -169,12 +184,19 @@ |
|
62 |
- * |
|
63 |
- **/ |
|
64 |
- void |
|
65 |
--Debug(const char *fmtstr, |
|
66 |
-- va_list args) |
|
67 |
-+Debug(const char *fmtstr, ...) |
|
68 |
- { |
|
69 |
-- /* Ignored */ |
|
70 |
- #ifdef VMX86_DEBUG |
|
71 |
-- sLog(log_warning, "Debug callback invoked. \n"); |
|
72 |
-+ va_list args; |
|
73 |
-+ |
|
74 |
-+ char *tmp = Util_SafeMalloc(MAXSTRING); |
|
75 |
-+ |
|
76 |
-+ va_start(args, fmtstr); |
|
77 |
-+ vsprintf(tmp, fmtstr, args); |
|
78 |
-+ |
|
79 |
-+ sLog(log_debug, "Debug callback invoked: %s\n", tmp); |
|
80 |
-+ |
|
81 |
-+ free(tmp); |
|
82 |
- #endif |
|
83 |
- } |
|
84 |
- |
|
85 |
-@@ -979,6 +1001,7 @@ |
|
86 |
- Deploy(const char* packageName) |
|
87 |
- { |
|
88 |
- int deployStatus = DEPLOY_SUCCESS; |
|
89 |
-+ char* pkgCommand = NULL; |
|
90 |
- char* command = NULL; |
|
91 |
- int deploymentResult = 0; |
|
92 |
- char *nics; |
|
93 |
-@@ -986,6 +1009,7 @@ |
|
94 |
- uint8 archiveType; |
|
95 |
- uint8 flags; |
|
96 |
- bool forceSkipReboot = false; |
|
97 |
-+ char *tmpDirPath; |
|
98 |
- Bool cloudInitEnabled = FALSE; |
|
99 |
- const char *cloudInitConfigFilePath = "/etc/cloud/cloud.cfg"; |
|
100 |
- char cloudCommand[1024]; |
|
101 |
-@@ -998,33 +1022,41 @@ |
|
102 |
- TOOLSDEPLOYPKG_ERROR_SUCCESS, |
|
103 |
- NULL); |
|
104 |
- |
|
105 |
-+ tmpDirPath = mkdtemp((char *)Util_SafeStrdup(TMP_DIR_PATH_PATTERN)); |
|
106 |
-+ if (tmpDirPath == NULL) { |
|
107 |
-+ SetDeployError("Error creating tmp dir: %s", strerror(errno)); |
|
108 |
-+ return DEPLOY_ERROR; |
|
109 |
-+ } |
|
110 |
-+ |
|
111 |
- sLog(log_info, "Reading cabinet file %s. \n", packageName); |
|
112 |
- |
|
113 |
- // Get the command to execute |
|
114 |
-- if (!GetPackageInfo(packageName, &command, &archiveType, &flags)) { |
|
115 |
-+ if (!GetPackageInfo(packageName, &pkgCommand, &archiveType, &flags)) { |
|
116 |
- SetDeployError("Error extracting package header information. (%s)", |
|
117 |
- GetDeployError()); |
|
118 |
-+ free(tmpDirPath); |
|
119 |
- return DEPLOY_ERROR; |
|
120 |
- } |
|
121 |
- |
|
122 |
-- // Print the header command |
|
123 |
--#ifdef VMX86_DEBUG |
|
124 |
-- sLog(log_debug, "Header command: %s \n ", command); |
|
125 |
--#endif |
|
126 |
-- |
|
127 |
-- // create the destination directory |
|
128 |
-- if (!CreateDir(EXTRACTPATH "/")) { |
|
129 |
-- free(command); |
|
130 |
-- return DEPLOY_ERROR; |
|
131 |
-+ sLog(log_info, "Original deployment command: %s\n", pkgCommand); |
|
132 |
-+ if (strstr(pkgCommand, IMC_TMP_PATH_VAR) != NULL) { |
|
133 |
-+ command = StrUtil_ReplaceAll(pkgCommand, IMC_TMP_PATH_VAR, tmpDirPath); |
|
134 |
-+ } else { |
|
135 |
-+ command = StrUtil_ReplaceAll(pkgCommand, TMP_PATH_VAR, tmpDirPath); |
|
136 |
- } |
|
137 |
-+ free(pkgCommand); |
|
138 |
-+ |
|
139 |
-+ sLog(log_info, "Actual deployment command: %s\n", command); |
|
140 |
- |
|
141 |
- if (archiveType == VMWAREDEPLOYPKG_PAYLOAD_TYPE_CAB) { |
|
142 |
-- if (!ExtractCabPackage(packageName, EXTRACTPATH)) { |
|
143 |
-+ if (!ExtractCabPackage(packageName, tmpDirPath)) { |
|
144 |
-+ free(tmpDirPath); |
|
145 |
- free(command); |
|
146 |
- return DEPLOY_ERROR; |
|
147 |
- } |
|
148 |
- } else if (archiveType == VMWAREDEPLOYPKG_PAYLOAD_TYPE_ZIP) { |
|
149 |
-- if (!ExtractZipPackage(packageName, EXTRACTPATH)) { |
|
150 |
-+ if (!ExtractZipPackage(packageName, tmpDirPath)) { |
|
151 |
-+ free(tmpDirPath); |
|
152 |
- free(command); |
|
153 |
- return DEPLOY_ERROR; |
|
154 |
- } |
|
155 |
-@@ -1040,10 +1072,8 @@ |
|
156 |
- cloudInitEnabled = TRUE; |
|
157 |
- sSkipReboot = TRUE; |
|
158 |
- free(command); |
|
159 |
-- deployStatus = CloudInitSetup(EXTRACTPATH); |
|
160 |
-+ deployStatus = CloudInitSetup(tmpDirPath); |
|
161 |
- } else { |
|
162 |
-- // Run the deployment command |
|
163 |
-- sLog(log_info, "Launching deployment %s. \n", command); |
|
164 |
- deploymentResult = ForkExecAndWaitCommand(command); |
|
165 |
- free(command); |
|
166 |
- |
|
167 |
-@@ -1089,7 +1119,7 @@ |
|
168 |
- * of the sucess/failure of the customization so that at the end of it we |
|
169 |
- * always have nics enabled. |
|
170 |
- */ |
|
171 |
-- nics = GetNicsToEnable(EXTRACTPATH); |
|
172 |
-+ nics = GetNicsToEnable(tmpDirPath); |
|
173 |
- if (nics) { |
|
174 |
- // XXX: Sleep before the last SetCustomizationStatusInVmx |
|
175 |
- // This is a temporary-hack for PR 422790 |
|
176 |
-@@ -1104,22 +1134,23 @@ |
|
177 |
- } |
|
178 |
- } |
|
179 |
- |
|
180 |
-- cleanupCommand = malloc(strlen(CLEANUPCMD) + strlen(CLEANUPPATH) + 1); |
|
181 |
-+ cleanupCommand = malloc(strlen(CLEANUPCMD) + strlen(tmpDirPath) + 1); |
|
182 |
- if (!cleanupCommand) { |
|
183 |
- SetDeployError("Error allocating memory."); |
|
184 |
-+ free(tmpDirPath); |
|
185 |
- return DEPLOY_ERROR; |
|
186 |
- } |
|
187 |
- |
|
188 |
- strcpy(cleanupCommand, CLEANUPCMD); |
|
189 |
-- strcat(cleanupCommand, CLEANUPPATH); |
|
190 |
-+ strcat(cleanupCommand, tmpDirPath); |
|
191 |
- |
|
192 |
- sLog(log_info, "Launching cleanup. \n"); |
|
193 |
- if (ForkExecAndWaitCommand(cleanupCommand) != 0) { |
|
194 |
-- sLog(log_warning, "Error while clean up. Error removing directory %s. (%s)", |
|
195 |
-- EXTRACTPATH, strerror (errno)); |
|
196 |
-- //TODO: What should be done if cleanup fails ?? |
|
197 |
-+ sLog(log_warning, "Error while clean up tmp directory %s: (%s)", |
|
198 |
-+ tmpDirPath, strerror (errno)); |
|
199 |
- } |
|
200 |
- free (cleanupCommand); |
|
201 |
-+ free(tmpDirPath); |
|
202 |
- |
|
203 |
- if (flags & VMWAREDEPLOYPKG_HEADER_FLAGS_SKIP_REBOOT) { |
|
204 |
- forceSkipReboot = true; |
|
205 |
-@@ -1388,61 +1419,6 @@ |
|
206 |
- return retval; |
|
207 |
- } |
|
208 |
- |
|
209 |
--/** |
|
210 |
-- * Sets up the path for exracting file. For e.g. if the file is /a/b/c/d.abc |
|
211 |
-- * then it creates /a/b/c (skips if any of the directories along the path |
|
212 |
-- * exists). If the the path ends in '/', then the the entire input is assumed |
|
213 |
-- * to be a directory and is created as such. |
|
214 |
-- * |
|
215 |
-- * @param path IN: Complete path of the file |
|
216 |
-- * @return TRUE on success |
|
217 |
-- */ |
|
218 |
-- |
|
219 |
--Bool |
|
220 |
--CreateDir(const char* path) |
|
221 |
--{ |
|
222 |
-- struct stat stats; |
|
223 |
-- char* token; |
|
224 |
-- char* copy; |
|
225 |
-- |
|
226 |
-- // make a copy we can modify |
|
227 |
-- copy = strdup(path); |
|
228 |
-- |
|
229 |
-- // walk through the path (it employs in string replacement) |
|
230 |
-- for (token = copy + 1; *token; ++token) { |
|
231 |
-- |
|
232 |
-- // find |
|
233 |
-- if (*token != '/') { |
|
234 |
-- continue; |
|
235 |
-- } |
|
236 |
-- |
|
237 |
-- /* |
|
238 |
-- * cut it off here for e.g. on first iteration /a/b/c/d.abc will have |
|
239 |
-- * token /a, on second /a/b etc |
|
240 |
-- */ |
|
241 |
-- *token = 0; |
|
242 |
-- |
|
243 |
-- sLog(log_debug, "Creating directory %s", copy); |
|
244 |
-- |
|
245 |
-- // ignore if the directory exists |
|
246 |
-- if (!((stat(copy, &stats) == 0) && S_ISDIR(stats.st_mode))) { |
|
247 |
-- // make directory and check error (accessible only by owner) |
|
248 |
-- if (mkdir(copy, 0700) == -1) { |
|
249 |
-- sLog(log_error, "Unable to create directory %s (%s)", copy, |
|
250 |
-- strerror(errno)); |
|
251 |
-- free(copy); |
|
252 |
-- return FALSE; |
|
253 |
-- } |
|
254 |
-- } |
|
255 |
-- |
|
256 |
-- // restore the token |
|
257 |
-- *token = '/'; |
|
258 |
-- } |
|
259 |
-- |
|
260 |
-- free(copy); |
|
261 |
-- return TRUE; |
|
262 |
--} |
|
263 |
-- |
|
264 |
- //...................................................................................... |
|
265 |
- |
|
266 |
- /** |
... | ... |
@@ -1,25 +1,23 @@ |
1 | 1 |
Summary: Usermode tools for VmWare virts |
2 | 2 |
Name: open-vm-tools |
3 |
-Version: 10.1.5 |
|
4 |
-Release: 6%{?dist} |
|
3 |
+Version: 10.1.10 |
|
4 |
+Release: 1%{?dist} |
|
5 | 5 |
License: LGPLv2+ |
6 | 6 |
URL: https://github.com/vmware/open-vm-tools |
7 | 7 |
Group: Applications/System |
8 | 8 |
Vendor: VMware, Inc. |
9 | 9 |
Distribution: Photon |
10 | 10 |
Source0: https://github.com/vmware/open-vm-tools/archive/%{name}-stable-%{version}.tar.gz |
11 |
-%define sha1 open-vm-tools=9672874e8b785de27d7fda57bf791f900546c18f |
|
11 |
+%define sha1 open-vm-tools=26ac84e86b4c862006b8de7973802e45dfd77464 |
|
12 | 12 |
Source1: gosc-scripts-1.0.tar.gz |
13 | 13 |
%define sha1 gosc-scripts-1.0=5031dd9b3b0569a40d2ee0caaa55a1cbf782345e |
14 | 14 |
Source2: vmtoolsd.service |
15 | 15 |
Source3: vgauthd.service |
16 |
-Patch0: open-vm-tools-tmp-race.patch |
|
17 |
-Patch1: IPv6Support.patch |
|
18 |
-Patch2: hostnameReCustomizationFix.patch |
|
19 |
-Patch3: PureIPv6-hosts.patch |
|
20 |
-Patch4: open-vm-tools-sysmacros.patch |
|
21 |
-Patch5: GOSC-libDeploy.patch |
|
22 |
-Patch6: timezoneCust.patch |
|
16 |
+Patch0: IPv6Support.patch |
|
17 |
+Patch1: hostnameReCustomizationFix.patch |
|
18 |
+Patch2: PureIPv6-hosts.patch |
|
19 |
+Patch3: GOSC-libDeploy.patch |
|
20 |
+Patch4: timezoneCust.patch |
|
23 | 21 |
BuildRequires: glib-devel |
24 | 22 |
BuildRequires: xerces-c-devel |
25 | 23 |
BuildRequires: xml-security-c-devel |
... | ... |
@@ -54,10 +52,8 @@ It contains the libraries and header files to create applications. |
54 | 54 |
%patch0 -p0 |
55 | 55 |
%patch1 -p0 |
56 | 56 |
%patch2 -p0 |
57 |
-%patch3 -p0 |
|
58 |
-%patch4 -p1 |
|
59 |
-%patch5 -p1 |
|
60 |
-%patch6 -p0 |
|
57 |
+%patch3 -p2 |
|
58 |
+%patch4 -p0 |
|
61 | 59 |
%build |
62 | 60 |
touch ChangeLog |
63 | 61 |
autoreconf -i |
... | ... |
@@ -117,6 +113,8 @@ fi |
117 | 117 |
%{_libdir}/*.so |
118 | 118 |
|
119 | 119 |
%changelog |
120 |
+* Tue Aug 22 2017 Kumar Kaushik <kaushikk@vmware.com> 10.1.10-1 |
|
121 |
+- Updating version to 10.1.10, removing upstream patches. |
|
120 | 122 |
* Fri Jun 23 2017 Xiaolin Li <xiaolinl@vmware.com> 10.1.5-6 |
121 | 123 |
- Add libdnet-devel and libmspack-devel to BuildRequires, add devel package. |
122 | 124 |
* Mon Jun 05 2017 Bo Gan <ganb@vmware.com> 10.1.5-5 |