From: VMware, Inc <> Date: Mon, 21 May 2012 22:23:35 +0000 (-0700) Subject: Internal branch sync. Included in this change: X-Git-Tag: 2012.05.21-724730~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f7be45cb2adfb5cf710139cc13a5518ec2d93a6;p=thirdparty%2Fopen-vm-tools.git Internal branch sync. Included in this change: . another fix for File_PathJoin . remove the utf::string _variant_t/uvariant_t constructors . changes in shared code that don't affect open-vm-tools functionality Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/file/fileStandAlone.c b/open-vm-tools/lib/file/fileStandAlone.c index 6b01532d0..50b2c3e79 100644 --- a/open-vm-tools/lib/file/fileStandAlone.c +++ b/open-vm-tools/lib/file/fileStandAlone.c @@ -323,19 +323,23 @@ File_SplitName(ConstUnicode pathName, // IN: * Join the dirName and baseName together to create a (full) path. * * This code concatenates two strings together and omits a redundant - * directory separator between the two. It does not treat a fully qualified - * baseName the way one would expect: + * directory separator between the two. * + * On Windows, the 'baseName' argument may not be a fully qualified path. + * That is, it may not be an absolute path containing a drive letter nor + * may it be a UNC path. + * + * Examples: * File_PathJoin("", "b") -> "/b" * File_PathJoin("/", "b") -> "/b" * File_PathJoin("a", "b") -> "a/b" * File_PathJoin("a/", "b") -> "a/b" * File_PathJoin("a/////", "b") -> "a/b" * File_PathJoin("a", "") -> "a/" - * File_PathJoin("a", "/") -> "a/" (only posix) - * File_PathJoin("a", "/b") -> "a/b" (only posix) + * File_PathJoin("a", "/") -> "a/" + * File_PathJoin("a", "/b") -> "a/b" * File_PathJoin("a", "/////b") -> "a/b" (only posix) - * File_PathJoin("a/", "/b") -> "a/b" (only posix) + * File_PathJoin("a/", "/b") -> "a/b" * File_PathJoin("a/////", "/////b") -> "a/b" (only posix) * * Results: @@ -349,7 +353,7 @@ File_SplitName(ConstUnicode pathName, // IN: Unicode File_PathJoin(ConstUnicode dirName, // IN: - ConstUnicode baseName) // IN: + ConstUnicode baseName) // IN: See above. { Unicode result; Unicode newDir = NULL; @@ -357,17 +361,31 @@ File_PathJoin(ConstUnicode dirName, // IN: ASSERT(dirName); ASSERT(baseName); -#if defined(_WIN32) - ASSERT(!Unicode_StartsWith(baseName, DIRSEPS)); - ASSERT(!Unicode_StartsWith(baseName, "/")); - ASSERT(Unicode_LengthInCodePoints(baseName) < 2 || - Unicode_FindSubstrInRange(baseName, 1, 1, ":", 0, 1) == - UNICODE_INDEX_NOT_FOUND); -#else /* * Remove ALL directory separators from baseName begin. */ - while(Unicode_StartsWith(baseName, DIRSEPS)) { +#if defined(_WIN32) + { + ConstUnicode oldBaseName = baseName; + + /* + * Reject drive letters in baseName. + */ + ASSERT(Unicode_LengthInCodePoints(baseName) < 2 || + Unicode_FindSubstrInRange(baseName, 1, 1, ":", 0, 1) == + UNICODE_INDEX_NOT_FOUND); + + while (*baseName == '/' || *baseName == '\\') { + baseName++; + } + + /* + * Reject UNC paths for baseName. + */ + ASSERT(baseName - oldBaseName < 2); + } +#else + while (*baseName == '/') { baseName++; } #endif diff --git a/open-vm-tools/lib/include/vm_product.h b/open-vm-tools/lib/include/vm_product.h index b75525a75..03da1fd2c 100644 --- a/open-vm-tools/lib/include/vm_product.h +++ b/open-vm-tools/lib/include/vm_product.h @@ -185,8 +185,8 @@ * * VMRC is versioned x.y.z - ProgID is intentionally built using only x.y */ -#define PRODUCT_VMRC_PLUGIN_GUID_EMBEDDED 6FB1850B-AC2A-4AEA-9847-EBCE6AB2A62E -#define PRODUCT_VMRC_PLUGIN_GUID_TYPELIB EF9A6976-4861-49B5-AFED-05281B5887C5 +#define PRODUCT_VMRC_PLUGIN_GUID_EMBEDDED 4AEA1010-0A0C-405E-9B74-767FC8A998CB +#define PRODUCT_VMRC_PLUGIN_GUID_TYPELIB E82F3B76-A628-4486-B197-03780F86063A #define PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED_BASE "VMware.RemoteConsole" #define PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED_BASE "." \ XSTR(VMRC_PLUGIN_VERSION_BASE) @@ -203,19 +203,7 @@ #endif #define PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE \ - "application/x-vmware-remote-console" - -/* - * legacy plugin mimetypes (currently unused but here for reference) - */ -#define PRODUCT_VMRC_PLUGIN_LEGACY_MIMETYPES \ - "application/x-vmware-vmrc;version=2.5.0.199067" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ - "application/x-vmware-vmrc;version=2.5.0.158248" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ - "application/x-vmware-vmrc;version=2.5.0.116460" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ - "application/x-vmware-vmrc;version=2.5.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ - "application/x-vmware-mks;version=2.1.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ - "application/x-vmware-mks;version=2.0.1.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ - "application/x-vmware-mks;version=2.0.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR + "application/x-vmware-remote-console-2012" /* * All supported plugin mimetypes diff --git a/open-vm-tools/lib/include/vm_version.h b/open-vm-tools/lib/include/vm_version.h index c89c5fba4..57c956a04 100644 --- a/open-vm-tools/lib/include/vm_version.h +++ b/open-vm-tools/lib/include/vm_version.h @@ -266,7 +266,7 @@ // See the VMRC_PLUGIN_VERSION section in /mk/defs-onetime.mk #define VMRC_PLUGIN_VERSION_MAJOR 5 -#define VMRC_PLUGIN_VERSION_MINOR 0 +#define VMRC_PLUGIN_VERSION_MINOR 1 #define VMRC_PLUGIN_VERSION_Z 0 /* @@ -274,7 +274,7 @@ * #define VMRC_PLUGIN_VERSION_NUMBER \ * XSTR(VMRC_PLUGIN_VERSION_MAJOR) "." XSTR(VMRC_PLUGIN_VERSION_MINOR) "." XSTR(VMRC_PLUGIN_VERSION_Z) */ -#define VMRC_PLUGIN_VERSION_NUMBER "5.0.0" +#define VMRC_PLUGIN_VERSION_NUMBER "5.1.0" /* this version number should always match real VMRC & plugin version number */ #define VMRC_VERSION VMRC_PLUGIN_VERSION_NUMBER diff --git a/open-vm-tools/services/plugins/dndcp/stringxx/string.cc b/open-vm-tools/services/plugins/dndcp/stringxx/string.cc index a8540ca5d..ce7030dd9 100644 --- a/open-vm-tools/services/plugins/dndcp/stringxx/string.cc +++ b/open-vm-tools/services/plugins/dndcp/stringxx/string.cc @@ -96,50 +96,6 @@ string::string(ConstUnicode s) // IN #ifdef _WIN32 - -/* - *----------------------------------------------------------------------------- - * - * utf::string::init_bstr_t -- - * - * Utility function to construct from a _bstr_t object. - * Copies the UTF-16 representation of the _bstr_t. - * - * Results: - * None. - * - * Side effects: - * Makes a copy of the _bstr_t data and frees that data when - * the utf::string is destroyed. - * - * Note: - * WIN32 only call - * - *----------------------------------------------------------------------------- - */ - -void -string::init_bstr_t(const _bstr_t &s) // IN -{ - // If the input is empty, then there's nothing to do. - if (s.length() == 0) { - return; - } - - Unicode utf8 = Unicode_AllocWithUTF16(static_cast(s)); - - try { - mUstr = utf8; - Unicode_Free(utf8); - } catch (...) { - Unicode_Free(utf8); - throw; - } - - ASSERT(Validate(mUstr)); -} - - /* *----------------------------------------------------------------------------- * @@ -202,93 +158,23 @@ string::string(const _bstr_t &s) // IN mUtf16Cache(NULL), mUtf16Length(npos) { - init_bstr_t(s); -} - - -/* - *----------------------------------------------------------------------------- - * - * utf::string::string -- - * - * Constructor from a uvariant_t object. Copies the UTF-16 representation - * of the ubstr_t interface. - * - * Results: - * None. - * - * Side effects: - * Makes a copy of the uvariant_t data and frees that data when the - * utf::string is destroyed. - * - * Note: - * WIN32 only call - * - *----------------------------------------------------------------------------- - */ - -string::string(const uvariant_t &v) // IN - : mUstr(), - mUtf16Cache(NULL), - mUtf16Length(npos) -{ - ubstr_t s; - - try { - s = v; - } catch (...) { - Warning("Invalid uvariant_t to ubstr_t conversion.\n"); - throw; - } - // If the input is empty, then there's nothing to do. if (s.length() == 0) { return; } - mUstr = static_cast(s); - ASSERT(Validate(mUstr)); -} - - -/* - *----------------------------------------------------------------------------- - * - * utf::string::string -- - * - * Constructor from a _variant_t object. Copies the UTF-16 representation - * of the _variant_t. - * - * Results: - * None. - * - * Side effects: - * Makes a copy of the _variant_t data and frees that data when - * the utf::string is destroyed. - * - * Note: - * WIN32 only call - * - *----------------------------------------------------------------------------- - */ - -string::string(const _variant_t &v) // IN - : mUstr(), - mUtf16Cache(NULL), - mUtf16Length(npos) -{ - _bstr_t s; + Unicode utf8 = Unicode_AllocWithUTF16(static_cast(s)); try { - s = v; + mUstr = utf8; + Unicode_Free(utf8); } catch (...) { - Warning("Invalid _variant_t to _bstr_t conversion.\n"); + Unicode_Free(utf8); throw; } - init_bstr_t(s); + ASSERT(Validate(mUstr)); } - #endif diff --git a/open-vm-tools/services/plugins/dndcp/stringxx/string.hh b/open-vm-tools/services/plugins/dndcp/stringxx/string.hh index 81d799150..9136f838c 100644 --- a/open-vm-tools/services/plugins/dndcp/stringxx/string.hh +++ b/open-vm-tools/services/plugins/dndcp/stringxx/string.hh @@ -103,8 +103,6 @@ public: #ifdef _WIN32 string(const ubstr_t &s); explicit string(const _bstr_t &s); - string(const uvariant_t &v); - explicit string(const _variant_t &v); #endif string(const utf16string &s); @@ -220,11 +218,6 @@ private: // Cache accessors const utf16_t *GetUtf16Cache() const; -#ifdef _WIN32 - // Private utility constructor. - void init_bstr_t(const _bstr_t &s); -#endif - // utf::string is internally backed by Glib::ustring. Glib::ustring mUstr;