From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:37 +0000 (-0700) Subject: Avoid name strings other than vmusr/vmsvc in vmtoolsd command line. X-Git-Tag: stable-10.2.0~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c3c80df2b8c246e1441a9f34fb11b25dc344e97;p=thirdparty%2Fopen-vm-tools.git Avoid name strings other than vmusr/vmsvc in vmtoolsd command line. Add name checking when parsing command line. --- diff --git a/open-vm-tools/services/vmtoolsd/cmdLine.c b/open-vm-tools/services/vmtoolsd/cmdLine.c index 6e619f1d0..ee40b2611 100644 --- a/open-vm-tools/services/vmtoolsd/cmdLine.c +++ b/open-vm-tools/services/vmtoolsd/cmdLine.c @@ -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);