]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Update regex for checking 'disable_vmware_customization' flag
authorKruti Pendharkar <kp025370@broadcom.com>
Fri, 11 Jul 2025 12:48:16 +0000 (05:48 -0700)
committerKruti Pendharkar <kp025370@broadcom.com>
Fri, 11 Jul 2025 12:48:16 +0000 (05:48 -0700)
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.

open-vm-tools/libDeployPkg/linuxDeploymentUtilities.c

index 9b36168b691be449bc5ce2dc8b9efb3fdadb551f..f49570baea012fd00b411e74f403b54cde8dc9af 100644 (file)
@@ -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");