From: Kruti Pendharkar Date: Fri, 11 Jul 2025 12:48:16 +0000 (-0700) Subject: Update regex for checking 'disable_vmware_customization' flag X-Git-Tag: stable-13.1.0~139 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=ca40ebb053edf5dfd2f9fa82bf8a764b04b281bd;p=thirdparty%2Fopen-vm-tools.git Update regex for checking 'disable_vmware_customization' flag The regex check for "disable_vmware_customization" is too strict and fails when there are inline comments after the flag. As a result, the cloud-init workflow doesn't start. This change is relaxing the check to allow inline comments. Please note that non-capturing group is not supported by POSIX regex API, using capturing group here. --- diff --git a/open-vm-tools/libDeployPkg/linuxDeploymentUtilities.c b/open-vm-tools/libDeployPkg/linuxDeploymentUtilities.c index 9b36168b6..f49570bae 100644 --- a/open-vm-tools/libDeployPkg/linuxDeploymentUtilities.c +++ b/open-vm-tools/libDeployPkg/linuxDeploymentUtilities.c @@ -1,5 +1,6 @@ /********************************************************* - * Copyright (c) 2016-2019, 2023 VMware, Inc. All rights reserved. + * Copyright (c) 2016-2025 Broadcom. All Rights Reserved. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * 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 @@ -202,7 +203,7 @@ GetDisableVMwareCustomizationFlagStatus(const char* cloudInitConfigFilePath) size_t maxGroups = 2, flagValueLength = 0; regmatch_t groupArray[maxGroups]; const char *flagPattern = - "^\\s*disable_vmware_customization\\s*:\\s*(true|false)\\s*$"; + "^\\s*disable_vmware_customization\\s*:\\s*(true|false)\\s*(\\s+#.*)?$"; int reti; cloudInitConfigFile = fopen(cloudInitConfigFilePath, "r");