From: Oliver Kurth Date: Fri, 15 Sep 2017 18:22:47 +0000 (-0700) Subject: Changes to common files. X-Git-Tag: stable-10.2.0~681 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=421ed81330addabc27288df3e029c42fb679d1dd;p=thirdparty%2Fopen-vm-tools.git Changes to common files. - lib/file/fileIO.c: Make Fil3_SwapFilesi() path more robust wrt resource contentions. - Common header file change; not relevant to open-vm-tools. --- diff --git a/open-vm-tools/lib/file/fileIO.c b/open-vm-tools/lib/file/fileIO.c index 92ba83993..9ed11a077 100644 --- a/open-vm-tools/lib/file/fileIO.c +++ b/open-vm-tools/lib/file/fileIO.c @@ -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 diff --git a/open-vm-tools/lib/include/vm_product_versions.h b/open-vm-tools/lib/include/vm_product_versions.h index 2ce25bef2..c62d53d00 100644 --- a/open-vm-tools/lib/include/vm_product_versions.h +++ b/open-vm-tools/lib/include/vm_product_versions.h @@ -399,7 +399,7 @@ #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