#include <stdio.h>
#include <glib.h>
#include "vmware.h"
+#include "vmcheck.h"
#include "str.h"
#include "util.h"
#include "dynbuf.h"
gAppName = g_path_get_basename(argv[0]);
g_set_prgname(gAppName);
+ /*
+ * Checking if environment is VM
+ */
+ if (!VmCheck_IsVirtualWorld()) {
+ g_printerr("Error: %s must be run inside a virtual machine"
+ " on a VMware hypervisor product.\n", gAppName);
+ g_free(gAppName);
+ return success;
+ }
+
optCtx = g_option_context_new("[get-value | set-key | delete-key] "
"[<namespace-name>]");
################################################################################
-### Copyright (C) 2009-2016 VMware, Inc. All rights reserved.
+### Copyright (C) 2009-2016,2020 VMware, Inc. All rights reserved.
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of version 2 of the GNU General Public License as
vmware_rpctool_LDADD += ../lib/message/libMessage.la
vmware_rpctool_LDADD += ../lib/backdoor/libBackdoor.la
vmware_rpctool_LDADD += ../lib/string/libString.la
+vmware_rpctool_LDADD += ../lib/vmCheck/libVmCheck.la
+vmware_rpctool_LDADD += ../lib/vmSignal/libVmSignal.la
+vmware_rpctool_LDADD += ../lib/misc/libMisc.la
+vmware_rpctool_LDADD += ../lib/stubs/libStubs.la
/*********************************************************
- * Copyright (C) 2002-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2002-2020 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.h"
#include "rpcout.h"
+#include "vmcheck.h"
#include "str.h"
#include "backdoor_def.h"
#ifdef _WIN32
WinUtil_EnableSafePathSearching(TRUE);
#endif
+ /*
+ * Check if environment is VM
+ */
+ if (!VmCheck_IsVirtualWorld()) {
+ fprintf(stderr, "Error: %s must be run inside a virtual machine"
+ " on a VMware hypervisor product.\n", argv[0]);
+ return -1;
+ }
+
if (argc <= 1) {
PrintUsage();
return 1;
#include "system.h"
#include "unicode.h"
#include "util.h"
+#include "vmcheck.h"
#include "vmware/tools/log.h"
#include "vmware/tools/i18n.h"
#include "vmware/tools/utils.h"
char **argvCopy;
GSource *src;
+ /*
+ * Check that environment is a VM
+ */
+ if (!VmCheck_IsVirtualWorld()) {
+ g_printerr("Error: %s must be run inside a virtual machine"
+ " on a VMware hypervisor product.\n", argv[0]);
+ goto exit;
+ }
+
Unicode_Init(argc, &argv, NULL);
/*
/*********************************************************
- * Copyright (C) 2006-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2020 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.h"
#include "vmsupport.h"
+#include "vmcheck.h"
#include "debug.h"
#include "rpcvmx.h"
#include "rpcout.h"
WinUtil_EnableSafePathSearching(TRUE);
#endif
+ /*
+ * Check if environment is a VM
+ */
+ if (!VmCheck_IsVirtualWorld()) {
+ fprintf(stderr, "Error: %s must be run inside a virtual machine"
+ " on a VMware hypervisor product.\n", argv[0]);
+ return -1;
+ }
+
if (argc == 2 &&
(!strncmp(argv[1], "-h", 2) ||
!strncmp(argv[1], "--help", 6))) {