]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Thu, 24 Feb 2011 21:34:31 +0000 (13:34 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 24 Feb 2011 21:34:31 +0000 (13:34 -0800)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/file/file.c
open-vm-tools/lib/include/file.h
open-vm-tools/lib/include/imageUtilTypes.h
open-vm-tools/lib/include/vm_product.h
open-vm-tools/lib/include/vm_tools_version.h
open-vm-tools/lib/include/vm_version.h
open-vm-tools/services/plugins/dndcp/dndGuest/guestDnDCPMgr.cc

index 8590132e3abf183a678a06f500a8711d05affe1c..1a83f8b8c6b74c19ce59082bd19700267f7118ce 100644 (file)
@@ -1658,6 +1658,178 @@ File_CopyFromNameToName(ConstUnicode srcName,  // IN:
    return success;
 }
 
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * FileCopyTree --
+ *
+ *      Recursively copies all files from a source path to a destination,
+ *      optionally overwriting any files. This does the actual work
+ *      for File_CopyTree.
+ *
+ * Results:
+ *      TRUE on success
+ *      FALSE on failure: Error messages are appended.
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+static Bool
+FileCopyTree(ConstUnicode srcName,    // IN:
+             ConstUnicode dstName,    // IN:
+             Bool overwriteExisting,  // IN:
+             Bool followSymlinks)     // IN:
+{
+   int err;
+   Bool success = TRUE;
+   int numFiles;
+   int i;
+   Unicode *fileList = NULL;
+
+   numFiles = File_ListDirectory(srcName, &fileList);
+
+   if (numFiles == -1) {
+      err = Err_Errno();
+      Msg_Append(MSGID(File.CopyTree.walk.failure)
+                 "Unable to access '%s' when copying files.\n\n",
+                 UTF8(srcName));
+      Err_SetErrno(err);
+
+      return FALSE;
+   }
+
+   File_EnsureDirectory(dstName);
+
+   for (i = 0; i < numFiles && success; i++) {
+      struct stat sb;
+      Unicode name;
+      Unicode srcFilename;
+
+      name = Unicode_Alloc(fileList[i], STRING_ENCODING_DEFAULT);
+      srcFilename = File_PathJoin(srcName, name);
+
+      if (followSymlinks) {
+         success = (Posix_Stat(srcFilename, &sb) == 0);
+      } else {
+         success = (Posix_Lstat(srcFilename, &sb) == 0);
+      }
+
+      if (success) {
+         Unicode dstFilename = File_PathJoin(dstName, name);
+
+         switch (sb.st_mode & S_IFMT) {
+         case S_IFDIR:
+            success = FileCopyTree(srcFilename, dstFilename, overwriteExisting,
+                                   followSymlinks);
+            break;
+
+#if !defined(_WIN32)
+         case S_IFLNK:
+            if (Posix_Symlink(Posix_ReadLink(srcFilename), dstFilename) != 0) {
+               err = Err_Errno();
+               Msg_Append(MSGID(File.CopyTree.symlink.failure)
+                          "Unable to symlink '%s' to '%s': %s\n\n",
+                          UTF8(Posix_ReadLink(srcFilename)),
+                          UTF8(dstFilename),
+                          Err_Errno2String(err));
+               Err_SetErrno(err);
+               success = FALSE;
+            }
+            break;
+#endif
+
+         default:
+            if (!File_Copy(srcFilename, dstFilename, overwriteExisting)) {
+               err = Err_Errno();
+               Msg_Append(MSGID(File.CopyTree.copy.failure)
+                          "Unable to copy '%s' to '%s': %s\n\n",
+                          UTF8(srcFilename), UTF8(dstFilename),
+                          Err_Errno2String(err));
+               Err_SetErrno(err);
+               success = FALSE;
+            }
+
+            break;
+         }
+
+         Unicode_Free(dstFilename);
+      } else {
+         err = Err_Errno();
+         Msg_Append(MSGID(File.CopyTree.stat.failure)
+                    "Unable to get information on '%s' when copying files.\n\n",
+                    UTF8(srcFilename));
+         Err_SetErrno(err);
+      }
+
+      Unicode_Free(srcFilename);
+      Unicode_Free(name);
+   }
+
+   for (i = 0; i < numFiles; i++) {
+      Unicode_Free(fileList[i]);
+   }
+
+   free(fileList);
+
+   return success;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * File_CopyTree --
+ *
+ *      Recursively copies all files from a source path to a destination,
+ *      optionally overwriting any files.
+ *
+ * Results:
+ *      TRUE on success
+ *      FALSE on failure: Error messages are appended.
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+Bool
+File_CopyTree(ConstUnicode srcName,    // IN:
+              ConstUnicode dstName,    // IN:
+              Bool overwriteExisting,  // IN:
+              Bool followSymlinks)     // IN:
+{
+   int err;
+
+   ASSERT(srcName);
+   ASSERT(dstName);
+
+   if (!File_IsDirectory(srcName)) {
+      err = Err_Errno();
+      Msg_Append(MSGID(File.CopyTree.source.notDirectory)
+                 "The source path '%s' is not a directory.\n\n",
+                 UTF8(srcName));
+      Err_SetErrno(err);
+      return FALSE;
+   }
+
+   if (!File_IsDirectory(dstName)) {
+      err = Err_Errno();
+      Msg_Append(MSGID(File.CopyTree.dest.notDirectory)
+                 "The destination path '%s' is not a directory.\n\n",
+                 UTF8(dstName));
+      Err_SetErrno(err);
+      return FALSE;
+   }
+
+   return FileCopyTree(srcName, dstName, overwriteExisting, followSymlinks);
+}
+
+
 /*
  *----------------------------------------------------------------------
  *
index 0b90e575612c333f4434ef17769d016a5df0f2b5..ea08dd8a2d2261937e35bf03d026bf990e6c40a9 100644 (file)
@@ -48,9 +48,9 @@ extern "C"{
 # endif
 # if defined(__FreeBSD__)
 #  include <sys/syslimits.h>  // PATH_MAX
-# else 
+# else
 #  include <limits.h>  // PATH_MAX
-# endif 
+# endif
 #define FILE_MAXPATH   PATH_MAX
 #endif
 
@@ -137,12 +137,12 @@ int File_UnlinkDelayed(ConstUnicode pathName);
 int File_UnlinkNoFollow(ConstUnicode pathName);
 
 void File_SplitName(ConstUnicode pathName,
-                    Unicode *volume, 
-                    Unicode *dir, 
+                    Unicode *volume,
+                    Unicode *dir,
                     Unicode *base);
 
-void File_GetPathName(ConstUnicode fullPath, 
-                      Unicode *pathName, 
+void File_GetPathName(ConstUnicode fullPath,
+                      Unicode *pathName,
                       Unicode *base);
 
 Unicode File_StripSlashes(ConstUnicode path);
@@ -247,34 +247,39 @@ char *File_MapPathPrefix(const char *oldPath,
                          const char **newPrefixes,
                          size_t numPrefixes);
 
-Bool File_CopyFromFdToFd(FileIODescriptor src, 
+Bool File_CopyFromFdToFd(FileIODescriptor src,
                          FileIODescriptor dst);
 
-FileIOResult File_CreatePrompt(FileIODescriptor *file, 
-                               ConstUnicode pathName, 
-                               int access, 
+FileIOResult File_CreatePrompt(FileIODescriptor *file,
+                               ConstUnicode pathName,
+                               int access,
                                int prompt);
 
-Bool File_CopyFromFd(FileIODescriptor src, 
-                     ConstUnicode dstName, 
+Bool File_CopyFromFd(FileIODescriptor src,
+                     ConstUnicode dstName,
                      Bool overwriteExisting);
 
-Bool File_Copy(ConstUnicode srcName, 
-               ConstUnicode dstName, 
+Bool File_Copy(ConstUnicode srcName,
+               ConstUnicode dstName,
                Bool overwriteExisting);
 
-Bool File_CopyFromFdToName(FileIODescriptor src, 
-                           ConstUnicode dstName, 
+Bool File_CopyFromFdToName(FileIODescriptor src,
+                           ConstUnicode dstName,
                            int dstDispose);
 
-Bool File_CopyFromNameToName(ConstUnicode srcName, 
-                             ConstUnicode dstName, 
+Bool File_CopyFromNameToName(ConstUnicode srcName,
+                             ConstUnicode dstName,
                              int dstDispose);
 
-Bool File_Replace(ConstUnicode oldFile, 
+Bool File_CopyTree(ConstUnicode srcName,
+                   ConstUnicode dstName,
+                   Bool overwriteExisting,
+                   Bool followSymlinks);
+
+Bool File_Replace(ConstUnicode oldFile,
                   ConstUnicode newFile);
 
-Bool File_Move(ConstUnicode oldFile, 
+Bool File_Move(ConstUnicode oldFile,
                ConstUnicode newFile,
                Bool *asRename);
 
@@ -292,8 +297,8 @@ int64 File_GetSizeAlternate(ConstUnicode pathName);
 /* file change notification module */
 typedef void (*CbFunction)(void *clientData);
 
-typedef void (*NotifyCallback)(ConstUnicode pathName, 
-                               int err, 
+typedef void (*NotifyCallback)(ConstUnicode pathName,
+                               int err,
                                void *data);
 
 typedef void (*PollTimeout) (CbFunction f,
@@ -303,26 +308,26 @@ typedef void (*PollTimeout) (CbFunction f,
 typedef void (*PollRemoveTimeout) (CbFunction f,
                                    void *clientData);
 
-void File_PollInit(PollTimeout pt, 
+void File_PollInit(PollTimeout pt,
                    PollRemoveTimeout prt);
 
 void File_PollExit(void);
 
 void File_PollImpersonateOnCheck(Bool check);
 
-Bool File_PollAddFile(ConstUnicode pathName, 
-                      uint32 pollPeriod, 
-                      NotifyCallback callback, 
-                      void *data, 
+Bool File_PollAddFile(ConstUnicode pathName,
+                      uint32 pollPeriod,
+                      NotifyCallback callback,
+                      void *data,
                       Bool fPeriodic);
 
 Bool File_PollAddDirFile(ConstUnicode pathName,
-                         uint32 pollPeriod, 
+                         uint32 pollPeriod,
                          NotifyCallback callback,
-                         void *data, 
+                         void *data,
                          Bool fPeriodic);
 
-Bool File_PollRemoveFile(ConstUnicode pathName, 
+Bool File_PollRemoveFile(ConstUnicode pathName,
                          uint32 pollPeriod,
                          NotifyCallback callback);
 
index 306ad517373f8163af098abbbdc0ff35f03d467a..77c87c8088cb0dcef229e3440b2f5476ce3e8201 100644 (file)
@@ -49,7 +49,8 @@ typedef struct {
     * 'depth' is the color depth (in bits per pixel) used for the image. 'bpp'
     * is the number of bits actually consumed per pixel in memory. (For
     * example, an image that uses 5 bits for each of R, G, B has depth=15 and
-    * bpp=16.  It's always true that depth <= bpp.  
+    * bpp=16.  If an image has an alpha channel, the alpha bits are counted in
+    * 'bpp' but not in 'depth'.) It's always true that depth <= bpp.
     * 
     * Also see the comment to Raster_ConvertPixels.
     */
index fbacf0cfc7c4ef6aca81558e035bdc73f87d3af6..7b484eb0d683bcf17f292dfc2651f47f3214dec6 100644 (file)
 /*
  * VMRC ActiveX CLSIDs and ProgIDs
  */
-#define PRODUCT_VMRC_PLUGIN_GUID_EMBEDDED      0567856D-8D8E-43ad-9241-7772F392B3A3
-#define PRODUCT_VMRC_PLUGIN_GUID_TYPELIB       AFAD9CB7-273F-4f59-8C78-D8AF13845222
+#define PRODUCT_VMRC_PLUGIN_GUID_EMBEDDED      291BA977-564B-4626-B868-A968FB8D4591
+#define PRODUCT_VMRC_PLUGIN_GUID_TYPELIB       70ABCAB7-6B45-4555-ABFC-8BC686E5ACFE
 #define PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED_BASE "VMware.VMwareRemoteConsole"
 #define PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED    PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED_BASE "." \
                                                XSTR(VMRC_PLUGIN_VERSION_BASE)
 #endif
 
 #define PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE \
-   "application/x-vmware-vmrc;version=" VMRC_PLUGIN_VERSION
-
-/*
- * previously shipped plugin mimetypes (updated as we ship them)
- *
- * XXX It is important that the mimetypes be listed in strictly decreasing
- *     order by version. Server 2.0 Web Access (WBC) only checks the first VMRC
- *     mimetype for compatibility, and others might make the same mistake in
- *     the future.
- */
-#define PRODUCT_VMRC_PLUGIN_PREVIOUS_MIMETYPES \
-   "application/x-vmware-vmrc;version=4.0.0.0"
+   "application/x-vmware-vmrc-2011"
 
 /*
  * legacy plugin mimetypes (currently unused but here for reference)
  * NB: See above for constraints on the ordering of this list.
  */
 #define PRODUCT_VMRC_PLUGIN_MIMETYPES \
-   PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE PRODUCT_VMRC_MIMETYPE_SEPARATOR \
-   PRODUCT_VMRC_PLUGIN_PREVIOUS_MIMETYPES PRODUCT_VMRC_MIMETYPE_TERMINATOR
+   PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE PRODUCT_VMRC_MIMETYPE_TERMINATOR
 
 /*
  * VMware USB Arbitration Service version definitions
index 5b6288c95567ca465596345e9cc37623c3e768e1..620db56be922d42c6bb98883a1dafd0c1d96e136 100644 (file)
 #ifndef RC_INVOKED
 
 typedef uint32 ToolsVersion;
-
+typedef struct {
+   uint8 major;
+   uint8 minor;
+   uint8 base;
+} ToolsVersionComponents;
+
+static INLINE void
+TOOLS_VERSION_UINT_TO_COMPONENTS(const ToolsVersion toolsVersion,   // IN
+                                 ToolsVersionComponents *comps)     // IN/OUT
+{
+   comps->major = (toolsVersion >> 10) & 0x1f;      /* Keep lowest 5 bits after shift. */
+   comps->minor = (toolsVersion >> 5) & 0x1f;
+   comps->base  = toolsVersion & 0x1f;
+}
 #endif
 
 /*
@@ -103,16 +116,16 @@ typedef uint32 ToolsVersion;
 
 #define TOOLS_VERSION_UINT(MJR, MNR, BASE)    (((MJR) << 10) + ((MNR) << 5) + (BASE))
 
+
 /*
  * Allocate 5 bits to each sub-version in the dotted tools version. This
  * should take care of us for any reasonable usage: 32 x 32 x 32.
- * This macro takes the base variant appended with _V suffix and 
+ * This macro takes the base variant appended with _V suffix and
  * constructs the version number defines for the version.
  * It then passes the version numbers into the UINT construct macro above.
  */
 #define TOOLS_VERSION_TO_UINT(BASE_VARIANT_VER)   \
-   TOOLS_VERSION_UINT(BASE_VARIANT_VER##_MJR,BASE_VARIANT_VER##_MNR,BASE_VARIANT_VER##_BASE) 
-
+   TOOLS_VERSION_UINT(BASE_VARIANT_VER##_MJR,BASE_VARIANT_VER##_MNR,BASE_VARIANT_VER##_BASE)
 
 
 /*
@@ -132,11 +145,11 @@ typedef uint32 ToolsVersion;
 #define   TOOLS_VERSION_WS30         4
 #define   TOOLS_VERSION_WS31_BETA    5
 
-/* 
+/*
  * Versions:-
  * For non-RC compiled variant:
  * Define each version component pass to macro with BASENAME+SUFFIX (_V).
- * Where BASENAME describes the version and append 
+ * Where BASENAME describes the version and append
  * the appropriate suffix:_V
  * For RC and non-RC define BASENAME_V and append _MJR or _MNR or _BASE.
  * Set each version number accordingly.
index fbadf8a00e0faf0646343a2519c959dee427f158..d33028663795d7c9a9bda6ac487f1a682fdac3d5 100644 (file)
 
 #define USB_ARBITRATOR_VERSION_MAJOR 8
 #define USB_ARBITRATOR_VERSION_MINOR 2
-#define USB_ARBITRATOR_VERSION_Z     6
+#define USB_ARBITRATOR_VERSION_Z     23
+
 #define USB_ARBITRATOR_VERSION_BASE  USB_ARBITRATOR_VERSION_MAJOR.\
                                      USB_ARBITRATOR_VERSION_MINOR
 
  * USB Arbitrator Component version. This version is used by the linux
  * installer. See USB_ARBITRATOR_COMPONENT_VERSION_NUMBER in mk/defs-onetime.mk
  */
-#define USB_ARBITRATOR_COMPONENT_VERSION_NUMBER "8.2.6"
+#define USB_ARBITRATOR_COMPONENT_VERSION_NUMBER "8.2.23"
 
 #ifdef VMX86_VPX
 #define VIM_API_TYPE "VirtualCenter"
 #    define PRODUCT_LICENSE_VERSION "1.0"
 #  elif defined(VMX86_DESKTOP)
 #    if defined(__APPLE__)
-#      define PRODUCT_LICENSE_VERSION "3.0"
+#      define PRODUCT_LICENSE_VERSION "4.0+"
 #    else
 #      define PRODUCT_LICENSE_VERSION "8.0+"
 #    endif
index 65cd1a062a12d309f9b109b8e3ed77485a55b0cf..e86aa76a1464b37d6cc59e030c62b767e5260312 100644 (file)
@@ -179,10 +179,10 @@ GuestDnDCPMgr::GetTransport(void)
                                             "addr",
                                             NULL);
       }
-
       if (!brokerAddr) {
+
          /* We are executing in the simulator, so hardcode the brokerAddr. */
-         brokerAddr = "tcp:host=127.0.0.1,port=5672,family=ipv4";
+         brokerAddr = "tcp:host=127.0.0.1,port=8672,family=ipv4";
       }
       mTransport = new DnDCPTransportVMCF(brokerAddr, NULL, false);
 #else