]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Avoid name strings other than vmusr/vmsvc in vmtoolsd command line.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:37 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:37 +0000 (11:23 -0700)
Add name checking when parsing command line.

open-vm-tools/services/vmtoolsd/cmdLine.c

index 6e619f1d003e749b2717abc4f52ef8ac41bdefc5..ee40b2611c7aab256f7e6cb8be243cbba84a856b 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2017 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
@@ -322,8 +322,9 @@ ToolsCore_ParseCommandLine(ToolsServiceState *state,
       state->name = VMTOOLS_GUEST_SERVICE;
       state->mainService = TRUE;
    } else {
-      if (strcmp(state->name, TOOLSCORE_COMMON) == 0) {
-         g_printerr("%s is an invalid container name.\n", state->name);
+      if (strcmp(state->name, VMTOOLS_USER_SERVICE) != 0 &&
+          strcmp(state->name, VMTOOLS_GUEST_SERVICE) != 0) {
+         g_printerr("%s is an invalid service name.\n", state->name);
          goto exit;
       }
       state->mainService = TOOLS_IS_MAIN_SERVICE(state);