summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2026-03-19 12:47:42 +0100
committerKhem Raj <raj.khem@gmail.com>2026-03-19 13:22:58 -0700
commit75f85e048fb212f0099a8fa9490160e63cd1634d (patch)
tree0c56424b06a2fa64b55a9ee38fcc9730daddd40e
parent92becb30c9ba2b37d7e73b2dae9cd92814596923 (diff)
downloadmeta-openembedded-75f85e048fb212f0099a8fa9490160e63cd1634d.tar.gz
open-vm-tools: backport patch to build with glibc 2.43
As the subject says. Fixes error: | ../../../sources/open-vm-tools-13.0.10/open-vm-tools/lib/hgfs/hgfsEscape.c: In function 'HgfsAddEscapeCharacter': | ../../../sources/open-vm-tools-13.0.10/open-vm-tools/lib/hgfs/hgfsEscape.c:201:15: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] | 201 | illegal = strchr(HGFS_ILLEGAL_CHARS, bufIn[escapeContext->processedOffset]); Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-fix-initialization-discards-const-qualifier-from-poi.patch144
-rw-r--r--meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.10.bb1
2 files changed, 145 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-fix-initialization-discards-const-qualifier-from-poi.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-fix-initialization-discards-const-qualifier-from-poi.patch
new file mode 100644
index 0000000000..c06a88f27e
--- /dev/null
+++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-fix-initialization-discards-const-qualifier-from-poi.patch
@@ -0,0 +1,144 @@
1From 070500fd0e97abb07585882ae448ac35b1c4396c Mon Sep 17 00:00:00 2001
2From: Rudi Heitbaum <rudi@heitbaum.com>
3Date: Mon, 26 Jan 2026 11:55:03 +0000
4Subject: [PATCH] fix initialization discards 'const' qualifier from pointer
5 target type
6
7Since glibc-2.43:
8
9For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
10strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
11pointers into their input arrays now have definitions as macros that
12return a pointer to a const-qualified type when the input argument is
13a pointer to a const-qualified type.
14
15https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html
16
17Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
18
19Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/783]
20Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
21---
22 open-vm-tools/lib/hgfs/hgfsEscape.c | 6 +++---
23 open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 2 +-
24 open-vm-tools/lib/misc/strutil.c | 7 ++++---
25 open-vm-tools/lib/nicInfo/nicInfoPosix.c | 2 +-
26 open-vm-tools/libvmtools/i18n.c | 2 +-
27 open-vm-tools/services/plugins/vix/vixTools.c | 2 +-
28 6 files changed, 11 insertions(+), 10 deletions(-)
29
30diff --git a/open-vm-tools/lib/hgfs/hgfsEscape.c b/open-vm-tools/lib/hgfs/hgfsEscape.c
31index c4d39b12d..212ea1c79 100644
32--- a/open-vm-tools/lib/hgfs/hgfsEscape.c
33+++ b/open-vm-tools/lib/hgfs/hgfsEscape.c
34@@ -175,7 +175,7 @@ HgfsAddEscapeCharacter(char const * bufIn, // IN: input name
35 HgfsEscapeContext *escapeContext = (HgfsEscapeContext *)context;
36 uint32 charactersToCopy;
37 uint32 outputSpace;
38- char* illegal;
39+ const char* illegal;
40 Bool result = TRUE;
41
42 ASSERT(offset >= escapeContext->processedOffset); // Scanning forward
43@@ -573,7 +573,7 @@ HgfsIsEscapeSequence(char const *bufIn, // IN: input name
44 uint32 length) // IN: length of the name in characters
45 {
46 if (bufIn[offset] == HGFS_ESCAPE_CHAR && offset > 0) {
47- char *substitute;
48+ const char *substitute;
49 if (bufIn[offset - 1] == HGFS_ESCAPE_SUBSTITUE_CHAR && offset > 1) {
50 /*
51 * Possibly a valid sequence, check it must be preceded with a substitute
52@@ -887,7 +887,7 @@ HgfsEscapeUndoComponent(char *bufIn, // IN: Characters to be unesc
53 size_t offset = escapePointer - bufIn;
54
55 if (HgfsIsEscapeSequence(bufIn, offset, sizeIn)) {
56- char* substitute = strchr(HGFS_SUBSTITUTE_CHARS, bufIn[offset - 1]);
57+ const char* substitute = strchr(HGFS_SUBSTITUTE_CHARS, bufIn[offset - 1]);
58 if (substitute != NULL) {
59 bufIn[offset - 1] = HGFS_ILLEGAL_CHARS[substitute - HGFS_SUBSTITUTE_CHARS];
60 } else if (bufIn[offset - 1] == HGFS_ESCAPE_SUBSTITUE_CHAR) {
61diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
62index 445a53881..eeabcadd4 100644
63--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
64+++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
65@@ -1366,7 +1366,7 @@ static void
66 HgfsGetHiddenAttr(char const *fileName, // IN: Input filename
67 HgfsFileAttrInfo *attr) // OUT: Struct to copy into
68 {
69- char *baseName;
70+ const char *baseName;
71
72 ASSERT(fileName);
73 ASSERT(attr);
74diff --git a/open-vm-tools/lib/misc/strutil.c b/open-vm-tools/lib/misc/strutil.c
75index 4fc6502e4..4be63b7b8 100644
76--- a/open-vm-tools/lib/misc/strutil.c
77+++ b/open-vm-tools/lib/misc/strutil.c
78@@ -1454,6 +1454,7 @@ StrUtil_ReplaceAll(const char *orig, // IN
79 char *result;
80 const char *current;
81 char *tmp;
82+ const char *tmp2;
83 size_t lenWhat;
84 size_t lenWith;
85 size_t occurrences = 0;
86@@ -1467,8 +1468,8 @@ StrUtil_ReplaceAll(const char *orig, // IN
87 lenWith = strlen(with);
88
89 current = orig;
90- while ((tmp = strstr(current, what)) != NULL) {
91- current = tmp + lenWhat;
92+ while ((tmp2 = strstr(current, what)) != NULL) {
93+ current = tmp2 + lenWhat;
94 ++occurrences;
95 }
96
97@@ -1695,7 +1696,7 @@ StrUtilHasListItem(char const *list, // IN:
98 char const *item, // IN:
99 int (*ncmp)(char const *, char const*, size_t)) // IN:
100 {
101- char *foundDelim;
102+ const char *foundDelim;
103 int itemLen = strlen(item);
104
105 if (list == NULL) {
106diff --git a/open-vm-tools/lib/nicInfo/nicInfoPosix.c b/open-vm-tools/lib/nicInfo/nicInfoPosix.c
107index 6f20547b2..a387e377b 100644
108--- a/open-vm-tools/lib/nicInfo/nicInfoPosix.c
109+++ b/open-vm-tools/lib/nicInfo/nicInfoPosix.c
110@@ -267,7 +267,7 @@ static Bool
111 IpEntryMatchesDevice(const char *devName,
112 const char *label)
113 {
114- char *p;
115+ const char *p;
116 size_t n;
117
118 if ((p = strchr(label, ':')) != NULL) {
119diff --git a/open-vm-tools/libvmtools/i18n.c b/open-vm-tools/libvmtools/i18n.c
120index 3085f72d7..f61406d14 100644
121--- a/open-vm-tools/libvmtools/i18n.c
122+++ b/open-vm-tools/libvmtools/i18n.c
123@@ -698,7 +698,7 @@ VMTools_BindTextDomain(const char *domain,
124 * If we couldn't find the catalog file for the user's language, see if
125 * we can find a more generic language (e.g., for "en_US", also try "en").
126 */
127- char *sep = Str_Strrchr(lang, '_');
128+ const char *sep = Str_Strrchr(lang, '_');
129 if (sep != NULL) {
130 if (usrlang == NULL) {
131 usrlang = Util_SafeStrdup(lang);
132diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c
133index b2079a10d..6a8498ffb 100644
134--- a/open-vm-tools/services/plugins/vix/vixTools.c
135+++ b/open-vm-tools/services/plugins/vix/vixTools.c
136@@ -925,7 +925,7 @@ VixToolsBuildUserEnvironmentTable(const char * const *envp) // IN: optional
137 for (; NULL != *envp; envp++) {
138 char *name;
139 char *value;
140- char *whereToSplit;
141+ const char *whereToSplit;
142 size_t nameLen;
143
144 whereToSplit = strchr(*envp, '=');
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.10.bb b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.10.bb
index 4ec6d5aa86..a48d1ce88d 100644
--- a/meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.10.bb
+++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.10.bb
@@ -44,6 +44,7 @@ SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https;branch=maste
44 file://0013-open-vm-tools-Correct-include-path-for-poll.h.patch;patchdir=.. \ 44 file://0013-open-vm-tools-Correct-include-path-for-poll.h.patch;patchdir=.. \
45 file://0014-timeSync-Portable-way-to-print-64bit-time_t.patch;patchdir=.. \ 45 file://0014-timeSync-Portable-way-to-print-64bit-time_t.patch;patchdir=.. \
46 file://0001-glib_stubs-avoid-GLib-g_free-macro-redefinition-erro.patch;patchdir=.. \ 46 file://0001-glib_stubs-avoid-GLib-g_free-macro-redefinition-erro.patch;patchdir=.. \
47 file://0001-fix-initialization-discards-const-qualifier-from-poi.patch;patchdir=.. \
47 " 48 "
48 49
49UPSTREAM_CHECK_GITTAGREGEX = "stable-(?P<pver>\d+(\.\d+)+)" 50UPSTREAM_CHECK_GITTAGREGEX = "stable-(?P<pver>\d+(\.\d+)+)"