diff --git a/.gitignore b/.gitignore index f4121f1..c1456e0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /open-vm-tools-10.3.0-8931395.tar.gz /open-vm-tools-10.3.5-10430147.tar.gz /open-vm-tools-10.3.10-12406962.tar.gz +/open-vm-tools-11.0.0-14549434.tar.gz diff --git a/gcc9-static-inline.patch b/gcc9-static-inline.patch new file mode 100644 index 0000000..d102c31 --- /dev/null +++ b/gcc9-static-inline.patch @@ -0,0 +1,73 @@ +diff --git a/open-vm-tools/lib/include/vmware/tools/plugin.h b/open-vm-tools/lib/include/vmware/tools/plugin.h +index f9acc6a29..deefd1f3d 100644 +--- a/open-vm-tools/lib/include/vmware/tools/plugin.h ++++ b/open-vm-tools/lib/include/vmware/tools/plugin.h +@@ -290,7 +290,7 @@ typedef struct ToolsAppCtx { + * + * @return TRUE if COM is initialized when the function returns. + */ +-G_INLINE_FUNC gboolean ++static inline gboolean + ToolsCore_InitializeCOM(ToolsAppCtx *ctx) + { + if (!ctx->comInitialized) { +diff --git a/open-vm-tools/lib/include/vmware/tools/threadPool.h b/open-vm-tools/lib/include/vmware/tools/threadPool.h +index 3f2082b3e..5880fbcff 100644 +--- a/open-vm-tools/lib/include/vmware/tools/threadPool.h ++++ b/open-vm-tools/lib/include/vmware/tools/threadPool.h +@@ -91,7 +91,7 @@ typedef struct ToolsCorePool { + ******************************************************************************* + */ + +-G_INLINE_FUNC ToolsCorePool * ++static inline ToolsCorePool * + ToolsCorePool_GetPool(ToolsAppCtx *ctx) + { + ToolsCorePool *pool = NULL; +@@ -123,7 +123,7 @@ ToolsCorePool_GetPool(ToolsAppCtx *ctx) + ******************************************************************************* + */ + +-G_INLINE_FUNC guint ++static inline guint + ToolsCorePool_SubmitTask(ToolsAppCtx *ctx, + ToolsCorePoolCb cb, + gpointer data, +@@ -153,7 +153,7 @@ ToolsCorePool_SubmitTask(ToolsAppCtx *ctx, + ******************************************************************************* + */ + +-G_INLINE_FUNC void ++static inline void + ToolsCorePool_CancelTask(ToolsAppCtx *ctx, + guint taskId) + { +@@ -197,7 +197,7 @@ ToolsCorePool_CancelTask(ToolsAppCtx *ctx, + ******************************************************************************* + */ + +-G_INLINE_FUNC gboolean ++static inline gboolean + ToolsCorePool_StartThread(ToolsAppCtx *ctx, + const gchar *threadName, + ToolsCorePoolCb cb, +diff --git a/open-vm-tools/lib/include/vmware/tools/utils.h b/open-vm-tools/lib/include/vmware/tools/utils.h +index f65745906..a3292d5c0 100644 +--- a/open-vm-tools/lib/include/vmware/tools/utils.h ++++ b/open-vm-tools/lib/include/vmware/tools/utils.h +@@ -51,15 +51,6 @@ + # include + #endif + +- +-/* Work around a glib limitation: it doesn't set G_INLINE_FUNC on Win32. */ +-#if defined(G_PLATFORM_WIN32) +-# if defined(G_INLINE_FUNC) +-# undef G_INLINE_FUNC +-# endif +-# define G_INLINE_FUNC static __inline +-#endif +- + #ifndef ABS + # define ABS(x) (((x) >= 0) ? (x) : -(x)) + #endif diff --git a/gcc9-warnings.patch b/gcc9-warnings.patch deleted file mode 100644 index 0f7dbb5..0000000 --- a/gcc9-warnings.patch +++ /dev/null @@ -1,1259 +0,0 @@ ---- open-vm-tools-10.3.0-8931395-orig/vmhgfs-fuse/dir.c 2018-06-23 03:03:28.000000000 -0700 -+++ open-vm-tools-10.3.0-8931395/vmhgfs-fuse/dir.c 2019-02-12 14:37:35.773990588 -0800 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2013 VMware, Inc. All rights reserved. -+ * Copyright (C) 2013,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 -@@ -54,38 +54,53 @@ - HgfsOp opUsed, // IN: Op to be used - HgfsReq *req) // IN/OUT: Packet to write into - { -- char *name; -- unsigned int *nameLength = NULL; - size_t reqSize; -- int result; - - ASSERT(path); - ASSERT(req); - LOG(4, ("Path = %s \n", path)); - switch (opUsed) { - case HGFS_OP_SEARCH_OPEN_V3: { -+ int result; - HgfsRequestSearchOpenV3 *requestV3 = HgfsGetRequestPayload(req); - -- /* We'll use these later. */ -- name = requestV3->dirName.name; -- nameLength = &requestV3->dirName.length; - requestV3->dirName.flags = 0; - requestV3->dirName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; - requestV3->dirName.fid = HGFS_INVALID_HANDLE; - requestV3->reserved = 0; - reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (reqSize - 1), -+ requestV3->dirName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed\n")); -+ return -EINVAL; -+ } -+ LOG(4, ("After conversion = %s\n", requestV3->dirName.name)); -+ requestV3->dirName.length = result; -+ reqSize += result; - break; - } - - case HGFS_OP_SEARCH_OPEN: { -+ int result; - HgfsRequestSearchOpen *request; - - request = (HgfsRequestSearchOpen *)(HGFS_REQ_PAYLOAD(req)); - -- /* We'll use these later. */ -- name = request->dirName.name; -- nameLength = &request->dirName.length; - reqSize = sizeof *request; -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (reqSize - 1), -+ request->dirName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed\n")); -+ return -EINVAL; -+ } -+ LOG(4, ("After conversion = %s\n", request->dirName.name)); -+ request->dirName.length = result; -+ reqSize += result; - break; - } - -@@ -94,21 +109,7 @@ - return -EPROTO; - } - -- /* Convert to CP name. */ -- -- LOG(4, ("After buildPath = %s\n", path)); -- result = CPName_ConvertTo(path, -- HGFS_LARGE_PACKET_MAX - (reqSize - 1), -- name); -- if (result < 0) { -- LOG(4, ("CP conversion failed\n")); -- return -EINVAL; -- } -- -- LOG(4, ("After conversion = %s\n", name)); -- -- *nameLength = (uint32) result; -- req->payloadSize = reqSize + result; -+ req->payloadSize = reqSize; - - /* Fill in header here as payloadSize needs to be there. */ - HgfsPackHeader(req, opUsed); -@@ -149,7 +150,6 @@ - int result; - HgfsOp opUsed; - HgfsStatus replyStatus; -- HgfsHandle *replySearch; - - ASSERT(path); - req = HgfsGetNewRequest(); -@@ -161,16 +161,6 @@ - - retry: - opUsed = hgfsVersionSearchOpen; -- if (opUsed == HGFS_OP_SEARCH_OPEN_V3) { -- HgfsReplySearchOpenV3 *requestV3 = HgfsGetReplyPayload(req); -- -- replySearch = &requestV3->search; -- -- } else { -- HgfsReplySearchOpen *request = (HgfsReplySearchOpen *)HGFS_REQ_PAYLOAD(req); -- -- replySearch = &request->search; -- } - - result = HgfsPackDirOpenRequest(path, opUsed, req); - if (result != 0) { -@@ -187,8 +177,14 @@ - - switch (result) { - case 0: -- *handle = *replySearch; -- LOG(6, ("Set handle to %u\n", *replySearch)); -+ if (opUsed == HGFS_OP_SEARCH_OPEN_V3) { -+ HgfsReplySearchOpenV3 *requestV3 = HgfsGetReplyPayload(req); -+ *handle = requestV3->search; -+ } else { -+ HgfsReplySearchOpen *request = (HgfsReplySearchOpen *)HGFS_REQ_PAYLOAD(req); -+ *handle = request->search; -+ } -+ LOG(6, ("Set handle to %u\n", *handle)); - break; - case -EPROTO: - /* Retry with older version(s). Set globally. */ -@@ -626,25 +622,30 @@ - HgfsOp opUsed, // IN: Op to be used. - HgfsReq *req) // IN/OUT: Packet to write into - { -- char *fileName = NULL; -- uint32 *fileNameLength; - size_t reqSize; -- int result; -+ - - ASSERT(req); - - switch (opUsed) { - case HGFS_OP_CREATE_DIR_V3: { -+ int result; - HgfsRequestCreateDirV3 *requestV3 = HgfsGetRequestPayload(req); - - reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); -- /* We'll use these later. */ -- fileName = requestV3->fileName.name; -- fileNameLength = &requestV3->fileName.length; - requestV3->fileName.flags = 0; - requestV3->fileName.fid = HGFS_INVALID_HANDLE; - requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; -- -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (reqSize - 1), -+ requestV3->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ requestV3->fileName.length = result; -+ reqSize += result; - requestV3->mask = HGFS_CREATE_DIR_MASK; - - /* Set permissions. */ -@@ -656,15 +657,23 @@ - break; - } - case HGFS_OP_CREATE_DIR_V2: { -+ int result; - HgfsRequestCreateDirV2 *requestV2; - - requestV2 = (HgfsRequestCreateDirV2 *)(HGFS_REQ_PAYLOAD(req)); - -- /* We'll use these later. */ -- fileName = requestV2->fileName.name; -- fileNameLength = &requestV2->fileName.length; - reqSize = sizeof *requestV2; - -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (reqSize - 1), -+ requestV2->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ requestV2->fileName.length = result; -+ reqSize += result; - requestV2->mask = HGFS_CREATE_DIR_MASK; - - /* Set permissions. */ -@@ -675,15 +684,22 @@ - break; - } - case HGFS_OP_CREATE_DIR: { -+ int result; - HgfsRequestCreateDir *request; - - request = (HgfsRequestCreateDir *)(HGFS_REQ_PAYLOAD(req)); - -- /* We'll use these later. */ -- fileName = request->fileName.name; -- fileNameLength = &request->fileName.length; - reqSize = sizeof *request; -- -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (reqSize - 1), -+ request->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ request->fileName.length = result; -+ reqSize += result; - /* Set permissions. */ - request->permissions = (permsMode & S_IRWXU) >> 6; - break; -@@ -693,18 +709,7 @@ - return -EPROTO; - } - -- -- /* Convert to CP name. */ -- result = CPName_ConvertTo(path, -- HGFS_LARGE_PACKET_MAX - (reqSize - 1), -- fileName); -- if (result < 0) { -- LOG(4, ("CP conversion failed.\n")); -- return -EINVAL; -- } -- -- *fileNameLength = result; -- req->payloadSize = reqSize + result; -+ req->payloadSize = reqSize; - - /* Fill in header here as payloadSize needs to be there. */ - HgfsPackHeader(req, opUsed); -@@ -827,8 +832,6 @@ - HgfsReq *req = NULL; - int result = 0; - HgfsStatus replyStatus; -- char *fileName = NULL; -- uint32 *fileNameLength; - uint32 reqSize; - HgfsOp opUsed; - HgfsAttrInfo newAttr = {0}; -@@ -862,8 +865,17 @@ - - reqSize = sizeof(*request) + HgfsGetRequestHeaderSize(); - request->hints = 0; -- fileName = request->fileName.name; -- fileNameLength = &request->fileName.length; -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), -+ request->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ result = -EINVAL; -+ goto out; -+ } -+ request->fileName.length = result; -+ reqSize += result; - request->fileName.fid = HGFS_INVALID_HANDLE; - request->fileName.flags = 0; - request->fileName.caseType = HGFS_FILE_NAME_DEFAULT_CASE; -@@ -874,24 +886,21 @@ - - request = (HgfsRequestDelete *)(HGFS_REQ_PAYLOAD(req)); - /* Fill out the request packet. */ -- fileName = request->fileName.name; -- fileNameLength = &request->fileName.length; - reqSize = sizeof *request; -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), -+ request->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ result = -EINVAL; -+ goto out; -+ } -+ request->fileName.length = result; -+ reqSize += result; - } - -- -- /* Convert to CP name. */ -- result = CPName_ConvertTo(path, -- HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), -- fileName); -- if (result < 0) { -- LOG(4, ("CP conversion failed.\n")); -- result = -EINVAL; -- goto out; -- } -- -- *fileNameLength = result; -- req->payloadSize = reqSize + result; -+ req->payloadSize = reqSize; - - /* Fill in header here as payloadSize needs to be there. */ - HgfsPackHeader(req, opUsed); ---- open-vm-tools-10.3.0-8931395-orig/vmhgfs-fuse/file.c 2018-06-23 03:03:28.000000000 -0700 -+++ open-vm-tools-10.3.0-8931395/vmhgfs-fuse/file.c 2019-02-11 18:46:55.342639145 -0800 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2013,2017 VMware, Inc. All rights reserved. -+ * Copyright (C) 2013,2018-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 -@@ -66,10 +66,7 @@ - HgfsOp opUsed, // IN: Op to use - HgfsReq *req) // IN/OUT: Packet to write into - { -- char *name; -- uint32 *nameLength; - size_t reqSize; -- int result; - int openMode, openFlags; - - ASSERT(path); -@@ -88,14 +85,22 @@ - - switch (opUsed) { - case HGFS_OP_OPEN_V3: { -+ int result; - HgfsRequestOpenV3 *requestV3 = HgfsGetRequestPayload(req); - - reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); - -- /* We'll use these later. */ -- name = requestV3->fileName.name; -- nameLength = &requestV3->fileName.length; -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (reqSize - 1), -+ requestV3->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } - -+ requestV3->fileName.length = result; -+ reqSize += result; - /* Linux clients need case-sensitive lookups. */ - requestV3->fileName.flags = 0; - requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; -@@ -122,15 +127,24 @@ - } - - case HGFS_OP_OPEN_V2: { -+ int result; - HgfsRequestOpenV2 *requestV2; - - requestV2 = (HgfsRequestOpenV2 *)(HGFS_REQ_PAYLOAD(req)); - -- /* We'll use these later. */ -- name = requestV2->fileName.name; -- nameLength = &requestV2->fileName.length; - reqSize = sizeof *requestV2; - -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (reqSize - 1), -+ requestV2->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ -+ requestV2->fileName.length = result; -+ reqSize += result; - requestV2->mask = mask; - requestV2->mode = openMode; - requestV2->flags = openFlags; -@@ -148,14 +162,23 @@ - break; - } - case HGFS_OP_OPEN: { -+ int result; - HgfsRequestOpen *request; - - request = (HgfsRequestOpen *)(HGFS_REQ_PAYLOAD(req)); -- /* We'll use these later. */ -- name = request->fileName.name; -- nameLength = &request->fileName.length; - reqSize = sizeof *request; - -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (reqSize - 1), -+ request->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ -+ request->fileName.length = result; -+ reqSize += result; - request->mode = openMode; - request->flags = openFlags; - -@@ -168,18 +191,7 @@ - return -EPROTO; - } - -- -- /* Convert to CP name. */ -- result = CPName_ConvertTo(path, -- HGFS_LARGE_PACKET_MAX - (reqSize - 1), -- name); -- if (result < 0) { -- LOG(4, ("CP conversion failed.\n")); -- return -EINVAL; -- } -- -- *nameLength = (uint32) result; -- req->payloadSize = reqSize + result; -+ req->payloadSize = reqSize; - - /* Fill in header here as payloadSize needs to be there. */ - HgfsPackHeader(req, opUsed); -@@ -915,10 +927,6 @@ - HgfsRename(const char* from, const char* to) - { - HgfsReq *req = NULL; -- char *oldName; -- char *newName; -- uint32 *oldNameLength; -- uint32 *newNameLength; - int result = 0; - uint32 reqSize; - HgfsOp opUsed; -@@ -942,33 +950,41 @@ - if (opUsed == HGFS_OP_RENAME_V3) { - HgfsRequestRenameV3 *requestV3 = HgfsGetRequestPayload(req); - -- oldName = requestV3->oldName.name; -- oldNameLength = &requestV3->oldName.length; - requestV3->hints = 0; - requestV3->oldName.flags = 0; - requestV3->oldName.fid = HGFS_INVALID_HANDLE; - requestV3->oldName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; - requestV3->reserved = 0; - reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); -+ /* Convert old name to CP format. */ -+ result = CPName_ConvertTo(from, -+ HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), -+ requestV3->oldName.name); -+ if (result < 0) { -+ LOG(4, ("oldName CP conversion failed\n")); -+ result = -EINVAL; -+ goto out; -+ } -+ -+ requestV3->oldName.length = result; -+ reqSize += result; - } else { - HgfsRequestRename *request = (HgfsRequestRename *)HGFS_REQ_PAYLOAD(req); - -- oldName = request->oldName.name; -- oldNameLength = &request->oldName.length; - reqSize = sizeof *request; -- } -- /* Convert old name to CP format. */ -- result = CPName_ConvertTo(from, -- HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), -- oldName); -- if (result < 0) { -- LOG(4, ("oldName CP conversion failed\n")); -- result = -EINVAL; -- goto out; -- } -+ /* Convert old name to CP format. */ -+ result = CPName_ConvertTo(from, -+ HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), -+ request->oldName.name); -+ if (result < 0) { -+ LOG(4, ("oldName CP conversion failed\n")); -+ result = -EINVAL; -+ goto out; -+ } - -- *oldNameLength = result; -- reqSize += result; -+ request->oldName.length = result; -+ reqSize += result; -+ } - - /* - * Build full new name to send to server. -@@ -983,8 +999,20 @@ - - newNameP = (HgfsFileNameV3 *)((char *)&requestV3->oldName + - sizeof requestV3->oldName + result); -- newName = newNameP->name; -- newNameLength = &newNameP->length; -+ -+ LOG(6, ("New name: \"%s\"\n", newNameP->name)); -+ -+ /* Convert new name to CP format. */ -+ result = CPName_ConvertTo(to, -+ HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize) - result, -+ newNameP->name); -+ if (result < 0) { -+ LOG(4, ("newName CP conversion failed\n")); -+ result = -EINVAL; -+ goto out; -+ } -+ newNameP->length = result; -+ reqSize += result; - newNameP->flags = 0; - newNameP->fid = HGFS_INVALID_HANDLE; - newNameP->caseType = HGFS_FILE_NAME_CASE_SENSITIVE; -@@ -993,24 +1021,22 @@ - HgfsFileName *newNameP; - newNameP = (HgfsFileName *)((char *)&request->oldName + - sizeof request->oldName + result); -- newName = newNameP->name; -- newNameLength = &newNameP->length; -- } - -- LOG(6, ("New name: \"%s\"\n", newName)); -+ LOG(6, ("New name: \"%s\"\n", newNameP->name)); - -- /* Convert new name to CP format. */ -- result = CPName_ConvertTo(to, -- HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize) - result, -- newName); -- if (result < 0) { -- LOG(4, ("newName CP conversion failed\n")); -- result = -EINVAL; -- goto out; -+ /* Convert new name to CP format. */ -+ result = CPName_ConvertTo(to, -+ HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize) - result, -+ newNameP->name); -+ if (result < 0) { -+ LOG(4, ("newName CP conversion failed\n")); -+ result = -EINVAL; -+ goto out; -+ } -+ newNameP->length = result; -+ reqSize += result; - } - -- *newNameLength = result; -- reqSize += result; - req->payloadSize = reqSize; - - /* Fill in header here as payloadSize needs to be there. */ -@@ -1068,7 +1094,7 @@ - } - break; - default: -- LOG(4, ("failed with result %d\n", result)); -+ LOG(4, ("Server protocol result %d\n", result)); - } - break; - default: -@@ -1109,21 +1135,17 @@ - { - HgfsAttrV2 *attrV2; - HgfsAttr *attrV1; -- HgfsAttrHint *hints; - HgfsAttrChanges *update; -- char *fileName = NULL; -- uint32 *fileNameLength = NULL; - size_t reqBufferSize; - size_t reqSize; -- int result = 0; - ASSERT(req); - - switch (opUsed) { - case HGFS_OP_SETATTR_V3: { -+ int result; - HgfsRequestSetattrV3 *requestV3 = HgfsGetRequestPayload(req); - - attrV2 = &requestV3->attr; -- hints = &requestV3->hints; - - /* - * Clear attributes, mask, and hints before touching them. -@@ -1131,7 +1153,7 @@ - * make sure to zero them all here. - */ - memset(attrV2, 0, sizeof *attrV2); -- memset(hints, 0, sizeof *hints); -+ requestV3->hints = 0; - - /* - * When possible, issue a setattr using an existing handle. This will -@@ -1143,14 +1165,21 @@ - * the times also requires write permissions on Windows, so we require it - * here too. Otherwise, any handle will do. - */ -- fileName = requestV3->fileName.name; -- fileNameLength = &requestV3->fileName.length; - requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; - requestV3->fileName.fid = HGFS_INVALID_HANDLE; - requestV3->fileName.flags = 0; - requestV3->reserved = 0; - reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); - reqBufferSize = HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize); -+ result = CPName_ConvertTo(path, -+ reqBufferSize, -+ requestV3->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ requestV3->fileName.length = result; -+ reqSize += result; - - attrV2->mask = attr->mask; - if (attr->mask & (HGFS_ATTR_VALID_SPECIAL_PERMS | -@@ -1173,22 +1202,22 @@ - } - if (attr->mask & HGFS_ATTR_VALID_ACCESS_TIME) { - attrV2->accessTime = attr->accessTime; -- *hints |= HGFS_ATTR_HINT_SET_ACCESS_TIME; -+ requestV3->hints |= HGFS_ATTR_HINT_SET_ACCESS_TIME; - } - if (attr->mask & HGFS_ATTR_VALID_WRITE_TIME) { - attrV2->writeTime = attr->writeTime; -- *hints |= HGFS_ATTR_HINT_SET_WRITE_TIME; -+ requestV3->hints |= HGFS_ATTR_HINT_SET_WRITE_TIME; - } - - break; - } - case HGFS_OP_SETATTR_V2: { -+ int result; - HgfsRequestSetattrV2 *requestV2; - - requestV2 = (HgfsRequestSetattrV2 *)(HGFS_REQ_PAYLOAD(req)); - - attrV2 = &requestV2->attr; -- hints = &requestV2->hints; - - /* - * Clear attributes, mask, and hints before touching them. -@@ -1196,13 +1225,19 @@ - * make sure to zero them all here. - */ - memset(attrV2, 0, sizeof *attrV2); -- memset(hints, 0, sizeof *hints); -- -- fileName = requestV2->fileName.name; -- fileNameLength = &requestV2->fileName.length; -+ requestV2->hints = 0; - - reqSize = sizeof *requestV2; - reqBufferSize = HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, requestV2); -+ result = CPName_ConvertTo(path, -+ reqBufferSize, -+ requestV2->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ requestV2->fileName.length = result; -+ reqSize += result; - - if (attr->mask & (HGFS_ATTR_VALID_SPECIAL_PERMS | - HGFS_ATTR_VALID_OWNER_PERMS | -@@ -1224,16 +1259,17 @@ - } - if (attr->mask & HGFS_ATTR_VALID_ACCESS_TIME) { - attrV2->accessTime = attr->accessTime; -- *hints |= HGFS_ATTR_HINT_SET_ACCESS_TIME; -+ requestV2->hints |= HGFS_ATTR_HINT_SET_ACCESS_TIME; - } - if (attr->mask & HGFS_ATTR_VALID_WRITE_TIME) { - attrV2->writeTime = attr->writeTime; -- *hints |= HGFS_ATTR_HINT_SET_WRITE_TIME; -+ requestV2->hints |= HGFS_ATTR_HINT_SET_WRITE_TIME; - } - - break; - } - case HGFS_OP_SETATTR: { -+ int result; - HgfsRequestSetattr *request; - - request = (HgfsRequestSetattr *)(HGFS_REQ_PAYLOAD(req)); -@@ -1241,11 +1277,17 @@ - attrV1 = &request->attr; - update = &request->update; - -- /* We'll use these later. */ -- fileName = request->fileName.name; -- fileNameLength = &request->fileName.length; - reqSize = sizeof *request; - reqBufferSize = HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, request); -+ result = CPName_ConvertTo(path, -+ reqBufferSize, -+ request->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ request->fileName.length = result; -+ reqSize += result; - - /* - * Clear attributes before touching them. -@@ -1284,16 +1326,7 @@ - return -EPROTO; - } - -- result = CPName_ConvertTo(path, -- reqBufferSize, -- fileName); -- if (result < 0) { -- LOG(4, ("CP conversion failed.\n")); -- return -EINVAL; -- } -- -- *fileNameLength = result; -- req->payloadSize = reqSize + result; -+ req->payloadSize = reqSize; - - /* Fill in header here as payloadSize needs to be there. */ - HgfsPackHeader(req, opUsed); ---- open-vm-tools-10.3.0-8931395-orig/vmhgfs-fuse/filesystem.c 2018-06-23 03:03:28.000000000 -0700 -+++ open-vm-tools-10.3.0-8931395/vmhgfs-fuse/filesystem.c 2019-02-11 18:47:36.188968780 -0800 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2013 VMware, Inc. All rights reserved. -+ * Copyright (C) 2013,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 -@@ -123,36 +123,50 @@ - HgfsOp opUsed, // IN: Op to be used. - HgfsReq *req) // IN/OUT: Packet to write into - { -- char *name; -- uint32 *nameLength; - size_t requestSize; -- int result; -+ - - ASSERT(req); - - switch (opUsed) { - case HGFS_OP_QUERY_VOLUME_INFO_V3: { -+ int result; - HgfsRequestQueryVolumeV3 *requestV3 = HgfsGetRequestPayload(req); - -- /* We'll use these later. */ -- name = requestV3->fileName.name; -- nameLength = &requestV3->fileName.length; - requestV3->fileName.flags = 0; - requestV3->fileName.fid = HGFS_INVALID_HANDLE; - requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; - requestV3->reserved = 0; - requestSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (requestSize - 1), -+ requestV3->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ requestV3->fileName.length = result; -+ requestSize += result; - break; - } - case HGFS_OP_QUERY_VOLUME_INFO: { -+ int result; - HgfsRequestQueryVolume *request; - - request = (HgfsRequestQueryVolume *)(HGFS_REQ_PAYLOAD(req)); - -- /* We'll use these later. */ -- name = request->fileName.name; -- nameLength = &request->fileName.length; - requestSize = sizeof *request; -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ HGFS_LARGE_PACKET_MAX - (requestSize - 1), -+ request->fileName.name); -+ if (result < 0) { -+ LOG(4, ("CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ request->fileName.length = result; -+ requestSize += result; - break; - } - default: -@@ -160,17 +174,7 @@ - return -EPROTO; - } - -- /* Convert to CP name. */ -- result = CPName_ConvertTo(path, -- HGFS_LARGE_PACKET_MAX - (requestSize - 1), -- name); -- if (result < 0) { -- LOG(4, ("CP conversion failed.\n")); -- return -EINVAL; -- } -- -- *nameLength = (uint32) result; -- req->payloadSize = requestSize + result; -+ req->payloadSize = requestSize; - - /* Fill in header here as payloadSize needs to be there. */ - HgfsPackHeader(req, opUsed); ---- open-vm-tools-10.3.0-8931395-orig/vmhgfs-fuse/fsutil.c 2018-06-23 03:03:28.000000000 -0700 -+++ open-vm-tools-10.3.0-8931395/vmhgfs-fuse/fsutil.c 2019-02-11 18:51:48.527005190 -0800 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2013 VMware, Inc. All rights reserved. -+ * Copyright (C) 2013,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 -@@ -189,8 +189,6 @@ - size_t reqBufferSize; - size_t reqSize; - int result = 0; -- char *fileName = NULL; -- uint32 *fileNameLength = NULL; - ASSERT(attr); - ASSERT(req); - ASSERT(path); -@@ -204,8 +202,6 @@ - - /* Fill out the request packet. */ - requestV3->hints = 0; -- fileName = requestV3->fileName.name; -- fileNameLength = &requestV3->fileName.length; - requestV3->fileName.flags = 0; - requestV3->fileName.fid = HGFS_INVALID_HANDLE; - requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; -@@ -213,6 +209,19 @@ - requestV3->reserved = 0; - reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); - reqBufferSize = HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize); -+ if (requestV3->fileName.name != NULL) { -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ reqBufferSize, -+ requestV3->fileName.name); -+ LOG(8, ("Converted path %s\n", requestV3->fileName.name)); -+ if (result < 0) { -+ LOG(8, ("CP conversion failed.\n")); -+ result = -EINVAL; -+ goto out; -+ } -+ requestV3->fileName.length = result; -+ } - break; - } - -@@ -223,20 +232,42 @@ - - requestV2 = (HgfsRequestGetattrV2 *)(HGFS_REQ_PAYLOAD(req)); - requestV2->hints = 0; -- fileName = requestV2->fileName.name; -- fileNameLength = &requestV2->fileName.length; - reqSize = sizeof *requestV2; - reqBufferSize = HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, requestV2); -+ if (requestV2->fileName.name != NULL) { -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ reqBufferSize, -+ requestV2->fileName.name); -+ LOG(8, ("Converted path %s\n", requestV2->fileName.name)); -+ if (result < 0) { -+ LOG(8, ("CP conversion failed.\n")); -+ result = -EINVAL; -+ goto out; -+ } -+ requestV2->fileName.length = result; -+ } - break; - } - - case HGFS_OP_GETATTR: { - HgfsRequestGetattr *requestV1; - requestV1 = (HgfsRequestGetattr *)(HGFS_REQ_PAYLOAD(req)); -- fileName = requestV1->fileName.name; -- fileNameLength = &requestV1->fileName.length; - reqSize = sizeof *requestV1; - reqBufferSize = HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, requestV1); -+ if (requestV1->fileName.name != NULL) { -+ /* Convert to CP name. */ -+ result = CPName_ConvertTo(path, -+ reqBufferSize, -+ requestV1->fileName.name); -+ LOG(8, ("Converted path %s\n", requestV1->fileName.name)); -+ if (result < 0) { -+ LOG(8, ("CP conversion failed.\n")); -+ result = -EINVAL; -+ goto out; -+ } -+ requestV1->fileName.length = result; -+ } - break; - } - -@@ -246,20 +277,6 @@ - goto out; - } - -- if (fileName != NULL) { -- /* Convert to CP name. */ -- result = CPName_ConvertTo(path, -- reqBufferSize, -- fileName); -- LOG(8, ("Converted path %s\n", fileName)); -- if (result < 0) { -- LOG(8, ("CP conversion failed.\n")); -- result = -EINVAL; -- goto out; -- } -- *fileNameLength = result; -- } -- - req->payloadSize = reqSize + result; - - /* Fill in header here as payloadSize needs to be there. */ ---- open-vm-tools-10.3.0-8931395-orig/hgfsmounter/hgfsmounter.c 2018-06-23 03:03:28.000000000 -0700 -+++ open-vm-tools-10.3.0-8931395/hgfsmounter/hgfsmounter.c 2019-02-11 18:48:21.024330608 -0800 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2006-2017 VMware, Inc. All rights reserved. -+ * Copyright (C) 2006-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 -@@ -514,11 +514,13 @@ - HgfsMountInfo *mountInfo, // OUT: mount data - int *flags) // OUT: mount flags - { -+ unsigned short fmask = 0; - ASSERT(option); - ASSERT(mountInfo); - -- if (ParseMask(option, &mountInfo->fmask)) { -- LOG("Setting mount fmask to %o\n", mountInfo->fmask); -+ if (ParseMask(option, &fmask)) { -+ LOG("Setting mount fmask to %o\n", fmask); -+ mountInfo->fmask = fmask; - return TRUE; - } - -@@ -548,11 +550,13 @@ - HgfsMountInfo *mountInfo, // OUT: mount data - int *flags) // OUT: mount flags - { -+ unsigned short dmask = 0; - ASSERT(option); - ASSERT(mountInfo); - -- if (ParseMask(option, &mountInfo->dmask)) { -- LOG("Setting mount dmask to %o\n", mountInfo->dmask); -+ if (ParseMask(option, &dmask)) { -+ LOG("Setting mount dmask to %o\n", dmask); -+ mountInfo->dmask = dmask; - return TRUE; - } - ---- open-vm-tools-10.3.0-8931395-orig/lib/hgfsServer/hgfsServer.c 2018-06-23 03:04:02.000000000 -0700 -+++ open-vm-tools-10.3.0-8931395/lib/hgfsServer/hgfsServer.c 2019-02-11 18:49:37.218945512 -0800 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 1998-2018 VMware, Inc. All rights reserved. -+ * Copyright (C) 1998-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 -@@ -159,7 +159,7 @@ - HgfsServerChannelData channelCapabilities; - }; - --/* The input request paramaters object. */ -+/* The input request parameters object. */ - typedef struct HgfsInputParam { - const void *request; /* Hgfs header followed by operation request */ - size_t requestSize; /* Size of Hgfs header and operation request */ -@@ -2682,8 +2682,8 @@ - * None - * - * Side effects: -- * If there isnt enough memory to accomodate the new names, those file nodes -- * that couldnt be updated are deleted. -+ * If there isn't enough memory to accommodate the new names, those file nodes -+ * that couldn't be updated are deleted. - * - *----------------------------------------------------------------------------- - */ -@@ -3399,7 +3399,7 @@ - - /* Send error if we fail to process the op. */ - if (HGFS_ERROR_SUCCESS != status) { -- LOG(4, ("Error %d occured parsing the packet\n", (uint32)status)); -+ LOG(4, ("Error %d occurred parsing the packet\n", (uint32)status)); - HgfsServerCompleteRequest(status, 0, input); - } - } -@@ -4131,7 +4131,7 @@ - result = TRUE; - } - } -- LOG(4, ("%s: Setting capabilitiy flags %x for op code %d %s\n", -+ LOG(4, ("%s: Setting capability flags %x for op code %d %s\n", - __FUNCTION__, flags, op, result ? "succeeded" : "failed")); - - return result; -@@ -4143,7 +4143,7 @@ - * - * HgfsServerResEnumInit -- - * -- * Initialize an enumeration of all exisitng resources. -+ * Initialize an enumeration of all existing resources. - * - * Results: - * The enumeration state object. -@@ -4239,7 +4239,7 @@ - * - * HgfsServerEnumerateSharedFolders -- - * -- * Enumerates all exisitng shared folders and registers shared folders with -+ * Enumerates all existing shared folders and registers shared folders with - * directory notification package. - * - * Results: -@@ -6536,11 +6536,13 @@ - payload = &reply->payload[0]; - } - if (payload) { -+ uint32 actualSize = 0; - status = HgfsPlatformReadFile(readFd, input->session, offset, - requiredSize, payload, -- &reply->actualSize); -+ &actualSize); - if (HGFS_ERROR_SUCCESS == status) { - reply->reserved = 0; -+ reply->actualSize = actualSize; - replyPayloadSize = sizeof *reply; - - if (readUseDataBuffer) { -@@ -6556,11 +6558,13 @@ - break; - } - case HGFS_OP_READ: { -+ uint32 actualSize = 0; - HgfsReplyRead *reply = replyRead; - - status = HgfsPlatformReadFile(readFd, input->session, offset, requiredSize, -- reply->payload, &reply->actualSize); -+ reply->payload, &actualSize); - if (HGFS_ERROR_SUCCESS == status) { -+ reply->actualSize = actualSize; - replyPayloadSize = sizeof *reply + reply->actualSize; - } else { - LOG(4, ("%s: V1 Failed to read-> %d.\n", __FUNCTION__, status)); ---- open-vm-tools-10.3.0-8931395-orig/vmhgfs-fuse/link.c 2018-06-23 03:03:28.000000000 -0700 -+++ open-vm-tools-10.3.0-8931395/vmhgfs-fuse/link.c 2019-02-11 18:50:41.293462605 -0800 -@@ -1,5 +1,5 @@ - /********************************************************* -- * Copyright (C) 2013 VMware, Inc. All rights reserved. -+ * Copyright (C) 2013,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 -@@ -51,36 +51,81 @@ - { - HgfsRequestSymlinkCreateV3 *requestV3 = NULL; - HgfsRequestSymlinkCreate *request = NULL; -- char *symlinkName; -- uint32 *symlinkNameLength; -- char *targetName; -- uint32 *targetNameLength; - size_t targetNameBytes; -- - size_t requestSize; -- int result; -+ -+ targetNameBytes = strlen(symname) + 1; - - switch (opUsed) { - case HGFS_OP_CREATE_SYMLINK_V3: { -+ int result; -+ HgfsFileNameV3 *fileNameP; - requestV3 = HgfsGetRequestPayload(req); - -- /* We'll use these later. */ -- symlinkName = requestV3->symlinkName.name; -- symlinkNameLength = &requestV3->symlinkName.length; - requestV3->symlinkName.flags = 0; - requestV3->symlinkName.fid = HGFS_INVALID_HANDLE; - requestV3->symlinkName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; - requestV3->reserved = 0; - requestSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); -+ /* Convert symlink name to CP format. */ -+ result = CPName_ConvertTo(symlink, -+ HGFS_LARGE_PACKET_MAX - (requestSize - 1), -+ requestV3->symlinkName.name); -+ if (result < 0) { -+ LOG(4, ("SymlinkName CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ requestV3->symlinkName.length = result; -+ requestSize += result; -+ -+ /* Copy target name into request packet. */ -+ if (targetNameBytes > HGFS_LARGE_PACKET_MAX - (requestSize - 1)) { -+ LOG(4, ("Target name is too long.\n")); -+ return -EINVAL; -+ } -+ -+ fileNameP = (HgfsFileNameV3 *)((char *)&requestV3->symlinkName + -+ sizeof requestV3->symlinkName + result); -+ memcpy(fileNameP->name, symname, targetNameBytes); -+ LOG(6, ("Target name: \"%s\"\n", fileNameP->name)); -+ /* Convert target name to CPName-lite format. */ -+ CPNameLite_ConvertTo(fileNameP->name, targetNameBytes - 1, '/'); -+ fileNameP->length = targetNameBytes - 1; -+ fileNameP->flags = 0; -+ fileNameP->fid = HGFS_INVALID_HANDLE; -+ fileNameP->caseType = HGFS_FILE_NAME_CASE_SENSITIVE; - break; - } - case HGFS_OP_CREATE_SYMLINK: { -+ int result; -+ HgfsFileName *fileNameP; - request = (HgfsRequestSymlinkCreate *)(HGFS_REQ_PAYLOAD(req)); - -- /* We'll use these later. */ -- symlinkName = request->symlinkName.name; -- symlinkNameLength = &request->symlinkName.length; - requestSize = sizeof *request; -+ /* Convert symlink name to CP format. */ -+ result = CPName_ConvertTo(symlink, -+ HGFS_LARGE_PACKET_MAX - (requestSize - 1), -+ request->symlinkName.name); -+ if (result < 0) { -+ LOG(4, ("SymlinkName CP conversion failed.\n")); -+ return -EINVAL; -+ } -+ request->symlinkName.length = result; -+ requestSize += result; -+ -+ /* Copy target name into request packet. */ -+ if (targetNameBytes > HGFS_LARGE_PACKET_MAX - (requestSize - 1)) { -+ LOG(4, ("Target name is too long.\n")); -+ return -EINVAL; -+ } -+ -+ fileNameP = (HgfsFileName *)((char *)&request->symlinkName + -+ sizeof request->symlinkName + result); -+ memcpy(fileNameP->name, symname, targetNameBytes); -+ LOG(6, ("Target name: \"%s\"\n", fileNameP->name)); -+ /* Convert target name to CPName-lite format. */ -+ CPNameLite_ConvertTo(fileNameP->name, targetNameBytes - 1, '/'); -+ fileNameP->length = targetNameBytes - 1; - break; - } - default: -@@ -88,59 +133,13 @@ - return -EPROTO; - } - -- -- /* Convert symlink name to CP format. */ -- result = CPName_ConvertTo(symlink, -- HGFS_LARGE_PACKET_MAX - (requestSize - 1), -- symlinkName); -- if (result < 0) { -- LOG(4, ("SymlinkName CP conversion failed.\n")); -- return -EINVAL; -- } -- -- *symlinkNameLength = result; -- req->payloadSize = requestSize + result; -+ req->payloadSize = requestSize; - - /* -- * Note the different buffer length. This is because HgfsRequestSymlink -- * contains two filenames, and once we place the first into the packet we -- * must account for it when determining the amount of buffer available for -- * the second. -- * -- * Also note that targetNameBytes accounts for the NUL character. Once -- * we've converted it to CP name, it won't be NUL-terminated and the length -- * of the string in the packet itself won't account for it. -+ * targetNameBytes accounts for the NUL character. Once we've converted -+ * it to CP name, it won't be NUL-terminated and the length of the string -+ * in the packet itself won't account for it. - */ -- if (opUsed == HGFS_OP_CREATE_SYMLINK_V3) { -- HgfsFileNameV3 *fileNameP; -- fileNameP = (HgfsFileNameV3 *)((char *)&requestV3->symlinkName + -- sizeof requestV3->symlinkName + result); -- targetName = fileNameP->name; -- targetNameLength = &fileNameP->length; -- fileNameP->flags = 0; -- fileNameP->fid = HGFS_INVALID_HANDLE; -- fileNameP->caseType = HGFS_FILE_NAME_CASE_SENSITIVE; -- } else { -- HgfsFileName *fileNameP; -- fileNameP = (HgfsFileName *)((char *)&request->symlinkName + -- sizeof request->symlinkName + result); -- targetName = fileNameP->name; -- targetNameLength = &fileNameP->length; -- } -- targetNameBytes = strlen(symname) + 1; -- -- /* Copy target name into request packet. */ -- if (targetNameBytes > HGFS_LARGE_PACKET_MAX - (requestSize - 1)) { -- LOG(4, ("Target name is too long.\n")); -- return -EINVAL; -- } -- memcpy(targetName, symname, targetNameBytes); -- LOG(6, ("Target name: \"%s\"\n", targetName)); -- -- /* Convert target name to CPName-lite format. */ -- CPNameLite_ConvertTo(targetName, targetNameBytes - 1, '/'); -- -- *targetNameLength = targetNameBytes - 1; - req->payloadSize += targetNameBytes - 1; - - /* Fill in header here as payloadSize needs to be there. */ -diff -ru open-vm-tools-10.3.0-8931395-orig/lib/misc/util_misc.c open-vm-tools-10.3.0-8931395/lib/misc/util_misc.c ---- open-vm-tools-10.3.0-8931395-orig/lib/misc/util_misc.c 2019-02-02 15:01:18.930886338 -0800 -+++ open-vm-tools-10.3.0-8931395/lib/misc/util_misc.c 2019-02-02 15:01:33.506404000 -0800 -@@ -719,8 +719,8 @@ - ASSERT(!freeChunk[i]); - chunks[i] = expand; - if (chunks[i] == NULL) { -- Log("%s: Cannot allocate memory to expand \"%s\" in \"%s\".\n", -- __FUNCTION__, expand, fileName); -+ Log("%s: Cannot allocate memory to expand $ in \"%s\".\n", -+ __FUNCTION__, fileName); - goto out; - } - chunkSize[i] = strlen(expand); diff --git a/open-vm-tools.spec b/open-vm-tools.spec index c147f71..36f6246 100644 --- a/open-vm-tools.spec +++ b/open-vm-tools.spec @@ -19,16 +19,16 @@ ################################################################################ %global _hardened_build 1 -%global majorversion 10.3 -%global minorversion 10 -%global toolsbuild 12406962 +%global majorversion 11.0 +%global minorversion 0 +%global toolsbuild 14549434 %global toolsversion %{majorversion}.%{minorversion} %global toolsdaemon vmtoolsd %global vgauthdaemon vgauthd Name: open-vm-tools Version: %{toolsversion} -Release: 2%{?dist} +Release: 1%{?dist} Summary: Open Virtual Machine Tools for virtual machines hosted on VMware License: GPLv2 URL: https://github.com/vmware/%{name} @@ -44,7 +44,10 @@ ExclusiveArch: x86_64 ExclusiveArch: %{ix86} x86_64 %endif -Patch1: gcc9-warnings.patch +# Reference https://github.com/vmware/open-vm-tools/commit/89c0d444567eb525e8d083fb564c46d68e96660c +Patch1: gcc9-static-inline.patch +# Reference https://github.com/vmware/open-vm-tools/commit/9bc72f0b09702754b429115658a85223cb3058bd +Patch2: vix-memleak.patch BuildRequires: autoconf BuildRequires: automake @@ -146,7 +149,7 @@ useful for verifying the functioning of %{name} in VMware virtual machines. %prep -%autosetup -p1 -n %{name}-%{version}-%{toolsbuild} +%autosetup -p2 -n %{name}-%{version}-%{toolsbuild} %build # Required for regenerating configure script when @@ -246,9 +249,6 @@ if [ "$1" = "0" -a \ umount /mnt/hgfs &> /dev/null || /bin/true rmdir /mnt/hgfs &> /dev/null || /bin/true fi - - # Cleanup GuestProxy certs - %{_bindir}/vmware-guestproxycerttool -e &> /dev/null || /bin/true fi %postun @@ -265,6 +265,8 @@ fi %dir %{_sysconfdir}/vmware-tools/vgauth %dir %{_sysconfdir}/vmware-tools/vgauth/schemas %config(noreplace) %{_sysconfdir}/vmware-tools/*.conf +# Don't expect users to modify example tools.conf file +%config %{_sysconfdir}/vmware-tools/tools.conf.example # Don't expect users to modify VGAuth schema files %config %{_sysconfdir}/vmware-tools/vgauth/schemas/* %{_sysconfdir}/vmware-tools/*-vm-default @@ -275,7 +277,6 @@ fi %{_bindir}/vmhgfs-fuse %{_bindir}/vmtoolsd %{_bindir}/vmware-checkvm -%{_bindir}/vmware-guestproxycerttool %{_bindir}/vmware-hgfsclient %{_bindir}/vmware-namespace-cmd %{_bindir}/vmware-rpctool @@ -321,6 +322,13 @@ fi %{_bindir}/vmware-vgauth-smoketest %changelog +* Wed Oct 02 2019 Ravindra Kumar - 11.0.0-1 +- Package new upstream version open-vm-tools-11.0.0-14549434. +- Added gcc9-static-inline.patch for gcc9 warnings. +- Added vix-memleak.patch for a memory leak. +- Removed gcc9-warnings.patch which is no longer needed. +- Removed vmware-guestproxycerttool as it is no longer available upstream. + * Thu Jul 25 2019 Fedora Release Engineering - 10.3.10-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sources b/sources index e2183f9..0c6ffdd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (open-vm-tools-10.3.10-12406962.tar.gz) = fd35794896c2de5a3b6c7fad0e86558ae0f16c7ab09c791d0d9b8a61cff8052d3d5fcfd19613f793251050f86edda2335b29f49503b3fee41f48495b2ab80a0a +SHA512 (open-vm-tools-11.0.0-14549434.tar.gz) = 53782494ed0ff8db6884476f70fff174afa0bf59f09ccc0dd14d6718bf552b64b14859b55f1b4b6f583d05fc11395f8a42f131bde224752661dbb4103f1a62ad diff --git a/vix-memleak.patch b/vix-memleak.patch new file mode 100644 index 0000000..ea2c69c --- /dev/null +++ b/vix-memleak.patch @@ -0,0 +1,56 @@ +diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c +index 6352b9151..9ba550737 100644 +--- a/open-vm-tools/services/plugins/vix/vixTools.c ++++ b/open-vm-tools/services/plugins/vix/vixTools.c +@@ -9753,7 +9753,6 @@ VixToolsListAuthAliases(VixCommandRequestHeader *requestMsg, // IN + char *destPtr; + char *endDestPtr; + char *tmpBuf = NULL; +- char *recordBuf; + size_t recordSize; + char *escapedStr = NULL; + char *escapedStr2 = NULL; +@@ -9813,6 +9812,8 @@ VixToolsListAuthAliases(VixCommandRequestHeader *requestMsg, // IN + destPtr += Str_Sprintf(destPtr, endDestPtr - destPtr, "%s", + VIX_XML_ESCAPED_TAG); + for (i = 0; i < num; i++) { ++ char *recordBuf = NULL; ++ + escapedStr = VixToolsEscapeXMLString(uaList[i].pemCert); + if (escapedStr == NULL) { + err = VIX_E_OUT_OF_MEMORY; +@@ -9886,6 +9887,8 @@ VixToolsListAuthAliases(VixCommandRequestHeader *requestMsg, // IN + Log("%s: ListAuth list results too large, truncating", __FUNCTION__); + goto abort; + } ++ free(recordBuf); ++ recordBuf = NULL; + } + + *result = resultBuffer; +@@ -9951,7 +9954,6 @@ VixToolsListMappedAliases(VixCommandRequestHeader *requestMsg, // IN + char *destPtr; + char *endDestPtr; + char *tmpBuf = NULL; +- char *recordBuf; + char *escapedStr = NULL; + char *escapedStr2 = NULL; + size_t recordSize; +@@ -10005,6 +10007,8 @@ VixToolsListMappedAliases(VixCommandRequestHeader *requestMsg, // IN + destPtr += Str_Sprintf(destPtr, endDestPtr - destPtr, "%s", + VIX_XML_ESCAPED_TAG); + for (i = 0; i < num; i++) { ++ char *recordBuf = NULL; ++ + escapedStr = VixToolsEscapeXMLString(maList[i].pemCert); + if (escapedStr == NULL) { + err = VIX_E_OUT_OF_MEMORY; +@@ -10076,6 +10080,8 @@ VixToolsListMappedAliases(VixCommandRequestHeader *requestMsg, // IN + Log("%s: ListMapped results too large, truncating", __FUNCTION__); + goto abort; + } ++ free(recordBuf); ++ recordBuf = NULL; + } + + *result = resultBuffer;