]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common source file changes not applicable to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Thu, 28 Mar 2019 19:43:00 +0000 (12:43 -0700)
committerOliver Kurth <okurth@vmware.com>
Thu, 28 Mar 2019 19:43:00 +0000 (12:43 -0700)
Security fix for dll load paths in Tools and vgauth.

open-vm-tools/checkvm/checkvm.c
open-vm-tools/hgfsclient/hgfsclient.c
open-vm-tools/namespacetool/namespacetool.c
open-vm-tools/rpctool/rpctool.c
open-vm-tools/toolbox/toolbox-cmd.c
open-vm-tools/vgauth/service/main.c
open-vm-tools/xferlogs/xferlogs.c

index 1642d9411d42955d91ed16434a773437b15a246a..31694f4ece8bc95701f6bd641ddcdbeda2d5f4ed 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2007-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2007-2019 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
@@ -36,6 +36,7 @@
 #include "vmcheck.h"
 #if defined(_WIN32)
 #include "getoptwin32.h"
+#include "vmware/tools/win32util.h"
 #endif
 
 #include "checkvm_version.h"
@@ -84,6 +85,10 @@ main(int argc,
    uint32 screensize = 0;
    uint32 hwVersion;
 
+#if defined(_WIN32)
+   WinUtil_EnableSafePathSearching(TRUE);
+#endif
+
    if (!VmCheck_IsVirtualWorld()) {
       fprintf(stdout, "Not running in a virtual machine.\n");
       return 1;
index 642b3ea83759a3577a77bf2065bc6e2e02c2ffde..8ba516c20e886b8871d085ac37873bb517fc363c 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2006-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2019 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
@@ -37,6 +37,9 @@
 #include "str.h"
 #include "vmware/tools/log.h"
 #include "vmware/tools/utils.h"
+#ifdef _WIN32
+#include "vmware/tools/win32util.h"
+#endif
 
 #include "hgfsclient_version.h"
 #include "vm_version.h"
@@ -415,6 +418,9 @@ int
 main(int argc,          // IN
      char *argv[])      // IN
 {
+#ifdef _WIN32
+   WinUtil_EnableSafePathSearching(TRUE);
+#endif
    if (argc == 2 &&
        (!strncmp(argv[1], "-h", 2) ||
         !strncmp(argv[1], "--help", 6))) {
index b3e9700cd96a1d924b78cf6913c839f626bb9386..171e3526724d47a5d8997fe85f58b147757c5a0e 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2016-2019 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
@@ -30,6 +30,9 @@
 #include "dynbuf.h"
 #include "vmware/tools/guestrpc.h"
 #include "vmware/tools/log.h"
+#if defined(_WIN32)
+#include "vmware/tools/win32util.h"
+#endif
 #include "debug.h"
 
 // Core Namespace commands
@@ -626,6 +629,10 @@ main(int argc, char *argv[])
       { NULL }
    };
 
+#if defined(_WIN32)
+   WinUtil_EnableSafePathSearching(TRUE);
+#endif
+
    gAppName = g_path_get_basename(argv[0]);
    g_set_prgname(gAppName);
 
index cc83d8b9ff37de4127bdc1ba5b161d8e0210f446..d7bfd5204c9efd07aa5695836c0f4a031babb7ee 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2002-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2002-2019 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
@@ -35,6 +35,9 @@
 #include "rpcout.h"
 #include "str.h"
 #include "backdoor_def.h"
+#ifdef _WIN32
+#include "vmware/tools/win32util.h"
+#endif
 
 #define NOT_VMWARE_ERROR "Failed sending message to VMware.\n"
 
@@ -135,6 +138,10 @@ main(int argc, char *argv[])
 {
    int ret = 1;
 
+#ifdef _WIN32
+   WinUtil_EnableSafePathSearching(TRUE);
+#endif
+
    if (argc <= 1) {
       PrintUsage();
       return 1;
index 45a12ef4b1a73e1eb4a858f39b91a778e5202f8d..19af5ba3a60c7b90870c16e5e9f8b8e7ef2c0a86 100644 (file)
@@ -1,6 +1,6 @@
 
 /*********************************************************
- * Copyright (C) 2008-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2019 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
 #include "vmware/tools/i18n.h"
 #include "vmware/tools/log.h"
 #include "vmware/tools/utils.h"
+#if defined(_WIN32)
+#include "vmware/tools/win32util.h"
+#endif
+
 #include "vm_version.h"
 #include "vm_product_versions.h"
 
@@ -447,6 +451,9 @@ main(int argc,    // IN: length of command line arguments
 
 #if defined(_WIN32)
    char **argv;
+
+   WinUtil_EnableSafePathSearching(TRUE);
+
    Unicode_InitW(argc, wargv, NULL, &argv, NULL);
 #else
    Unicode_Init(argc, &argv, NULL);
index 1e64cd32d3166e19347aef3a8707a1f20569c854..9f0f337f8a306f75c514eeae26adf86371a4002e 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2019 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
@@ -530,6 +530,10 @@ int
 main(int argc,
      char *argv[])
 {
+#ifdef _WIN32
+   WinUtil_EnableSafePathSearching();
+#endif
+
    gPrefs = Pref_Init(VGAUTH_PREF_CONFIG_FILENAME);
 
    /*
index 9aa9b3ac2099907af4ea77fc9d5afd017b045625..0b07ab44a580a2a50c6b83c63925688f3db2256c 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2006-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2019 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
@@ -55,6 +55,9 @@
 
 #include "xferlogs_version.h"
 #include "vm_version.h"
+#ifdef _WIN32
+#include "vmware/tools/win32util.h"
+#endif
 #include "embed_version.h"
 VM_EMBED_VERSION(XFERLOGS_VERSION_STRING);
 
@@ -285,6 +288,10 @@ main(int argc,
 {
    int status;
 
+#ifdef _WIN32
+   WinUtil_EnableSafePathSearching(TRUE);
+#endif
+
    if (argc == 2 &&
        (!strncmp(argv[1], "-h", 2) ||
         !strncmp(argv[1], "--help", 6))) {