From: Oliver Kurth Date: Tue, 19 Jun 2018 18:07:43 +0000 (-0700) Subject: Hgfs Server Plugin: only handle the shared folders client in hosted products X-Git-Tag: stable-10.3.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d71381445f6c3b986e263435006428a44be0451a;p=thirdparty%2Fopen-vm-tools.git Hgfs Server Plugin: only handle the shared folders client in hosted products Only initialize the Shared Folders client redirector in hosted product environments. Details: Check if the tools system service started in a non-hosted product and if so do not start the shared folders client redirector. Check if the tools user service started in a non-hosted product product and if so then skip reconnecting any Shared Folders mapped drives. --- diff --git a/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c b/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c index dc041665d..c5ef8726b 100644 --- a/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c +++ b/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c @@ -35,6 +35,8 @@ #include "hgfsServerManager.h" #include "vm_basic_defs.h" #include "vm_assert.h" +#include "vm_vmx_type.h" +#include "vmcheck.h" #include "vmware/guestrpc/tclodefs.h" #include "vmware/tools/log.h" #include "vmware/tools/plugin.h" @@ -1079,24 +1081,35 @@ ToolsOnLoad(ToolsAppCtx *ctx) NULL }; HgfsServerMgrData *mgrData; + uint32 vmxVersion = 0; + uint32 vmxType = VMX_TYPE_UNSET; if (!TOOLS_IS_MAIN_SERVICE(ctx) && !TOOLS_IS_USER_SERVICE(ctx)) { g_info("Unknown container '%s', not loading HGFS plugin.", ctx->name); return NULL; } - if (TOOLS_IS_MAIN_SERVICE(ctx)) { - /* Start the Shared Folders redirector client. */ - HgfsServerClientRdrStart(); - } else if (TOOLS_IS_USER_SERVICE(ctx)) { - /* - * If Explorer recreated the mapped drives prior to the client being up and - * running by the main service, we will need to reconnect the Shared Folders - * drives. - */ - HgfsServerClientRdrConnectDrives(); + /* + * Check for VM is running in a hosted environment and if so initialize + * the Shared Folders HGFS client redirector. + */ + if (VmCheck_GetVersion(&vmxVersion, &vmxType) && + vmxType != VMX_TYPE_SCALABLE_SERVER) { + if (TOOLS_IS_MAIN_SERVICE(ctx)) { + /* Start the Shared Folders redirector client. */ + HgfsServerClientRdrStart(); + } else if (TOOLS_IS_USER_SERVICE(ctx)) { + /* + * If Explorer recreated the mapped drives prior to the client being up and + * running by the main service, we will need to reconnect the Shared Folders + * drives. + */ + HgfsServerClientRdrConnectDrives(); + } else { + NOT_REACHED(); + } } else { - NOT_REACHED(); + g_debug("VM is not running in a hosted product skip HGFS client redirector initialization."); } mgrData = g_malloc0(sizeof *mgrData);