From: John Wolfe Date: Tue, 12 Jul 2022 16:56:01 +0000 (-0700) Subject: Changes to common source files not applicable to open-vm-tools. X-Git-Tag: stable-12.1.0~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb2f24ed14f8d5102df6387253ba4ac4271bf4f5;p=thirdparty%2Fopen-vm-tools.git Changes to common source files not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/conf.h b/open-vm-tools/lib/include/conf.h index 4f0442028..282b9e0c0 100644 --- a/open-vm-tools/lib/include/conf.h +++ b/open-vm-tools/lib/include/conf.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2002-2021 VMware, Inc. All rights reserved. + * Copyright (C) 2002-2022 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 @@ -609,6 +609,7 @@ #define CONFNAME_AUTOUPGRADE_ALLOW_UPGRADE "allow-upgrade" #define CONFNAME_AUTOUPGRADE_ALLOW_ADD_FEATURE "allow-add-feature" #define CONFNAME_AUTOUPGRADE_ALLOW_REMOVE_FEATURE "allow-remove-feature" +#define CONFNAME_AUTOUPGRADE_ALLOW_MSI_TRANSFORMS "allow-msi-transforms" /* * END upgrader goodies. diff --git a/open-vm-tools/lib/include/strutil.h b/open-vm-tools/lib/include/strutil.h index 43ee5519b..218711182 100644 --- a/open-vm-tools/lib/include/strutil.h +++ b/open-vm-tools/lib/include/strutil.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2018, 2021 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2018, 2021-2022 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 @@ -66,6 +66,7 @@ Bool StrUtil_StartsWith(const char *s, const char *prefix); Bool StrUtil_CaselessStartsWith(const char *s, const char *prefix); Bool StrUtil_EndsWith(const char *s, const char *suffix); Bool StrUtil_CaselessEndsWith(const char *s, const char *suffix); +const char * StrUtil_CaselessStrstr(const char *str, const char *strSearch); Bool StrUtil_IsASCII(const char *s); Bool StrUtil_VDynBufPrintf(struct DynBuf *b, const char *fmt, va_list args); diff --git a/open-vm-tools/lib/misc/strutil.c b/open-vm-tools/lib/misc/strutil.c index 6152b811c..acecee504 100644 --- a/open-vm-tools/lib/misc/strutil.c +++ b/open-vm-tools/lib/misc/strutil.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2019, 2021 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2019, 2021-2022 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 @@ -1040,6 +1040,48 @@ StrUtil_CaselessEndsWith(const char *s, // IN } +/** + *----------------------------------------------------------------------------- + * + * StrUtil_CaselessStrstr -- + * + * This is a case-insensitive version of strstr in C string.h. + * + * Results: + * return a pointer to the first occurrence of strSearch in str, or NULL + * if strSearch does not appear in str. If strSearch is zero length, the + * function returns str. + * + * Side effects: + * none + * + *----------------------------------------------------------------------------- + */ + +const char * +StrUtil_CaselessStrstr(const char *str, // IN + const char *strSearch) // IN +{ + size_t len; + + if (strSearch == NULL || *strSearch == '\0') { + return str; + } + + if (str == NULL || *str == '\0') { + return NULL; + } + + len = strlen(strSearch); + for (; *str; str++) { + if (strncasecmp(str, strSearch, len) == 0) { + return str; + } + } + return NULL; +} + + /* *----------------------------------------------------------------------------- * diff --git a/open-vm-tools/tools.conf b/open-vm-tools/tools.conf index bfcf952b7..2577d324b 100644 --- a/open-vm-tools/tools.conf +++ b/open-vm-tools/tools.conf @@ -436,16 +436,19 @@ [autoupgrade] -# The autoupgrade plugin is only available for Windows. - # The "allow-upgrade" option controls whether automatic upgrades (or reinstalls) -# are allowed. The two options "allow-add-feature" and "allow-remove-feature" -# control whether adding or removing a feature will be allowed. The two latter -# ones only affect Windows tools. - +# are allowed. #allow-upgrade=true + +# The autoupgrade plugin is only available for Windows. +# The "allow-add-feature" and "allow-remove-feature" control whether adding +# or removing a feature will be allowed. +# The allow-msi-transforms option controls whether TRANSFORMS property is +# allowed. + #allow-add-feature=true #allow-remove-feature=true +#allow-msi-transforms=false [deployPkg]