]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common files.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:47 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:47 +0000 (11:22 -0700)
- lib/file/fileIO.c: Make Fil3_SwapFilesi() path more robust wrt resource
  contentions.
- Common header file change; not relevant to open-vm-tools.

open-vm-tools/lib/file/fileIO.c
open-vm-tools/lib/include/vm_product_versions.h

index 92ba8399368551e53c1e68d1ccd8d533b810960d..9ed11a077cf23d1cbaacb55817dcb3e90f90c9eb 100644 (file)
@@ -840,7 +840,7 @@ FileIO_AtomicUpdate(FileIODescriptor *newFD,   // IN/OUT: file IO descriptor
 
    if (HostType_OSIsVMK()) {
 #if defined(VMX86_SERVER)
-      FS_SwapFilesArgs *args = NULL;
+      FS_SwapFilesArgsUW *args = NULL;
       char *dirName = NULL;
       char *fileName = NULL;
       char *dstDirName = NULL;
@@ -872,39 +872,8 @@ FileIO_AtomicUpdate(FileIODescriptor *newFD,   // IN/OUT: file IO descriptor
       ASSERT(File_IsSameFile(dirName, dstDirName));
 
       args = Util_SafeCalloc(1, sizeof *args);
-      if (Str_Snprintf(args->srcFile, sizeof args->srcFile, "%s",
-                       fileName) < 0) {
-         Log("%s: Path too long \"%s\".\n", __FUNCTION__, fileName);
-         savedErrno = ENAMETOOLONG;
-         goto swapdone;
-      }
-      if (Str_Snprintf(args->dstFilePath, sizeof args->dstFilePath, "%s/%s",
-                       dstDirName, dstFileName) < 0) {
-         Log("%s: Path too long \"%s\".\n", __FUNCTION__, dstFileName);
-         savedErrno = ENAMETOOLONG;
-         goto swapdone;
-      }
-
-      /*
-       * Issue the ioctl on the directory rather than on the file,
-       * because the file could be open.
-       */
-
-      if (!*dirName) {
-         /* need a proper root directory string for Posix_Open() */
-         free(dirName);
-         dirName = Util_SafeStrdup("/");
-      }
-
-      fd = Posix_Open(dirName, O_RDONLY);
-      if (fd < 0) {
-         Log("%s: Open failed \"%s\" %d.\n", __FUNCTION__, dirName, errno);
-         ASSERT(errno != EBUSY);   /* #615124. */
-         savedErrno = errno;
-         goto swapdone;
-      }
-
-      if (ioctl(fd, IOCTLCMD_VMFS_SWAP_FILES, args) != 0) {
+      args->fd = currFD->posix;
+      if (ioctl(newFD->posix, IOCTLCMD_VMFS_SWAP_FILES, args) != 0) {
          savedErrno = errno;
          if (errno != ENOSYS && errno != ENOTTY) {
             Log("%s: ioctl failed %d.\n", __FUNCTION__, errno);
@@ -914,8 +883,6 @@ FileIO_AtomicUpdate(FileIODescriptor *newFD,   // IN/OUT: file IO descriptor
          ret = TRUE;
       }
 
-      close(fd);
-
       /*
        * Did we fail because we are on a file system that does not
        * support the IOCTLCMD_VMFS_SWAP_FILES ioctl? If so fallback to
index 2ce25bef2939b2ac46ea8b8330a13ea0483d9818..c62d53d00fbb44642cb5b4758410376c2f0e3f1c 100644 (file)
 #define PRODUCT_ESX_LICENSE_VERSION "6.0"
 #define PRODUCT_ESX_LICENSE_FILE_VERSION "6.1.0.5"
 #define PRODUCT_VSAN_LICENSE_VERSION "5.0"
-#define PRODUCT_VSAN_LICENSE_FILE_VERSION "5.9.2.1"
+#define PRODUCT_VSAN_LICENSE_FILE_VERSION "6.3.0.0"
 
 /*
  * This is for ACE Management Server