From 6642ae94227f7c3c91c1a58f00f99aeb9eb2393f Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Thu, 13 Jun 2019 16:26:43 +0000 Subject: open-vm-tools: refresh the patches so that they can be easily applied with devtool or git am * in preparation for a fix for gcc9 in following commit Signed-off-by: Martin Jansa Signed-off-by: Khem Raj --- .../0001-Use-off64_t-instead-of-__off64_t.patch | 31 ----- .../0001-configure.ac-don-t-use-dnet-config.patch | 16 +-- ...0001-include-poll.h-instead-of-sys-poll.h.patch | 26 ---- ...1-misc-Do-not-print-NULL-string-into-logs.patch | 31 ----- .../0002-Rename-poll.h-to-vm_poll.h.patch | 115 ------------------ .../0002-add-include-sys-sysmacros.h.patch | 17 ++- ...03-Use-configure-test-for-struct-timespec.patch | 45 +++++++ ...osix-strerror_r-unless-on-gnu-libc-system.patch | 39 ------ ...ix-definition-of-ALLPERMS-and-ACCESSPERMS.patch | 58 +++++++++ .../0004-Use-uintmax_t-for-handling-rlim_t.patch | 29 ----- ...05-Use-configure-test-for-struct-timespec.patch | 45 ------- ...re-to-test-for-feature-instead-of-platfor.patch | 135 +++++++++++++++++++++ ...ix-definition-of-ALLPERMS-and-ACCESSPERMS.patch | 58 --------- ...Use-configure-test-for-sys-stat.h-include.patch | 25 ++++ .../0007-Fix-subdir-objects-configure-error.patch | 24 ++++ ...re-to-test-for-feature-instead-of-platfor.patch | 135 --------------------- ...0008-include-poll.h-instead-of-sys-poll.h.patch | 26 ++++ .../0009-Rename-poll.h-to-vm_poll.h.patch | 115 ++++++++++++++++++ ...osix-strerror_r-unless-on-gnu-libc-system.patch | 39 ++++++ ...Use-configure-test-for-sys-stat.h-include.patch | 25 ---- .../0011-Use-uintmax_t-for-handling-rlim_t.patch | 29 +++++ .../0012-Use-off64_t-instead-of-__off64_t.patch | 31 +++++ ...3-misc-Do-not-print-NULL-string-into-logs.patch | 31 +++++ .../fix-subdir-objects-configure-error.patch | 12 -- .../open-vm-tools/open-vm-tools_10.3.5.bb | 34 +++--- 25 files changed, 590 insertions(+), 581 deletions(-) delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Use-off64_t-instead-of-__off64_t.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-include-poll.h-instead-of-sys-poll.h.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-misc-Do-not-print-NULL-string-into-logs.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-Rename-poll.h-to-vm_poll.h.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0003-Use-configure-test-for-struct-timespec.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0003-use-posix-strerror_r-unless-on-gnu-libc-system.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0004-Use-uintmax_t-for-handling-rlim_t.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-test-for-struct-timespec.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-to-test-for-feature-instead-of-platfor.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Use-configure-test-for-sys-stat.h-include.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0007-Fix-subdir-objects-configure-error.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0007-Use-configure-to-test-for-feature-instead-of-platfor.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0008-include-poll.h-instead-of-sys-poll.h.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0009-Rename-poll.h-to-vm_poll.h.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0011-Use-configure-test-for-sys-stat.h-include.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0011-Use-uintmax_t-for-handling-rlim_t.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0012-Use-off64_t-instead-of-__off64_t.patch create mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/0013-misc-Do-not-print-NULL-string-into-logs.patch delete mode 100644 meta-oe/recipes-support/open-vm-tools/open-vm-tools/fix-subdir-objects-configure-error.patch (limited to 'meta-oe') diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Use-off64_t-instead-of-__off64_t.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Use-off64_t-instead-of-__off64_t.patch deleted file mode 100644 index 432496f27f..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-Use-off64_t-instead-of-__off64_t.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 43d859f9d5eecdc0fdc1a6bf539bcde4a152e6f5 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 27 Aug 2018 23:22:21 -0700 -Subject: [PATCH] Use off64_t instead of __off64_t - -Fixes -unknown type name '__off64_t' - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - lib/file/fileIOPosix.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/file/fileIOPosix.c b/lib/file/fileIOPosix.c -index 23108279..bcd2ddc5 100644 ---- a/lib/file/fileIOPosix.c -+++ b/lib/file/fileIOPosix.c -@@ -206,10 +206,10 @@ static AlignedPool alignedPool; - * the symbols (and anyone building XOPEN<700 gets nothing). - */ - extern ssize_t preadv64(int fd, const struct iovec *iov, int iovcnt, -- __off64_t offset) __attribute__ ((weak)); -+ off64_t offset) __attribute__ ((weak)); - - extern ssize_t pwritev64(int fd, const struct iovec *iov, int iovcnt, -- __off64_t offset) __attribute__ ((weak)); -+ off64_t offset) __attribute__ ((weak)); - #else - #error "Large file support unavailable. Aborting." - #endif diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-configure.ac-don-t-use-dnet-config.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-configure.ac-don-t-use-dnet-config.patch index b7a4058352..0736572b3e 100644 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-configure.ac-don-t-use-dnet-config.patch +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-configure.ac-don-t-use-dnet-config.patch @@ -1,4 +1,4 @@ -From 929150608c16644695f19cd2e0cc8a06a41cd497 Mon Sep 17 00:00:00 2001 +From fc9bf1ce9f1a21150b10736a1c968d4ca6d4eaa3 Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Fri, 7 Apr 2017 15:20:30 -0700 Subject: [PATCH] configure.ac: don't use dnet-config @@ -11,14 +11,14 @@ Upstream-Status: Inappropriate [embedded specific] Signed-off-by: Martin Kelly --- - configure.ac | 4 ++-- + open-vm-tools/configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -Index: open-vm-tools/configure.ac -=================================================================== ---- open-vm-tools.orig/configure.ac -+++ open-vm-tools/configure.ac -@@ -944,7 +944,7 @@ if test "$with_dnet" = "yes"; then +diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac +index 325a39f5..713ea683 100644 +--- a/open-vm-tools/configure.ac ++++ b/open-vm-tools/configure.ac +@@ -949,7 +949,7 @@ if test "$with_dnet" = "yes"; then AC_VMW_CHECK_LIB([dnet], [DNET], [], @@ -27,7 +27,7 @@ Index: open-vm-tools/configure.ac [], [dnet.h], [intf_open], -@@ -954,7 +954,7 @@ if test "$with_dnet" = "yes"; then +@@ -959,7 +959,7 @@ if test "$with_dnet" = "yes"; then if test $have_dnet = "no"; then AC_MSG_ERROR( diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-include-poll.h-instead-of-sys-poll.h.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-include-poll.h-instead-of-sys-poll.h.patch deleted file mode 100644 index 8820581198..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-include-poll.h-instead-of-sys-poll.h.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 4981bb3013d7f1e40e44618076d99af3484eedea Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 13 Jun 2018 23:02:50 -0700 -Subject: [PATCH] include poll.h instead of sys/poll.h - -including sys/poll.h is deprecated - -Signed-off-by: Khem Raj ---- - open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/asyncsocket/asyncsocket.c b/lib/asyncsocket/asyncsocket.c -index 13908679..e0a68e7e 100644 ---- a/lib/asyncsocket/asyncsocket.c -+++ b/lib/asyncsocket/asyncsocket.c -@@ -69,8 +69,8 @@ - #else - #include - #include -+#include - #include --#include - #include - #include - #include diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-misc-Do-not-print-NULL-string-into-logs.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-misc-Do-not-print-NULL-string-into-logs.patch deleted file mode 100644 index 7af265a999..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0001-misc-Do-not-print-NULL-string-into-logs.patch +++ /dev/null @@ -1,31 +0,0 @@ -From e25d00d8297cba044c3a4d2e38749e54adac66c1 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 22 Dec 2018 19:59:02 -0800 -Subject: [PATCH] misc: Do not print NULL string into logs - -string format %s is getting a NULL pointer for 'expand' -parameter always since the check for chunks[i] == NULL will ensure that -its always null when the Log() API is called - -Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/312] - -Signed-off-by: Khem Raj ---- - open-vm-tools/lib/misc/util_misc.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git open-vm-tools/lib/misc/util_misc.c b/open-vm-tools/lib/misc/util_misc.c -index 198c23d2..0ac0a335 100644 ---- open-vm-tools/lib/misc/util_misc.c -+++ open-vm-tools/lib/misc/util_misc.c -@@ -719,8 +719,8 @@ Util_ExpandString(const char *fileName) // IN file path to expand - ASSERT(!freeChunk[i]); - chunks[i] = expand; - if (chunks[i] == NULL) { -- Log("%s: Cannot allocate memory to expand \"%s\" in \"%s\".\n", -- __FUNCTION__, expand, fileName); -+ Log("%s: Cannot allocate memory to expand in \"%s\".\n", -+ __FUNCTION__, fileName); - goto out; - } - chunkSize[i] = strlen(expand); diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-Rename-poll.h-to-vm_poll.h.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-Rename-poll.h-to-vm_poll.h.patch deleted file mode 100644 index 4d6a0fd6ad..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-Rename-poll.h-to-vm_poll.h.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 92955b3a6180b4285d11ef79766df01b9ab60dbd Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 13 Jun 2018 23:11:58 -0700 -Subject: [PATCH] Rename poll.h to vm_poll.h - -musl libc's system headers pulls in open-vm-tools' poll.h. To avoid this -we rename poll.h to vm_poll.h. - -Signed-off-by: Natanael Copa -Signed-off-by: Khem Raj ---- - open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- - open-vm-tools/lib/hgfsServer/hgfsServer.c | 2 +- - open-vm-tools/lib/include/asyncsocket.h | 2 +- - open-vm-tools/lib/include/pollImpl.h | 2 +- - open-vm-tools/lib/include/{poll.h => vm_poll.h} | 2 +- - open-vm-tools/lib/rpcIn/rpcin.c | 2 +- - .../services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c | 2 +- - 7 files changed, 7 insertions(+), 7 deletions(-) - rename open-vm-tools/lib/include/{poll.h => vm_poll.h} (99%) - -diff --git a/lib/asyncsocket/asyncsocket.c b/lib/asyncsocket/asyncsocket.c -index e0a68e7e..b9675674 100644 ---- a/lib/asyncsocket/asyncsocket.c -+++ b/lib/asyncsocket/asyncsocket.c -@@ -86,7 +86,7 @@ - #include "random.h" - #include "asyncsocket.h" - #include "asyncSocketBase.h" --#include "poll.h" -+#include "vm_poll.h" - #include "log.h" - #include "err.h" - #include "hostinfo.h" -diff --git a/lib/hgfsServer/hgfsServer.c b/lib/hgfsServer/hgfsServer.c -index 991a7941..ed0c09f9 100644 ---- a/lib/hgfsServer/hgfsServer.c -+++ b/lib/hgfsServer/hgfsServer.c -@@ -48,7 +48,7 @@ - #include "hgfsServerOplock.h" - #include "hgfsDirNotify.h" - #include "userlock.h" --#include "poll.h" -+#include "vm_poll.h" - #include "mutexRankLib.h" - #include "vm_basic_asm.h" - #include "unicodeOperations.h" -diff --git a/lib/include/asyncsocket.h b/lib/include/asyncsocket.h -index 524147ea..103f944f 100644 ---- a/lib/include/asyncsocket.h -+++ b/lib/include/asyncsocket.h -@@ -164,7 +164,7 @@ typedef struct AsyncSocket AsyncSocket; - * Or the client can specify its favorite poll class and locking behavior. - * Use of IVmdbPoll is only supported for regular sockets and for Attach. - */ --#include "poll.h" -+#include "vm_poll.h" - struct IVmdbPoll; - typedef struct AsyncSocketPollParams { - int flags; /* Default 0, only POLL_FLAG_NO_BULL is valid */ -diff --git a/lib/include/pollImpl.h b/lib/include/pollImpl.h -index 46442e55..8bc66997 100644 ---- a/lib/include/pollImpl.h -+++ b/lib/include/pollImpl.h -@@ -44,7 +44,7 @@ - #define INCLUDE_ALLOW_USERLEVEL - #include "includeCheck.h" - --#include "poll.h" -+#include "vm_poll.h" - #include "vm_basic_asm.h" - - #if defined(__cplusplus) -diff --git a/lib/include/poll.h b/lib/include/vm_poll.h -similarity index 99% -rename from open-vm-tools/lib/include/poll.h -rename to open-vm-tools/lib/include/vm_poll.h -index 988fe6d0..e9e74fb5 100644 ---- a/lib/include/poll.h -+++ b/lib/include/vm_poll.h -@@ -60,7 +60,7 @@ extern "C" { - #if !defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE == 0 - #include - #endif --#include -+#include - #define HZ 100 - #endif - #ifdef __ANDROID__ -diff --git a/lib/rpcIn/rpcin.c b/lib/rpcIn/rpcin.c -index c2c51583..d6c62f10 100644 ---- a/lib/rpcIn/rpcin.c -+++ b/lib/rpcIn/rpcin.c -@@ -57,7 +57,7 @@ - - #if defined(VMTOOLS_USE_VSOCKET) - # include --# include "poll.h" -+# include "vm_poll.h" - # include "asyncsocket.h" - # include "vmci_defs.h" - #include "dataMap.h" -diff --git a/services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c b/services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c -index 03700937..f0b49ad7 100644 ---- a/services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c -+++ b/services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c -@@ -48,7 +48,7 @@ - #include "rpcout.h" - #include "rabbitmqProxyConst.h" - #include "vm_basic_types.h" --#include "poll.h" -+#include "vm_poll.h" - #ifdef OPEN_VM_TOOLS - #include "vmci_sockets.h" - #include "sslDirect.h" diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-add-include-sys-sysmacros.h.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-add-include-sys-sysmacros.h.patch index f905601d52..34628ffbef 100644 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-add-include-sys-sysmacros.h.patch +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0002-add-include-sys-sysmacros.h.patch @@ -1,7 +1,7 @@ -From 5818acc8032e3247257730376e947330340a07b3 Mon Sep 17 00:00:00 2001 +From 3fa237b3afabc293e563292b8d89265a871626ad Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Mon, 22 May 2017 17:00:05 -0700 -Subject: [PATCH 2/2] add #include +Subject: [PATCH] add #include In newer glibc versions, the definition for major() has been moved to sys/sysmacros.h, and using the older version in has been @@ -11,14 +11,14 @@ Upstream-Status: Pending Signed-off-by: Martin Kelly --- - lib/wiper/wiperPosix.c | 3 +++ + open-vm-tools/lib/wiper/wiperPosix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/open-vm-tools/lib/wiper/wiperPosix.c b/open-vm-tools/lib/wiper/wiperPosix.c -index d389eee..1f221fc 100644 ---- a/lib/wiper/wiperPosix.c -+++ b/lib/wiper/wiperPosix.c -@@ -40,6 +40,9 @@ +index bd542410..ccf06293 100644 +--- a/open-vm-tools/lib/wiper/wiperPosix.c ++++ b/open-vm-tools/lib/wiper/wiperPosix.c +@@ -43,6 +43,9 @@ # include # endif /* __FreeBSD_version >= 500000 */ #endif @@ -28,6 +28,3 @@ index d389eee..1f221fc 100644 #include #include "vmware.h" --- -2.7.4 - diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0003-Use-configure-test-for-struct-timespec.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0003-Use-configure-test-for-struct-timespec.patch new file mode 100644 index 0000000000..6d2e498141 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0003-Use-configure-test-for-struct-timespec.patch @@ -0,0 +1,45 @@ +From bf9292ff9bd25467a014d6c2070805d163daa4c9 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 18 Nov 2015 09:03:00 +0000 +Subject: [PATCH] Use configure test for struct timespec + +Use the configure script to test for struct time spec instead of trying +to keep track of what platforms has it. + +Signed-off-by: Natanael Copa +--- + open-vm-tools/configure.ac | 1 + + open-vm-tools/lib/include/hgfsUtil.h | 8 +------- + 2 files changed, 2 insertions(+), 7 deletions(-) + +diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac +index 713ea683..48ff1ef3 100644 +--- a/open-vm-tools/configure.ac ++++ b/open-vm-tools/configure.ac +@@ -1208,6 +1208,7 @@ AC_TYPE_OFF_T + AC_TYPE_PID_T + AC_TYPE_SIZE_T + AC_CHECK_MEMBERS([struct stat.st_rdev]) ++AC_CHECK_MEMBERS([struct timespec.tv_sec],[],[],[[#include ]]) + AC_HEADER_TIME + AC_STRUCT_TM + AC_C_VOLATILE +diff --git a/open-vm-tools/lib/include/hgfsUtil.h b/open-vm-tools/lib/include/hgfsUtil.h +index 609f4c00..a3a022d4 100644 +--- a/open-vm-tools/lib/include/hgfsUtil.h ++++ b/open-vm-tools/lib/include/hgfsUtil.h +@@ -53,13 +53,7 @@ + # include + # endif + # include "vm_basic_types.h" +-# if !defined _STRUCT_TIMESPEC && \ +- !defined _TIMESPEC_DECLARED && \ +- !defined __timespec_defined && \ +- !defined sun && \ +- !defined __FreeBSD__ && \ +- !__APPLE__ && \ +- !defined _WIN32 ++# if !defined HAVE_STRUCT_TIMESPEC_TV_SEC + struct timespec { + time_t tv_sec; + long tv_nsec; diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0003-use-posix-strerror_r-unless-on-gnu-libc-system.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0003-use-posix-strerror_r-unless-on-gnu-libc-system.patch deleted file mode 100644 index c7d34c5cfa..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0003-use-posix-strerror_r-unless-on-gnu-libc-system.patch +++ /dev/null @@ -1,39 +0,0 @@ -From a2e7d9273261c5c5cbc33796900f415097f5455e Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 13 Jun 2018 23:16:53 -0700 -Subject: [PATCH] use posix strerror_r unless on gnu libc system - -Signed-off-by: Khem Raj ---- - open-vm-tools/lib/err/errPosix.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/lib/err/errPosix.c b/lib/err/errPosix.c -index c81b4c13..7a403640 100644 ---- a/lib/err/errPosix.c -+++ b/lib/err/errPosix.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - - #include "vmware.h" - #include "errInt.h" -@@ -63,11 +64,13 @@ ErrErrno2String(Err_Number errorNumber, // IN - { - char *p; - --#if defined(__linux__) && !defined(__ANDROID__) -+#if defined(__GLIBC__) && !defined(__ANDROID__) - p = strerror_r(errorNumber, buf, bufSize); - #else -- p = strerror(errorNumber); --#endif -+ if (strerror_r(errorNumber, buf, bufSize) != 0) -+ snprintf(buf, bufSize, "unknown error %i", errorNumber); -+ p = buf; -+#endif /* defined __GLIBC__ */ - ASSERT(p != NULL); - return p; - } diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch new file mode 100644 index 0000000000..e107ecf235 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch @@ -0,0 +1,58 @@ +From 5a795b234c617150915a607776c76377948870a6 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 18 Nov 2015 09:10:14 +0000 +Subject: [PATCH] Fix definition of ALLPERMS and ACCESSPERMS + +The ALLPERMS and ACCESSPERMS defines are not specified in POSIX so +assume it is not there instead of testing for specific implementations. + +This is needed for musl libc. + +Signed-off-by: Natanael Copa +--- + open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 8 +++++--- + open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | 3 +-- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +index f2b7ce67..0e6351a9 100644 +--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c ++++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +@@ -105,11 +105,13 @@ typedef struct DirectoryEntry { + #endif + + /* +- * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the +- * Solaris version of . ++ * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not specified in ++ * POSIX. + */ +-#ifdef sun ++#ifndef ACCESSPERMS + # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ++#endif ++#ifndef ALLPERMS + # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) + #endif + +diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c +index 89133652..7e9c3a91 100644 +--- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c ++++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c +@@ -52,7 +52,7 @@ + + #define DND_ROOTDIR_PERMS (S_IRWXU | S_IRWXG | S_IRWXO) + #define DND_STAGINGDIR_PERMS (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) +-#ifdef sun ++#ifndef ACCESSPERMS + #define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) + #endif + #ifdef __ANDROID__ +@@ -61,7 +61,6 @@ + */ + #define NO_SETMNTENT + #define NO_ENDMNTENT +-#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) + #endif + + diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0004-Use-uintmax_t-for-handling-rlim_t.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0004-Use-uintmax_t-for-handling-rlim_t.patch deleted file mode 100644 index e802dca4eb..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0004-Use-uintmax_t-for-handling-rlim_t.patch +++ /dev/null @@ -1,29 +0,0 @@ -From e694a122c1ff32d8b951ae55756796f9576d23ed Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 13 Jun 2018 23:37:09 -0700 -Subject: [PATCH] Use uintmax_t for handling rlim_t - -rlimit types are not representable with long or long long -formats, therefore use uintmax_t to typecast rlim_t types -and use %j to print it - -Signed-off-by: Khem Raj ---- - open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/hgfsServer/hgfsServerLinux.c b/lib/hgfsServer/hgfsServerLinux.c -index 2e73707d..a2fdb850 100644 ---- a/lib/hgfsServer/hgfsServerLinux.c -+++ b/lib/hgfsServer/hgfsServerLinux.c -@@ -5294,8 +5294,8 @@ HgfsWriteCheckIORange(off_t offset, // IN: - goto exit; - } - -- LOG(6, ("%s: File Size limits: 0x%"FMT64"x 0x%"FMT64"x\n", -- __FUNCTION__, fileSize.rlim_cur, fileSize.rlim_max)); -+ LOG(6, ("%s: File Size limits: 0x%jx 0x%jx\n", -+ __FUNCTION__, (uintmax_t)fileSize.rlim_cur, (uintmax_t)fileSize.rlim_max)); - - /* - * Check the offset is within the file size range. diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-test-for-struct-timespec.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-test-for-struct-timespec.patch deleted file mode 100644 index f02d00f841..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-test-for-struct-timespec.patch +++ /dev/null @@ -1,45 +0,0 @@ -From bf1eafb07297711baf9320b1edcca8a3376f117d Mon Sep 17 00:00:00 2001 -From: Natanael Copa -Date: Wed, 18 Nov 2015 09:03:00 +0000 -Subject: [PATCH 05/11] Use configure test for struct timespec - -Use the configure script to test for struct time spec instead of trying -to keep track of what platforms has it. - -Signed-off-by: Natanael Copa ---- - open-vm-tools/configure.ac | 1 + - open-vm-tools/lib/include/hgfsUtil.h | 8 +------- - 2 files changed, 2 insertions(+), 7 deletions(-) - -Index: open-vm-tools/configure.ac -=================================================================== ---- open-vm-tools.orig/configure.ac -+++ open-vm-tools/configure.ac -@@ -1127,6 +1127,7 @@ AC_TYPE_OFF_T - AC_TYPE_PID_T - AC_TYPE_SIZE_T - AC_CHECK_MEMBERS([struct stat.st_rdev]) -+AC_CHECK_MEMBERS([struct timespec.tv_sec],[],[],[[#include ]]) - AC_HEADER_TIME - AC_STRUCT_TM - AC_C_VOLATILE -Index: open-vm-tools/lib/include/hgfsUtil.h -=================================================================== ---- open-vm-tools.orig/lib/include/hgfsUtil.h -+++ open-vm-tools/lib/include/hgfsUtil.h -@@ -53,13 +53,7 @@ - # include - # endif - # include "vm_basic_types.h" --# if !defined _STRUCT_TIMESPEC && \ -- !defined _TIMESPEC_DECLARED && \ -- !defined __timespec_defined && \ -- !defined sun && \ -- !defined __FreeBSD__ && \ -- !__APPLE__ && \ -- !defined _WIN32 -+# if !defined HAVE_STRUCT_TIMESPEC_TV_SEC - struct timespec { - time_t tv_sec; - long tv_nsec; diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-to-test-for-feature-instead-of-platfor.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-to-test-for-feature-instead-of-platfor.patch new file mode 100644 index 0000000000..c6378b8086 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-to-test-for-feature-instead-of-platfor.patch @@ -0,0 +1,135 @@ +From 719d60978f979cf2e03771a9b8a62e36c92639f9 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 18 Nov 2015 10:05:07 +0000 +Subject: [PATCH] Use configure to test for feature instead of platform + +Test for various functions instead of trying to keep track of what +platform and what version of the given platform has support for what. + +This should make it easier to port to currently unknown platforms and +will solve the issue if a platform add support for a missing feature in +the future. + +The features we test for are: +- getifaddrs +- getauxval +- issetugid +- __secure_getenv + +This is needed for musl libc. + +Signed-off-by: Natanael Copa +--- + open-vm-tools/configure.ac | 4 ++++ + open-vm-tools/lib/misc/idLinux.c | 30 +++++++++++------------- + open-vm-tools/lib/nicInfo/nicInfoPosix.c | 6 ++++- + 3 files changed, 23 insertions(+), 17 deletions(-) + +diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac +index 48ff1ef3..71e684bb 100644 +--- a/open-vm-tools/configure.ac ++++ b/open-vm-tools/configure.ac +@@ -897,6 +897,7 @@ AC_CHECK_FUNCS( + + AC_CHECK_FUNCS([ecvt]) + AC_CHECK_FUNCS([fcvt]) ++AC_CHECK_FUNCS([getifaddrs getauxval issetugid __secure_getenv]) + + AC_CHECK_FUNC([mkdtemp], [have_mkdtemp=yes]) + +@@ -1145,10 +1146,13 @@ fi + ### + + AC_CHECK_HEADERS([crypt.h]) ++AC_CHECK_HEADERS([ifaddrs.h]) + AC_CHECK_HEADERS([inttypes.h]) + AC_CHECK_HEADERS([stdint.h]) + AC_CHECK_HEADERS([stdlib.h]) + AC_CHECK_HEADERS([wchar.h]) ++AC_CHECK_HEADERS([net/if.h]) ++AC_CHECK_HEADERS([sys/auxv.h]) + AC_CHECK_HEADERS([sys/inttypes.h]) + AC_CHECK_HEADERS([sys/io.h]) + AC_CHECK_HEADERS([sys/param.h]) # Required to make the sys/user.h check work correctly on FreeBSD +diff --git a/open-vm-tools/lib/misc/idLinux.c b/open-vm-tools/lib/misc/idLinux.c +index b950cf84..1dcfb508 100644 +--- a/open-vm-tools/lib/misc/idLinux.c ++++ b/open-vm-tools/lib/misc/idLinux.c +@@ -27,12 +27,9 @@ + #include + #include + #include +-#ifdef __linux__ +-#if defined(__GLIBC__) && \ +- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) ++#ifdef HAVE_SYS_AUXV_H + #include + #endif +-#endif + #ifdef __APPLE__ + #include + #include +@@ -997,31 +994,32 @@ Id_EndSuperUser(uid_t uid) // IN: + static Bool + IdIsSetUGid(void) + { +-#if defined(__ANDROID__) +- /* Android does not have a secure_getenv, so be conservative. */ +- return TRUE; +-#else + /* + * We use __secure_getenv, which returns NULL if the binary is +- * setuid or setgid. Alternatives include, ++ * setuid or setgid, when issetugid or getauxval(AT_SECURE) is not ++ * available. Alternatives include, + * +- * a) getauxval(AT_SECURE); not available until glibc 2.16. +- * b) __libc_enable_secure; may not be exported. ++ * a) issetugid(); not (yet?) available in glibc. ++ * b) getauxval(AT_SECURE); not available until glibc 2.16. ++ * c) __libc_enable_secure; may not be exported. + * +- * Use (a) when we are based on glibc 2.16, or newer. ++ * Use (b) when we are based on glibc 2.16, or newer. + */ + +-#if defined(__GLIBC__) && \ +- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) ++#if HAVE_ISSETUGID ++ return issetugid(); ++#elif HAVE_GETAUXVAL + return getauxval(AT_SECURE) != 0; +-#else ++#elif HAVE___SECURE_GETENV + static const char envName[] = "VMW_SETUGID_TEST"; + + if (setenv(envName, "1", TRUE) == -1) { + return TRUE; /* Conservative */ + } + return __secure_getenv(envName) == NULL; +-#endif ++#else ++ /* Android does not have a secure_getenv, so be conservative. */ ++ return TRUE; + #endif + } + #endif +diff --git a/open-vm-tools/lib/nicInfo/nicInfoPosix.c b/open-vm-tools/lib/nicInfo/nicInfoPosix.c +index a22981d5..b4e08681 100644 +--- a/open-vm-tools/lib/nicInfo/nicInfoPosix.c ++++ b/open-vm-tools/lib/nicInfo/nicInfoPosix.c +@@ -34,9 +34,13 @@ + #include + #include + #include +-#if defined(__FreeBSD__) || defined(__APPLE__) ++#if HAVE_SYS_SYSCTL_H + # include ++#endif ++#if HAVE_IFADDRS_H + # include ++#endif ++#if HAVE_NET_IF_H + # include + #endif + #ifndef NO_DNET diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch deleted file mode 100644 index d1f4eff9be..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 31ae6f42458f90d4994a4ad8e2b7673691612c36 Mon Sep 17 00:00:00 2001 -From: Natanael Copa -Date: Wed, 18 Nov 2015 09:10:14 +0000 -Subject: [PATCH 06/11] Fix definition of ALLPERMS and ACCESSPERMS - -The ALLPERMS and ACCESSPERMS defines are not specified in POSIX so -assume it is not there instead of testing for specific implementations. - -This is needed for musl libc. - -Signed-off-by: Natanael Copa ---- - open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 8 +++++--- - open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | 3 +-- - 2 files changed, 6 insertions(+), 5 deletions(-) - -Index: open-vm-tools/lib/hgfsServer/hgfsServerLinux.c -=================================================================== ---- open-vm-tools.orig/lib/hgfsServer/hgfsServerLinux.c -+++ open-vm-tools/lib/hgfsServer/hgfsServerLinux.c -@@ -107,11 +107,13 @@ typedef struct DirectoryEntry { - #endif - - /* -- * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the -- * Solaris version of . -+ * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not specified in -+ * POSIX. - */ --#ifdef sun -+#ifndef ACCESSPERMS - # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) -+#endif -+#ifndef ALLPERMS - # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) - #endif - -Index: open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c -=================================================================== ---- open-vm-tools.orig/services/plugins/dndcp/dnd/dndLinux.c -+++ open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c -@@ -51,7 +51,7 @@ - - #define DND_ROOTDIR_PERMS (S_IRWXU | S_IRWXG | S_IRWXO) - #define DND_STAGINGDIR_PERMS (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) --#ifdef sun -+#ifndef ACCESSPERMS - #define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) - #endif - #ifdef __ANDROID__ -@@ -60,7 +60,6 @@ - */ - #define NO_SETMNTENT - #define NO_ENDMNTENT --#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) - #endif - - diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Use-configure-test-for-sys-stat.h-include.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Use-configure-test-for-sys-stat.h-include.patch new file mode 100644 index 0000000000..9a227f9ec7 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Use-configure-test-for-sys-stat.h-include.patch @@ -0,0 +1,25 @@ +From 11adcf43a1e7aa39ee4d82fa567f37e5b0c6ca81 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 18 Nov 2015 10:41:01 +0000 +Subject: [PATCH] Use configure test for sys/stat.h include + +This is needed for musl libc. + +Signed-off-by: Natanael Copa +--- + open-vm-tools/services/plugins/vix/vixTools.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c +index e5273786..cabc4137 100644 +--- a/open-vm-tools/services/plugins/vix/vixTools.c ++++ b/open-vm-tools/services/plugins/vix/vixTools.c +@@ -66,7 +66,7 @@ + #include + #endif + +-#if defined(sun) || defined(__FreeBSD__) || defined(__APPLE__) ++#ifdef HAVE_SYS_STAT_H + #include + #endif + diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0007-Fix-subdir-objects-configure-error.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0007-Fix-subdir-objects-configure-error.patch new file mode 100644 index 0000000000..11be2d4a07 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0007-Fix-subdir-objects-configure-error.patch @@ -0,0 +1,24 @@ +From cf1284fda8fb22a2b27cb2ce7962f166166e74c3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 13 Jun 2018 23:48:04 -0700 +Subject: [PATCH] Fix subdir objects configure error + +Fix build on musl while here + +Signed-off-by: Khem Raj +--- + open-vm-tools/configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac +index 71e684bb..b76a7966 100644 +--- a/open-vm-tools/configure.ac ++++ b/open-vm-tools/configure.ac +@@ -303,6 +303,7 @@ AC_ARG_ENABLE( + [], + [enable_resolutionkms="auto"]) + ++AM_INIT_AUTOMAKE([subdir-objects]) + AM_INIT_AUTOMAKE + + ### diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0007-Use-configure-to-test-for-feature-instead-of-platfor.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0007-Use-configure-to-test-for-feature-instead-of-platfor.patch deleted file mode 100644 index ad19fb24b9..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0007-Use-configure-to-test-for-feature-instead-of-platfor.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 6cc1c22cc30320f56da552a76bd956db8f255b6a Mon Sep 17 00:00:00 2001 -From: Natanael Copa -Date: Wed, 18 Nov 2015 10:05:07 +0000 -Subject: [PATCH 07/11] Use configure to test for feature instead of platform - -Test for various functions instead of trying to keep track of what -platform and what version of the given platform has support for what. - -This should make it easier to port to currently unknown platforms and -will solve the issue if a platform add support for a missing feature in -the future. - -The features we test for are: -- getifaddrs -- getauxval -- issetugid -- __secure_getenv - -This is needed for musl libc. - -Signed-off-by: Natanael Copa ---- - open-vm-tools/configure.ac | 4 ++++ - open-vm-tools/lib/misc/idLinux.c | 30 ++++++++++++++---------------- - open-vm-tools/lib/nicInfo/nicInfoPosix.c | 8 ++++++-- - 3 files changed, 24 insertions(+), 18 deletions(-) - -Index: open-vm-tools/configure.ac -=================================================================== ---- open-vm-tools.orig/configure.ac -+++ open-vm-tools/configure.ac -@@ -892,6 +892,7 @@ AC_CHECK_FUNCS( - - AC_CHECK_FUNCS([ecvt]) - AC_CHECK_FUNCS([fcvt]) -+AC_CHECK_FUNCS([getifaddrs getauxval issetugid __secure_getenv]) - - AC_CHECK_FUNC([mkdtemp], [have_mkdtemp=yes]) - -@@ -1076,10 +1077,13 @@ AC_PATH_PROG( - ### - - AC_CHECK_HEADERS([crypt.h]) -+AC_CHECK_HEADERS([ifaddrs.h]) - AC_CHECK_HEADERS([inttypes.h]) - AC_CHECK_HEADERS([stdint.h]) - AC_CHECK_HEADERS([stdlib.h]) - AC_CHECK_HEADERS([wchar.h]) -+AC_CHECK_HEADERS([net/if.h]) -+AC_CHECK_HEADERS([sys/auxv.h]) - AC_CHECK_HEADERS([sys/inttypes.h]) - AC_CHECK_HEADERS([sys/io.h]) - AC_CHECK_HEADERS([sys/param.h]) # Required to make the sys/user.h check work correctly on FreeBSD -Index: open-vm-tools/lib/misc/idLinux.c -=================================================================== ---- open-vm-tools.orig/lib/misc/idLinux.c -+++ open-vm-tools/lib/misc/idLinux.c -@@ -27,12 +27,9 @@ - #include - #include - #include --#ifdef __linux__ --#if defined(__GLIBC__) && \ -- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) -+#ifdef HAVE_SYS_AUXV_H - #include - #endif --#endif - #ifdef __APPLE__ - #include - #include -@@ -997,31 +994,32 @@ Id_EndSuperUser(uid_t uid) // IN: - static Bool - IdIsSetUGid(void) - { --#if defined(__ANDROID__) -- /* Android does not have a secure_getenv, so be conservative. */ -- return TRUE; --#else - /* - * We use __secure_getenv, which returns NULL if the binary is -- * setuid or setgid. Alternatives include, -+ * setuid or setgid, when issetugid or getauxval(AT_SECURE) is not -+ * available. Alternatives include, - * -- * a) getauxval(AT_SECURE); not available until glibc 2.16. -- * b) __libc_enable_secure; may not be exported. -+ * a) issetugid(); not (yet?) available in glibc. -+ * b) getauxval(AT_SECURE); not available until glibc 2.16. -+ * c) __libc_enable_secure; may not be exported. - * -- * Use (a) when we are based on glibc 2.16, or newer. -+ * Use (b) when we are based on glibc 2.16, or newer. - */ - --#if defined(__GLIBC__) && \ -- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) -+#if HAVE_ISSETUGID -+ return issetugid(); -+#elif HAVE_GETAUXVAL - return getauxval(AT_SECURE) != 0; --#else -+#elif HAVE___SECURE_GETENV - static const char envName[] = "VMW_SETUGID_TEST"; - - if (setenv(envName, "1", TRUE) == -1) { - return TRUE; /* Conservative */ - } - return __secure_getenv(envName) == NULL; --#endif -+#else -+ /* Android does not have a secure_getenv, so be conservative. */ -+ return TRUE; - #endif - } - #endif -Index: open-vm-tools/lib/nicInfo/nicInfoPosix.c -=================================================================== ---- open-vm-tools.orig/lib/nicInfo/nicInfoPosix.c -+++ open-vm-tools/lib/nicInfo/nicInfoPosix.c -@@ -34,9 +34,13 @@ - #include - #include - #include --#if defined(__FreeBSD__) || defined(__APPLE__) -+#if HAVE_SYS_SYSCTL_H - # include -+#endif -+#if HAVE_IFADDRS_H - # include -+#endif -+#if HAVE_NET_IF_H - # include - #endif - #ifndef NO_DNET diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0008-include-poll.h-instead-of-sys-poll.h.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0008-include-poll.h-instead-of-sys-poll.h.patch new file mode 100644 index 0000000000..814b9e3b25 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0008-include-poll.h-instead-of-sys-poll.h.patch @@ -0,0 +1,26 @@ +From e4f0b99d90e26b15106f634caad1c3dea9e09cb8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 13 Jun 2018 23:02:50 -0700 +Subject: [PATCH] include poll.h instead of sys/poll.h + +including sys/poll.h is deprecated + +Signed-off-by: Khem Raj +--- + open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c +index 65b07109..b41aa29d 100644 +--- a/open-vm-tools/lib/asyncsocket/asyncsocket.c ++++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c +@@ -69,8 +69,8 @@ + #else + #include + #include ++#include + #include +-#include + #include + #include + #include diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0009-Rename-poll.h-to-vm_poll.h.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0009-Rename-poll.h-to-vm_poll.h.patch new file mode 100644 index 0000000000..5c1aa7c40f --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0009-Rename-poll.h-to-vm_poll.h.patch @@ -0,0 +1,115 @@ +From 8793466326dd10b0d2dbb83c64beff5cc8c0fc7d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 13 Jun 2018 23:11:58 -0700 +Subject: [PATCH] Rename poll.h to vm_poll.h + +musl libc's system headers pulls in open-vm-tools' poll.h. To avoid this +we rename poll.h to vm_poll.h. + +Signed-off-by: Natanael Copa +Signed-off-by: Khem Raj +--- + open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- + open-vm-tools/lib/hgfsServer/hgfsServer.c | 2 +- + open-vm-tools/lib/include/asyncsocket.h | 2 +- + open-vm-tools/lib/include/pollImpl.h | 2 +- + open-vm-tools/lib/include/{poll.h => vm_poll.h} | 2 +- + open-vm-tools/lib/rpcIn/rpcin.c | 2 +- + .../services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + rename open-vm-tools/lib/include/{poll.h => vm_poll.h} (99%) + +diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c +index b41aa29d..8691309d 100644 +--- a/open-vm-tools/lib/asyncsocket/asyncsocket.c ++++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c +@@ -86,7 +86,7 @@ + #include "random.h" + #include "asyncsocket.h" + #include "asyncSocketBase.h" +-#include "poll.h" ++#include "vm_poll.h" + #include "log.h" + #include "err.h" + #include "hostinfo.h" +diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c +index 7ea3b7f4..740c4fed 100644 +--- a/open-vm-tools/lib/hgfsServer/hgfsServer.c ++++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c +@@ -48,7 +48,7 @@ + #include "hgfsServerOplock.h" + #include "hgfsDirNotify.h" + #include "userlock.h" +-#include "poll.h" ++#include "vm_poll.h" + #include "mutexRankLib.h" + #include "vm_basic_asm.h" + #include "unicodeOperations.h" +diff --git a/open-vm-tools/lib/include/asyncsocket.h b/open-vm-tools/lib/include/asyncsocket.h +index ec9b45aa..dc91e738 100644 +--- a/open-vm-tools/lib/include/asyncsocket.h ++++ b/open-vm-tools/lib/include/asyncsocket.h +@@ -164,7 +164,7 @@ typedef struct AsyncSocket AsyncSocket; + * Or the client can specify its favorite poll class and locking behavior. + * Use of IVmdbPoll is only supported for regular sockets and for Attach. + */ +-#include "poll.h" ++#include "vm_poll.h" + struct IVmdbPoll; + typedef struct AsyncSocketPollParams { + int flags; /* Default 0, only POLL_FLAG_NO_BULL is valid */ +diff --git a/open-vm-tools/lib/include/pollImpl.h b/open-vm-tools/lib/include/pollImpl.h +index 46442e55..8bc66997 100644 +--- a/open-vm-tools/lib/include/pollImpl.h ++++ b/open-vm-tools/lib/include/pollImpl.h +@@ -44,7 +44,7 @@ + #define INCLUDE_ALLOW_USERLEVEL + #include "includeCheck.h" + +-#include "poll.h" ++#include "vm_poll.h" + #include "vm_basic_asm.h" + + #if defined(__cplusplus) +diff --git a/open-vm-tools/lib/include/poll.h b/open-vm-tools/lib/include/vm_poll.h +similarity index 99% +rename from open-vm-tools/lib/include/poll.h +rename to open-vm-tools/lib/include/vm_poll.h +index 6acd4f35..fbc88494 100644 +--- a/open-vm-tools/lib/include/poll.h ++++ b/open-vm-tools/lib/include/vm_poll.h +@@ -60,7 +60,7 @@ extern "C" { + #if !defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE == 0 + #include + #endif +-#include ++#include + #define HZ 100 + #endif + #ifdef __ANDROID__ +diff --git a/open-vm-tools/lib/rpcIn/rpcin.c b/open-vm-tools/lib/rpcIn/rpcin.c +index 8eea7d86..c48f5be2 100644 +--- a/open-vm-tools/lib/rpcIn/rpcin.c ++++ b/open-vm-tools/lib/rpcIn/rpcin.c +@@ -57,7 +57,7 @@ + + #if defined(VMTOOLS_USE_VSOCKET) + # include +-# include "poll.h" ++# include "vm_poll.h" + # include "asyncsocket.h" + # include "vmci_defs.h" + #include "dataMap.h" +diff --git a/open-vm-tools/services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c b/open-vm-tools/services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c +index 03700937..f0b49ad7 100644 +--- a/open-vm-tools/services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c ++++ b/open-vm-tools/services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c +@@ -48,7 +48,7 @@ + #include "rpcout.h" + #include "rabbitmqProxyConst.h" + #include "vm_basic_types.h" +-#include "poll.h" ++#include "vm_poll.h" + #ifdef OPEN_VM_TOOLS + #include "vmci_sockets.h" + #include "sslDirect.h" diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch new file mode 100644 index 0000000000..784b4fc6c5 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch @@ -0,0 +1,39 @@ +From e86a259e1ce19c70ecfdece69ab53a07c63a34e1 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 13 Jun 2018 23:16:53 -0700 +Subject: [PATCH] use posix strerror_r unless on gnu libc system + +Signed-off-by: Khem Raj +--- + open-vm-tools/lib/err/errPosix.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/open-vm-tools/lib/err/errPosix.c b/open-vm-tools/lib/err/errPosix.c +index c81b4c13..7a403640 100644 +--- a/open-vm-tools/lib/err/errPosix.c ++++ b/open-vm-tools/lib/err/errPosix.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + #include "vmware.h" + #include "errInt.h" +@@ -63,11 +64,13 @@ ErrErrno2String(Err_Number errorNumber, // IN + { + char *p; + +-#if defined(__linux__) && !defined(__ANDROID__) ++#if defined(__GLIBC__) && !defined(__ANDROID__) + p = strerror_r(errorNumber, buf, bufSize); + #else +- p = strerror(errorNumber); +-#endif ++ if (strerror_r(errorNumber, buf, bufSize) != 0) ++ snprintf(buf, bufSize, "unknown error %i", errorNumber); ++ p = buf; ++#endif /* defined __GLIBC__ */ + ASSERT(p != NULL); + return p; + } diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0011-Use-configure-test-for-sys-stat.h-include.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0011-Use-configure-test-for-sys-stat.h-include.patch deleted file mode 100644 index 78722390e8..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0011-Use-configure-test-for-sys-stat.h-include.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 95c6184d9ff70a47c41768850923a96de9e544aa Mon Sep 17 00:00:00 2001 -From: Natanael Copa -Date: Wed, 18 Nov 2015 10:41:01 +0000 -Subject: [PATCH 11/11] Use configure test for sys/stat.h include - -This is needed for musl libc. - -Signed-off-by: Natanael Copa ---- - open-vm-tools/services/plugins/vix/vixTools.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: open-vm-tools/services/plugins/vix/vixTools.c -=================================================================== ---- open-vm-tools.orig/services/plugins/vix/vixTools.c -+++ open-vm-tools/services/plugins/vix/vixTools.c -@@ -66,7 +66,7 @@ - #include - #endif - --#if defined(sun) || defined(__FreeBSD__) || defined(__APPLE__) -+#ifdef HAVE_SYS_STAT_H - #include - #endif - diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0011-Use-uintmax_t-for-handling-rlim_t.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0011-Use-uintmax_t-for-handling-rlim_t.patch new file mode 100644 index 0000000000..0a1d008733 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0011-Use-uintmax_t-for-handling-rlim_t.patch @@ -0,0 +1,29 @@ +From 18eea61a7a768c6c3b57c6683c7bef7049f0f6ab Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 13 Jun 2018 23:37:09 -0700 +Subject: [PATCH] Use uintmax_t for handling rlim_t + +rlimit types are not representable with long or long long +formats, therefore use uintmax_t to typecast rlim_t types +and use %j to print it + +Signed-off-by: Khem Raj +--- + open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +index 0e6351a9..a2ee1740 100644 +--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c ++++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +@@ -5294,8 +5294,8 @@ HgfsWriteCheckIORange(off_t offset, // IN: + goto exit; + } + +- LOG(6, ("%s: File Size limits: 0x%"FMT64"x 0x%"FMT64"x\n", +- __FUNCTION__, fileSize.rlim_cur, fileSize.rlim_max)); ++ LOG(6, ("%s: File Size limits: 0x%jx 0x%jx\n", ++ __FUNCTION__, (uintmax_t)fileSize.rlim_cur, (uintmax_t)fileSize.rlim_max)); + + /* + * Check the offset is within the file size range. diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0012-Use-off64_t-instead-of-__off64_t.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0012-Use-off64_t-instead-of-__off64_t.patch new file mode 100644 index 0000000000..d69b74e23a --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0012-Use-off64_t-instead-of-__off64_t.patch @@ -0,0 +1,31 @@ +From 123c690f12f560022305b0cf19499e7f81a690ae Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 27 Aug 2018 23:22:21 -0700 +Subject: [PATCH] Use off64_t instead of __off64_t + +Fixes +unknown type name '__off64_t' + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + open-vm-tools/lib/file/fileIOPosix.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c +index 23108279..bcd2ddc5 100644 +--- a/open-vm-tools/lib/file/fileIOPosix.c ++++ b/open-vm-tools/lib/file/fileIOPosix.c +@@ -206,10 +206,10 @@ static AlignedPool alignedPool; + * the symbols (and anyone building XOPEN<700 gets nothing). + */ + extern ssize_t preadv64(int fd, const struct iovec *iov, int iovcnt, +- __off64_t offset) __attribute__ ((weak)); ++ off64_t offset) __attribute__ ((weak)); + + extern ssize_t pwritev64(int fd, const struct iovec *iov, int iovcnt, +- __off64_t offset) __attribute__ ((weak)); ++ off64_t offset) __attribute__ ((weak)); + #else + #error "Large file support unavailable. Aborting." + #endif diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0013-misc-Do-not-print-NULL-string-into-logs.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0013-misc-Do-not-print-NULL-string-into-logs.patch new file mode 100644 index 0000000000..88f4f694c9 --- /dev/null +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0013-misc-Do-not-print-NULL-string-into-logs.patch @@ -0,0 +1,31 @@ +From cfc6839362bd96bf2f42954160f16a60bf1de377 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 22 Dec 2018 19:59:02 -0800 +Subject: [PATCH] misc: Do not print NULL string into logs + +string format %s is getting a NULL pointer for 'expand' +parameter always since the check for chunks[i] == NULL will ensure that +its always null when the Log() API is called + +Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/312] + +Signed-off-by: Khem Raj +--- + open-vm-tools/lib/misc/util_misc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/open-vm-tools/lib/misc/util_misc.c b/open-vm-tools/lib/misc/util_misc.c +index 198c23d2..0ac0a335 100644 +--- a/open-vm-tools/lib/misc/util_misc.c ++++ b/open-vm-tools/lib/misc/util_misc.c +@@ -719,8 +719,8 @@ Util_ExpandString(const char *fileName) // IN file path to expand + ASSERT(!freeChunk[i]); + chunks[i] = expand; + if (chunks[i] == NULL) { +- Log("%s: Cannot allocate memory to expand \"%s\" in \"%s\".\n", +- __FUNCTION__, expand, fileName); ++ Log("%s: Cannot allocate memory to expand in \"%s\".\n", ++ __FUNCTION__, fileName); + goto out; + } + chunkSize[i] = strlen(expand); diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/fix-subdir-objects-configure-error.patch b/meta-oe/recipes-support/open-vm-tools/open-vm-tools/fix-subdir-objects-configure-error.patch deleted file mode 100644 index 1a6bfdb09b..0000000000 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools/fix-subdir-objects-configure-error.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: open-vm-tools/configure.ac -=================================================================== ---- open-vm-tools.orig/configure.ac -+++ open-vm-tools/configure.ac -@@ -303,6 +303,7 @@ AC_ARG_ENABLE( - [], - [enable_resolutionkms="auto"]) - -+AM_INIT_AUTOMAKE([subdir-objects]) - AM_INIT_AUTOMAKE - - ### diff --git a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.3.5.bb b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.3.5.bb index 7ed6593727..cea18c6c4e 100644 --- a/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.3.5.bb +++ b/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.3.5.bb @@ -22,23 +22,23 @@ LICENSE_modules/linux = "GPL-2.0" LICENSE_modules/solaris = "CDDL-1.0" SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \ - file://tools.conf \ - file://vmtoolsd.service \ - file://vmtoolsd.init \ - file://0001-configure.ac-don-t-use-dnet-config.patch \ - file://0002-add-include-sys-sysmacros.h.patch \ - file://0005-Use-configure-test-for-struct-timespec.patch \ - file://0006-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch \ - file://0007-Use-configure-to-test-for-feature-instead-of-platfor.patch \ - file://0011-Use-configure-test-for-sys-stat.h-include.patch \ - file://fix-subdir-objects-configure-error.patch \ - file://0001-include-poll.h-instead-of-sys-poll.h.patch \ - file://0002-Rename-poll.h-to-vm_poll.h.patch \ - file://0003-use-posix-strerror_r-unless-on-gnu-libc-system.patch \ - file://0004-Use-uintmax_t-for-handling-rlim_t.patch \ - file://0001-Use-off64_t-instead-of-__off64_t.patch \ - file://0001-misc-Do-not-print-NULL-string-into-logs.patch \ - " + file://tools.conf \ + file://vmtoolsd.service \ + file://vmtoolsd.init \ + file://0001-configure.ac-don-t-use-dnet-config.patch;patchdir=.. \ + file://0002-add-include-sys-sysmacros.h.patch;patchdir=.. \ + file://0003-Use-configure-test-for-struct-timespec.patch;patchdir=.. \ + file://0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch;patchdir=.. \ + file://0005-Use-configure-to-test-for-feature-instead-of-platfor.patch;patchdir=.. \ + file://0006-Use-configure-test-for-sys-stat.h-include.patch;patchdir=.. \ + file://0007-Fix-subdir-objects-configure-error.patch;patchdir=.. \ + file://0008-include-poll.h-instead-of-sys-poll.h.patch;patchdir=.. \ + file://0009-Rename-poll.h-to-vm_poll.h.patch;patchdir=.. \ + file://0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch;patchdir=.. \ + file://0011-Use-uintmax_t-for-handling-rlim_t.patch;patchdir=.. \ + file://0012-Use-off64_t-instead-of-__off64_t.patch;patchdir=.. \ + file://0013-misc-Do-not-print-NULL-string-into-logs.patch;patchdir=.. \ +" # stable-10.3.5 SRCREV = "f2ff192717375b95a6b7e278fb47dbb3d3bc56d1" -- cgit 1.2.3-korg