diff -u open-vm-tools-2008.08.08-109361/debian/changelog open-vm-tools-2008.08.08-109361/debian/changelog
--- open-vm-tools-2008.08.08-109361/debian/changelog
+++ open-vm-tools-2008.08.08-109361/debian/changelog
@@ -1,3 +1,10 @@
+open-vm-tools (2008.08.08-109361-1ubuntu2.2~andersk6) unstable; urgency=low
+
+  * Introduce code to enable the vmblock mount and module load facility.
+    (LP: 332323)
+
+ -- William D Cattey <wdc@mit.edu>  Tue, 24 Feb 2009 17:16:59 -0500
+
 open-vm-tools (2008.08.08-109361-1ubuntu2.2~andersk5) intrepid-proposed; urgency=low
 
   * Backport fixes from the Debian package (LP: #289921):
only in patch2:
unchanged:
--- open-vm-tools-2008.08.08-109361.orig/vmware-user-suid-wrapper/wrapper-linux.c
+++ open-vm-tools-2008.08.08-109361/vmware-user-suid-wrapper/wrapper-linux.c
@@ -44,6 +44,145 @@
  * Global functions
  */
 
+#ifdef TOGGLE_VMBLOCK
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * GetModuleID --
+ *
+ *      Kludge interface to ID based kernel module load/unload
+ *
+ * Results:
+ *      Always returns 0 implying success.
+ *      This forces the caller will call LoadModule or UnloadModule
+ *      unconditionally, without modifying main.c
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+int
+GetModuleId(const char *name)   // IN: module name to search for
+{
+  return 0;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * UnloadModule --
+ *
+ *      Lookup and, if loaded, unload the VMBlock kernel module.
+ *
+ * Results:
+ *      TRUE on success, FALSE otherwise
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+#define VMBLOCK_MODUNLOAD "modprobe -r " MODULE_NAME
+
+Bool
+UnloadModule(int id)    // IN: module id for modctl(2)
+{
+  if (system(VMBLOCK_MODUNLOAD) < 0) {
+      Error("Error unloading VMBlock module: %s", strerror(errno));
+      return FALSE;
+   }
+
+   return TRUE;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * LoadVMBlock --
+ *
+ *      Load the VMBlock kernel module.
+ *
+ * Results:
+ *      TRUE on success, FALSE otherwise
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+#define VMBLOCK_MODLOAD "modprobe " MODULE_NAME
+
+Bool
+LoadVMBlock(void)
+{
+  if (system (VMBLOCK_MODLOAD) < 0) {
+      Error("failed to load vmblock\n");
+      return FALSE;
+   }
+
+   return TRUE;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * UnmountVMBlock --
+ *
+ *      Unmount the VMBlock file system.
+ *
+ * Results:
+ *      TRUE on success, FALSE otherwise.
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+Bool
+UnmountVMBlock(const char *mountPoint)  // IN: VMBlock mount point
+{
+   if (umount(mountPoint) == -1) {
+      return FALSE;
+   }
+   return TRUE;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * MountVMBlock --
+ *
+ *      Mount the VMBlock file system.
+ *
+ * Results:
+ *      TRUE on success, FALSE otherwise
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+Bool
+MountVMBlock(void)
+{
+  if (mount("none", VMBLOCK_MOUNT_POINT, VMBLOCK_FS_NAME, 0, 0) < 0) {
+      Error("failed to mount vmblock file system: %s\n", strerror(errno));
+      return FALSE;
+   }
+
+   return TRUE;
+}
+#endif // ifdef TOGGLE_VMBLOCK
+
 
 #ifdef USES_LOCATIONS_DB
 /*
only in patch2:
unchanged:
--- open-vm-tools-2008.08.08-109361.orig/vmware-user-suid-wrapper/main.c
+++ open-vm-tools-2008.08.08-109361/vmware-user-suid-wrapper/main.c
@@ -236,10 +236,12 @@
       return FALSE;
    }
 
+#if !defined (linux) // vmblock does this for us under linux 
    if (!MakeDirectory(VMBLOCK_MOUNT_POINT, MOUNT_POINT_MODE, euid, egid)) {
       Error("failed to create %s\n", VMBLOCK_MOUNT_POINT);
       return FALSE;
    }
+#endif
 
    if (!LoadVMBlock()) {
       return FALSE;
only in patch2:
unchanged:
--- open-vm-tools-2008.08.08-109361.orig/vmware-user-suid-wrapper/wrapper.h
+++ open-vm-tools-2008.08.08-109361/vmware-user-suid-wrapper/wrapper.h
@@ -72,7 +72,7 @@
  * Global functions
  */
 
-#if defined(sun) || defined(__FreeBSD__)
+#if defined(sun) || defined(__FreeBSD__) || defined(linux)
 #define TOGGLE_VMBLOCK
 extern int GetModuleId(const char *);
 extern Bool UnloadModule(int);
only in patch2:
unchanged:
--- open-vm-tools-2008.08.08-109361.orig/include/guestrpc/ghiGetBinaryHandlers.h
+++ open-vm-tools-2008.08.08-109361/include/guestrpc/ghiGetBinaryHandlers.h
@@ -0,0 +1,100 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _GHIGETBINARYHANDLERS_H_RPCGEN
+#define _GHIGETBINARYHANDLERS_H_RPCGEN
+
+#include <vmxrpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+enum GHIBinaryHandlersVersion {
+	GHI_BINARY_HANDLERS_V1 = 1,
+};
+typedef enum GHIBinaryHandlersVersion GHIBinaryHandlersVersion;
+#define GHI_HANDLERS_SUFFIX_MAX_LEN 32
+#define GHI_HANDLERS_MIMETYPE_MAX_LEN 256
+#define GHI_HANDLERS_UTI_MAX_LEN 256
+#define GHI_HANDLERS_FRIENDLY_NAME_MAX_LEN 256
+#define GHI_HANDLERS_MAX_NUM_ICONS 8
+#define GHI_HANDLERS_VERB_MAX_LEN 64
+#define GHI_MAX_NUM_ACTION_URI_PAIRS 16
+#define GHI_HANDLERS_ACTIONURI_MAX_PATH 1040
+#define GHI_MAX_NUM_BINARY_HANDLERS 32
+
+struct GHIBinaryHandlersIconDetails {
+	int width;
+	int height;
+	char *identifier;
+};
+typedef struct GHIBinaryHandlersIconDetails GHIBinaryHandlersIconDetails;
+
+struct GHIBinaryHandlersActionURIPair {
+	char *verb;
+	char *actionURI;
+};
+typedef struct GHIBinaryHandlersActionURIPair GHIBinaryHandlersActionURIPair;
+
+struct GHIBinaryHandlersDetails {
+	char *suffix;
+	char *mimetype;
+	char *UTI;
+	struct {
+		u_int actionURIs_len;
+		struct GHIBinaryHandlersActionURIPair *actionURIs_val;
+	} actionURIs;
+	char *friendlyName;
+	struct {
+		u_int icons_len;
+		struct GHIBinaryHandlersIconDetails *icons_val;
+	} icons;
+};
+typedef struct GHIBinaryHandlersDetails GHIBinaryHandlersDetails;
+
+struct GHIBinaryHandlersList {
+	struct {
+		u_int handlers_len;
+		struct GHIBinaryHandlersDetails *handlers_val;
+	} handlers;
+};
+typedef struct GHIBinaryHandlersList GHIBinaryHandlersList;
+
+struct GHIBinaryHandlers {
+	GHIBinaryHandlersVersion ver;
+	union {
+		struct GHIBinaryHandlersList *handlersV1;
+	} GHIBinaryHandlers_u;
+};
+typedef struct GHIBinaryHandlers GHIBinaryHandlers;
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern  bool_t xdr_GHIBinaryHandlersVersion (XDR *, GHIBinaryHandlersVersion*);
+extern  bool_t xdr_GHIBinaryHandlersIconDetails (XDR *, GHIBinaryHandlersIconDetails*);
+extern  bool_t xdr_GHIBinaryHandlersActionURIPair (XDR *, GHIBinaryHandlersActionURIPair*);
+extern  bool_t xdr_GHIBinaryHandlersDetails (XDR *, GHIBinaryHandlersDetails*);
+extern  bool_t xdr_GHIBinaryHandlersList (XDR *, GHIBinaryHandlersList*);
+extern  bool_t xdr_GHIBinaryHandlers (XDR *, GHIBinaryHandlers*);
+
+#else /* K&R C */
+extern bool_t xdr_GHIBinaryHandlersVersion ();
+extern bool_t xdr_GHIBinaryHandlersIconDetails ();
+extern bool_t xdr_GHIBinaryHandlersActionURIPair ();
+extern bool_t xdr_GHIBinaryHandlersDetails ();
+extern bool_t xdr_GHIBinaryHandlersList ();
+extern bool_t xdr_GHIBinaryHandlers ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_GHIGETBINARYHANDLERS_H_RPCGEN */
only in patch2:
unchanged:
--- open-vm-tools-2008.08.08-109361.orig/include/guestrpc/ghiProtocolHandler.h
+++ open-vm-tools-2008.08.08-109361/include/guestrpc/ghiProtocolHandler.h
@@ -0,0 +1,51 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _GHIPROTOCOLHANDLER_H_RPCGEN
+#define _GHIPROTOCOLHANDLER_H_RPCGEN
+
+#include <vmxrpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define GHI_URL_SCHEME_NAME_MAX_LEN 64
+#define GHI_PROTOCOL_HANDLER_MAX_PATH 1040
+#define GHI_MAX_NUM_PROTOCOL_HANDLERS 32
+
+struct GHIProtocolHandlerDetails {
+	char *schemeName;
+	char *handlerActionURI;
+	char *executablePath;
+};
+typedef struct GHIProtocolHandlerDetails GHIProtocolHandlerDetails;
+
+struct GHIProtocolHandlerList {
+	struct {
+		u_int handlers_len;
+		struct GHIProtocolHandlerDetails *handlers_val;
+	} handlers;
+};
+typedef struct GHIProtocolHandlerList GHIProtocolHandlerList;
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern  bool_t xdr_GHIProtocolHandlerDetails (XDR *, GHIProtocolHandlerDetails*);
+extern  bool_t xdr_GHIProtocolHandlerList (XDR *, GHIProtocolHandlerList*);
+
+#else /* K&R C */
+extern bool_t xdr_GHIProtocolHandlerDetails ();
+extern bool_t xdr_GHIProtocolHandlerList ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_GHIPROTOCOLHANDLER_H_RPCGEN */
only in patch2:
unchanged:
--- open-vm-tools-2008.08.08-109361.orig/include/guestrpc/nicinfo.h
+++ open-vm-tools-2008.08.08-109361/include/guestrpc/nicinfo.h
@@ -0,0 +1,81 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _NICINFO_H_RPCGEN
+#define _NICINFO_H_RPCGEN
+
+#include <vmxrpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+enum NicInfoVersion {
+	NIC_INFO_V2 = 2,
+};
+typedef enum NicInfoVersion NicInfoVersion;
+#define NICINFO_MAX_IP_LEN 64
+#define NICINFO_MAX_IPS 64
+#define NICINFO_MAX_NICS 16
+#define NICINFO_MAC_LEN 18
+
+struct VmIpAddress {
+	uint32 addressFamily;
+	Bool dhcpEnabled;
+	char ipAddress[NICINFO_MAX_IP_LEN];
+	char subnetMask[NICINFO_MAX_IP_LEN];
+};
+typedef struct VmIpAddress VmIpAddress;
+
+struct GuestNic {
+	char macAddress[NICINFO_MAC_LEN];
+	struct {
+		u_int ips_len;
+		struct VmIpAddress *ips_val;
+	} ips;
+};
+typedef struct GuestNic GuestNic;
+
+struct GuestNicList {
+	struct {
+		u_int nics_len;
+		struct GuestNic *nics_val;
+	} nics;
+};
+typedef struct GuestNicList GuestNicList;
+
+struct GuestNicProto {
+	NicInfoVersion ver;
+	union {
+		struct GuestNicList *nicsV2;
+	} GuestNicProto_u;
+};
+typedef struct GuestNicProto GuestNicProto;
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern  bool_t xdr_NicInfoVersion (XDR *, NicInfoVersion*);
+extern  bool_t xdr_VmIpAddress (XDR *, VmIpAddress*);
+extern  bool_t xdr_GuestNic (XDR *, GuestNic*);
+extern  bool_t xdr_GuestNicList (XDR *, GuestNicList*);
+extern  bool_t xdr_GuestNicProto (XDR *, GuestNicProto*);
+
+#else /* K&R C */
+extern bool_t xdr_NicInfoVersion ();
+extern bool_t xdr_VmIpAddress ();
+extern bool_t xdr_GuestNic ();
+extern bool_t xdr_GuestNicList ();
+extern bool_t xdr_GuestNicProto ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_NICINFO_H_RPCGEN */
