From: Katy Feng Date: Thu, 16 Nov 2023 17:21:20 +0000 (-0800) Subject: Changes to common source files not applicable to open-vm-tools. X-Git-Tag: stable-12.4.0~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f094b993b7be5583e47a0d3f10fcbabe1db49122;p=thirdparty%2Fopen-vm-tools.git Changes to common source files not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/conf.h b/open-vm-tools/lib/include/conf.h index babafc82e..edb844093 100644 --- a/open-vm-tools/lib/include/conf.h +++ b/open-vm-tools/lib/include/conf.h @@ -590,7 +590,17 @@ /** Where to find Tools data in the Win32 registry. */ -#define CONF_VMWARE_TOOLS_REGKEY "Software\\VMware, Inc.\\VMware Tools" +#if defined(_WIN32) +# ifndef WSTR +# define WSTR_(X) L##X +# define WSTR(X) WSTR_(X) +# endif +# define CONF_VMWARE_TOOLS_REGKEY "Software\\VMware, Inc.\\VMware Tools" +# define CONF_VMWARE_TOOLS_INSTPATH_KEY "InstallPath" + +# define CONF_VMWARE_TOOLS_REGKEY_W WSTR(CONF_VMWARE_TOOLS_REGKEY) +# define CONF_VMWARE_TOOLS_INSTPATH_KEY_W WSTR(CONF_VMWARE_TOOLS_INSTPATH_KEY) +#endif /* Wait 5 seconds between polls to see if the conf file has changed */ #define CONF_POLL_TIME 5 diff --git a/open-vm-tools/vgauth/cli/main.c b/open-vm-tools/vgauth/cli/main.c index 2ffafb0cc..e2b7ef061 100644 --- a/open-vm-tools/vgauth/cli/main.c +++ b/open-vm-tools/vgauth/cli/main.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2020, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -41,6 +41,9 @@ #define VMW_TEXT_DOMAIN "VGAuthCli" #include "i18n.h" #include "prefs.h" +#ifdef _WIN32 +# include "winUtil.h" +#endif static gchar *appName; @@ -940,6 +943,13 @@ wmain(int argc, int i; char **argvUtf8 = g_malloc0((argc + 1) * sizeof (char*)); +#ifdef _WIN32 + WinUtil_EnableSafePathSearching(); +#if defined(VMX86_RELEASE) + WinUtil_VerifyExePathW(); +#endif +#endif + for (i = 0; i < argc; ++i) { CHK_UTF16_TO_UTF8(argvUtf8[i], argv[i], goto end); } diff --git a/open-vm-tools/vgauth/service/main.c b/open-vm-tools/vgauth/service/main.c index 71713e138..f157cf40c 100644 --- a/open-vm-tools/vgauth/service/main.c +++ b/open-vm-tools/vgauth/service/main.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2011-2021, 2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -532,6 +532,9 @@ main(int argc, { #ifdef _WIN32 WinUtil_EnableSafePathSearching(); +#if defined(VMX86_RELEASE) + WinUtil_VerifyExePathW(); +#endif #endif gPrefs = Pref_Init(VGAUTH_PREF_CONFIG_FILENAME);