open-vm-tools/hgfsServer-aligned.patch
Ravindra Kumar ecd814a373 Updated *-aligned.patch files with more tweaks.
Filed a regression in readdir operation in dir-aligned.patch.
2019-02-12 18:38:53 -08:00

107 lines
4.3 KiB
Diff

--- 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));
@@ -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