]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Internal branch sync. Included in this change:
authorVMware, Inc <>
Wed, 24 Feb 2010 22:14:18 +0000 (14:14 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Wed, 24 Feb 2010 22:14:18 +0000 (14:14 -0800)
. Fix crash in vmware-user: always provide valid data in clipboard data.

. Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/file/filePosix.c
open-vm-tools/lib/include/util.h
open-vm-tools/lib/include/vm_device_version.h
open-vm-tools/vmware-user/copyPasteUI.cpp
open-vm-tools/vmware-user/dndUI.cpp

index 019565213647a999eebeab115643d66a7cc2d9c3..84e6b7278bdcb2193145981f6422ced3a40458a5 100644 (file)
@@ -2099,8 +2099,9 @@ FilePosixCreateTestFileSize(ConstUnicode dirName, // IN: directory to create lar
  *
  *      Check if the given file is on a VMFS supports such a file size
  *
- *      In the case of VMFS3/4, the largest supported file size is
+ *      In the case of VMFS3, the largest supported file size is
  *         256 * 1024 * B bytes
+ *      VMFS5 supports larger file sizes.
  *
  *      where B represents the blocksize in bytes
  *
@@ -2140,11 +2141,12 @@ File_VMFSSupportsFileSize(ConstUnicode pathName,  // IN:
    }
 
    if (strcmp(fsType, "VMFS") == 0) {
-      if (version >= 3) {
-         /* Get ready for VMFS4 and perform sanity check on version */
-         ASSERT(version == 3 || version == 4);
-
+      if (version == 3) {
          maxFileSize = (VMFS3CONST * (uint64) blockSize * 1024);
+      } else {
+         /* Get ready for 64 TB on VMFS5 and perform sanity check on version */
+         ASSERT(version == 5);
+         maxFileSize = (uint64) 0x400000000000ULL;
       }
 
       if (fileSize <= maxFileSize && maxFileSize != -1) {
index 34a6dcf2bbbff89f67cd801188e7c6d12611f797..6832f757e0b546aed6086841d4719790e94c349d 100644 (file)
@@ -72,12 +72,12 @@ typedef pid_t Util_ThreadID;
 
 #ifdef __APPLE__
 EXTERN char *Util_CFStringToUTF8CString(CFStringRef s);
-EXTERN char *Util_IORegGetStringProperty(io_object_t entry, CFStringRef property);
+EXTERN char *Util_IORegCopyStringProperty(io_object_t entry, CFStringRef property);
 EXTERN Bool Util_IORegGetNumberProperty(io_object_t entry, CFStringRef property,
                                         CFNumberType type, void *val);
 EXTERN Bool Util_IORegGetBooleanProperty(io_object_t entry, CFStringRef property,
                                          Bool *boolVal);
-EXTERN CFDataRef Util_IORegGetDataProperty(io_object_t entry, CFStringRef property);
+EXTERN CFDataRef Util_IORegCopyDataProperty(io_object_t entry, CFStringRef property);
 EXTERN CFMutableDictionaryRef UtilMacos_CreateCFDictionary(
    unsigned int numPairs, ...);
 EXTERN io_service_t Util_IORegGetDeviceObjectByName(const char *deviceName);
index e1d4a0704356db672a74b41dc975fe49e2f63778..f364ca0ec55d0f56edb5f8de182e9b7b408262d9 100644 (file)
@@ -67,6 +67,7 @@
 #define PCI_DEVICE_ID_VMWARE_VMXNET3    0x07B0
 #define PCI_DEVICE_ID_VMWARE_VMXWIFI    0x07B8
 #define PCI_DEVICE_ID_VMWARE_PVSCSI     0x07C0
+#define PCI_DEVICE_ID_VMWARE_82574      0x07D0
 
 /* The hypervisor device might grow.  Please leave room
  * for 7 more subfunctions.
 #define PCI_DEVICE_ID_INTEL_82443BX_2   0x7192 /* Used when no AGP support */
 #define PCI_DEVICE_ID_INTEL_82545EM     0x100f
 #define PCI_DEVICE_ID_INTEL_82546EB     0x1010
+#define PCI_DEVICE_ID_INTEL_82574       0x10d3
 #define PCI_DEVICE_ID_INTEL_ICH7_16     0x27d8
 #define PCI_DEVICE_ID_INTEL_HECI        0x2a74
 
index 6a4e3c038f43de8c6bb1763e1e67d18e3c63840b..8ffb5909fe4d1fb0457d2bdeca8beaa07e26b318 100644 (file)
@@ -279,6 +279,8 @@ CopyPasteUI::LocalGetFileRequestCB(Gtk::SelectionData& sd,        // IN:
    VmTimeType curTime;
    mBlockAdded = false;
 
+   sd.set(sd.get_target().c_str(), "");
+
    curTime = GetCurrentTime();
 
    /*
@@ -442,6 +444,8 @@ void
 CopyPasteUI::LocalGetTextOrRTFRequestCB(Gtk::SelectionData& sd, // IN/OUT
                                         guint info)             // Ignored
 {
+   sd.set(sd.get_target().c_str(), "");
+
    if (!mCP.IsCopyPasteAllowed()) {
       return;
    }
@@ -669,7 +673,7 @@ again:
    if (refClipboard->wait_is_text_available()) {
       Debug("%s: ask for text\n", __FUNCTION__);
       Glib::ustring str = refClipboard->wait_for_text();
-      bufSize = str.size();
+      bufSize = str.bytes();
       if (bufSize > 0  &&
           bufSize <= (int)CPCLIPITEM_MAX_SIZE_V3 &&
           CPClipboard_SetItem(&mClipboard, CPFORMAT_TEXT,
@@ -760,6 +764,8 @@ CopyPasteUI::LocalGetFileContentsRequestCB(Gtk::SelectionData& sd, // IN
    utf::string pre;
    utf::string post;
 
+   sd.set(sd.get_target().c_str(), "");
+
    /* Provide URIs for each path in the guest's file list. */
    if (FCP_TARGET_INFO_GNOME_COPIED_FILES == info) {
       uriList = "copy\n";
@@ -1050,7 +1056,7 @@ CopyPasteUI::GetRemoteClipboardCB(const CPClipboard *clip) // IN
          targets.push_back(plainText);
          targets.push_back(utf8Text);
          targets.push_back(compountText);
-         mHGTextData = utf::string((const char *)buf);
+         mHGTextData = utf::string((const char *)buf, STRING_ENCODING_UTF8);
 
          mIsClipboardOwner = TRUE;
       }
@@ -1062,7 +1068,7 @@ CopyPasteUI::GetRemoteClipboardCB(const CPClipboard *clip) // IN
 
          targets.push_back(appRtf);
          targets.push_back(textRtf);
-         mHGRTFData = utf::string((const char *)buf);
+         mHGRTFData = utf::string((const char *)buf, STRING_ENCODING_UTF8);
 
          mIsClipboardOwner = TRUE;
       }
index 6079d43a512f05c165b53f5e6b8c75d1941407ba..7598c75b120bc78ae1cf12c2952f1ef8ee01abc5 100644 (file)
@@ -820,7 +820,9 @@ DnDUI::GtkSourceDragDataGetCB(const Glib::RefPtr<Gdk::DragContext> &dc,
 
    const utf::string target = selection_data.get_target().c_str();
 
-   Debug("%s: enter\n", __FUNCTION__);
+   selection_data.set(target.c_str(), "");
+
+   Debug("%s: enter with target %s\n", __FUNCTION__, target.c_str());
 
    if (!m_inHGDrag) {
       Debug("%s: not in drag, return\n", __FUNCTION__);