]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Increase buffer size for OS name cache.
authorVMware, Inc <>
Tue, 26 Apr 2011 20:54:47 +0000 (13:54 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 26 Apr 2011 20:54:47 +0000 (13:54 -0700)
Increase the scope of a previous fix to also cover long OS names, so
that guest info and vix have enough buffer space to cover the max
size supported by the hostinfo library.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/guestInfo.h
open-vm-tools/services/plugins/guestInfo/guestInfoServer.c
open-vm-tools/services/plugins/vix/vixTools.c

index 90dc999cb87f93422ce66636598a23b347c3ba24..bf8c23d551856ae63cea4ff1a7a30c297f075b45 100644 (file)
 
 #define GUEST_INFO_COMMAND "SetGuestInfo"
 #define MAX_VALUE_LEN 100
+
+/**
+ * Upper bound for value sizes, based on gethostname(2):
+ *
+ *    SUS2 guarantees that "Host names are limited to 255 bytes".
+ *
+ * We can't modify MAX_VALUE_LEN since it's used in wire-level definitions
+ * (such as PartitionEntry).
+ */
+#define GUESTINFO_MAX_VALUE_SIZE 256
+
 #define MAX_NICS     16
 #define MAX_IPS      8     // Max number of IP addresses for a single NIC
 #define MAC_ADDR_SIZE 19
index 9037257543587ad1b2e5e7cabe45b1a8a4e179ed..f783b56677e89e98f7b8bf655e16dc08ce21fcea 100644 (file)
 VM_EMBED_VERSION(VMTOOLSD_VERSION_STRING);
 #endif
 
-
-/**
- * Upper bound for value sizes, based on gethostname(2):
- *
- *    SUS2 guarantees that "Host names are limited to 255 bytes".
- *
- * We can't modify MAX_VALUE_LEN since it's used in wire-level definitions
- * (such as PartitionEntry).
- */
-#define GUESTINFO_MAX_VALUE_SIZE    256
-
 MY_ASSERTS(GI_SIZE_ASSERTS,
            ASSERT_ON_COMPILE(GUESTINFO_MAX_VALUE_SIZE >= MAX_VALUE_LEN);
 )
index b3b9c76103544be7a5d26b546718bf49d883acb7..45d0a3b1fc5885e18441b31eba349cc95b580c97 100644 (file)
@@ -1989,8 +1989,8 @@ VixTools_GetToolsPropertiesImpl(GKeyFile *confDictRef,            // IN
    const char *powerOnScript = NULL;
    const char *resumeScript = NULL;
    const char *suspendScript = NULL;
-   char osNameFull[MAX_VALUE_LEN];
-   char osName[MAX_VALUE_LEN];
+   char osNameFull[GUESTINFO_MAX_VALUE_SIZE];
+   char osName[GUESTINFO_MAX_VALUE_SIZE];
    Bool foundHostName;
    char *tempDir = NULL;
    int wordSize = 32;