From 2b929e12a1bcb28783ed42e877ca0506dee3828a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 5 Nov 2015 13:19:20 +0000 Subject: [PATCH 01/10] open-vm-tools: Add --disable-werror configure option Packagers will normally not want the -Werror compile option as it may break compilation depending on the platform specific warnings. Signed-off-by: Natanael Copa --- open-vm-tools/configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index 112fc3b3c..0257a793f 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -1451,7 +1451,17 @@ AC_C_VOLATILE ### General flags / actions CFLAGS="$CFLAGS -Wall" -CFLAGS="$CFLAGS -Werror" +AC_ARG_ENABLE( + werror, + AS_HELP_STRING( + [--disable-werror], + [disable compilation with -Werror]), + [enable_werror="$enableval"], + [enable_werror="yes"]) + +if test "$enable_werror" = "yes"; then + CFLAGS="$CFLAGS -Werror" +fi # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' # in Xlib.h on OpenSolaris. From 9f803b764b3d2c531aed1785fc04ae3722da458a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 17 Nov 2015 10:39:01 +0000 Subject: [PATCH 02/10] Do not assume that linux and gnu libc are the same thing Use __GLIBC__ when testing for GNU libc specific things instead of assuming that __linux__ is GNU libc. This is needed for building with musl libc. Signed-off-by: Natanael Copa --- open-vm-tools/lib/file/fileIOPosix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c index 82c0aa18e..47dc41379 100644 --- a/open-vm-tools/lib/file/fileIOPosix.c +++ b/open-vm-tools/lib/file/fileIOPosix.c @@ -198,7 +198,7 @@ static AlignedPool alignedPool; * are not available in any header file. */ -#if defined(__linux__) && !defined(__ANDROID__) +#if defined(__linux__) && defined(__GLIBC__) #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) /* * We want preadv/pwritev. But due to FOB=64, the symbols are -64. From 987bb79c723077d59cecd15a77731d76487585df Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 18 Nov 2015 09:03:00 +0000 Subject: [PATCH 03/10] 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 0257a793f..c9c65388c 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -1441,6 +1441,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 609f4c000..a3a022d42 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; From 15bc74f9a7db68d8e1c4fac1c5611a968f03836e Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 18 Nov 2015 09:10:14 +0000 Subject: [PATCH 04/10] 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 63c4e65f0..87d419a7b 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 219065f74..b5b7e6203 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c @@ -53,7 +53,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__ @@ -62,7 +62,6 @@ */ #define NO_SETMNTENT #define NO_ENDMNTENT -#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) #endif From 2716db7508088dfd29b07bc1f9a44f264516d65b Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 18 Nov 2015 10:05:07 +0000 Subject: [PATCH 05/10] 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 | 11 +++++---- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index c9c65388c..19fee1072 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -1169,6 +1169,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]) @@ -1378,10 +1379,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 1bb86f483..41c670cfc 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 @@ -1025,31 +1022,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 de57a4a90..7a132eee7 100644 --- a/open-vm-tools/lib/nicInfo/nicInfoPosix.c +++ b/open-vm-tools/lib/nicInfo/nicInfoPosix.c @@ -35,9 +35,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 @@ -499,10 +503,7 @@ GuestInfoGetNicInfo(unsigned int maxIPv4Routes, * ****************************************************************************** */ -#if defined(__FreeBSD__) || \ - defined(__APPLE__) || \ - defined(USERWORLD) || \ - (defined(__linux__) && defined(NO_DNET)) +#if defined(NO_DNET) && defined(HAVE_GETIFADDRS) char * GuestInfoGetPrimaryIP(void) From 1a7c99f1307237754df6623e408075bd66d8dc3d Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 18 Nov 2015 10:41:01 +0000 Subject: [PATCH 06/10] 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 103ed10dc..bde740218 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 From aba7842f4ada2d33f31e884ec0bed8a01696ace4 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 17 Nov 2015 10:57:31 +0000 Subject: [PATCH 07/10] 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 --- 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} | 0 open-vm-tools/lib/rpcIn/rpcin.c | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename open-vm-tools/lib/include/{poll.h => vm_poll.h} (100%) diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c index efddf99b3..13286d058 100644 --- a/open-vm-tools/lib/asyncsocket/asyncsocket.c +++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c @@ -87,7 +87,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 98f5b3f06..b436f0c7e 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -51,7 +51,7 @@ #include "hgfsDirNotify.h" #include "hgfsThreadpool.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 16f9fbb00..95bc39f1f 100644 --- a/open-vm-tools/lib/include/asyncsocket.h +++ b/open-vm-tools/lib/include/asyncsocket.h @@ -171,7 +171,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 46442e556..8bc669970 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 100% rename from open-vm-tools/lib/include/poll.h rename to open-vm-tools/lib/include/vm_poll.h diff --git a/open-vm-tools/lib/rpcIn/rpcin.c b/open-vm-tools/lib/rpcIn/rpcin.c index 8b1fe759d..f22fcd402 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" From 2cf5333b70ba351c28f3163190eecedcb465c244 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 2 Jan 2017 14:39:27 +0000 Subject: [PATCH 08/10] use posix strerror_r unless gnu --- open-vm-tools/lib/err/errPosix.c | 8 +++++--- open-vm-tools/vgauth/common/VGAuthLog.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/open-vm-tools/lib/err/errPosix.c b/open-vm-tools/lib/err/errPosix.c index c81b4c13f..a34e81904 100644 --- a/open-vm-tools/lib/err/errPosix.c +++ b/open-vm-tools/lib/err/errPosix.c @@ -63,11 +63,13 @@ ErrErrno2String(Err_Number errorNumber, // IN { char *p; -#if defined(__linux__) && !defined(__ANDROID__) +#if defined(__GLIBC__) 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/open-vm-tools/vgauth/common/VGAuthLog.c b/open-vm-tools/vgauth/common/VGAuthLog.c index fb4261efc..1b29536ee 100644 --- a/open-vm-tools/vgauth/common/VGAuthLog.c +++ b/open-vm-tools/vgauth/common/VGAuthLog.c @@ -210,7 +210,7 @@ LogErrorPosixCodeV(int code, g_vsnprintf(buf, sizeof buf, fmt, args); buf[sizeof buf - 1] = '\0'; -#ifdef sun +#if !defined(__GLIBC__) strerror_r(code, errMsg, sizeof errMsg); g_warning("[function %s, file %s, line %d], %s, [errno = %d], %s\n", func, file, line, buf, code, errMsg); From cf21ccdef4fe5e749fc10403afc3d9340a6d10dd Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 2 Jan 2017 15:25:32 +0000 Subject: [PATCH 09/10] use off64_t instead of loff_t --- open-vm-tools/vmhgfs-fuse/file.c | 12 ++++++------ open-vm-tools/vmhgfs-fuse/fsutil.c | 2 +- open-vm-tools/vmhgfs-fuse/fsutil.h | 8 ++------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/open-vm-tools/vmhgfs-fuse/file.c b/open-vm-tools/vmhgfs-fuse/file.c index e56d621db..43259cf6f 100644 --- a/open-vm-tools/vmhgfs-fuse/file.c +++ b/open-vm-tools/vmhgfs-fuse/file.c @@ -547,7 +547,7 @@ static int HgfsDoRead(HgfsHandle handle, // IN: Handle for this file char *buf, // OUT: Buffer to copy data into size_t count, // IN: Number of bytes to read - loff_t offset) // IN: Offset at which to read + off64_t offset) // IN: Offset at which to read { HgfsReq *req; HgfsOp opUsed; @@ -708,11 +708,11 @@ ssize_t HgfsRead(struct fuse_file_info *fi, // IN: File info struct char *buf, // OUT: User buffer to copy data into size_t count, // IN: Number of bytes to read - loff_t offset) // IN: Offset at which to read + off64_t offset) // IN: Offset at which to read { int result = 0; char *buffer = buf; - loff_t curOffset = offset; + off64_t curOffset = offset; size_t nextCount, remainingCount = count; uint32 maxIOSize = HgfsMaxIOSize(); @@ -769,7 +769,7 @@ static int HgfsDoWrite(HgfsHandle handle, // IN: Handle for the file const char *buf, // IN: Buffer containing data size_t count, // IN: Number of bytes to write - loff_t offset) // IN: Offset to begin writing at + off64_t offset) // IN: Offset to begin writing at { HgfsReq *req; int result = 0; @@ -893,11 +893,11 @@ ssize_t HgfsWrite(struct fuse_file_info *fi, // IN: File info structure const char *buf, // OUT: User buffer to copy data into size_t count, // IN: Number of bytes to read - loff_t offset) // IN: Offset at which to read + off64_t offset) // IN: Offset at which to read { int result; const char *buffer = buf; - loff_t curOffset = offset; + off64_t curOffset = offset; size_t nextCount, remainingCount = count; ssize_t bytesWritten = 0; uint32 maxIOSize = HgfsMaxIOSize(); diff --git a/open-vm-tools/vmhgfs-fuse/fsutil.c b/open-vm-tools/vmhgfs-fuse/fsutil.c index fe4e4e83a..ccc755d75 100644 --- a/open-vm-tools/vmhgfs-fuse/fsutil.c +++ b/open-vm-tools/vmhgfs-fuse/fsutil.c @@ -694,7 +694,7 @@ HgfsStatusConvertToLinux(HgfsStatus hgfsStatus) // IN: Status code to convert unsigned long HgfsCalcBlockSize(uint64 tsize) { - loff_t used = (tsize + 511) >> 9; + off64_t used = (tsize + 511) >> 9; return (used > ULONG_MAX) ? ULONG_MAX : used; } diff --git a/open-vm-tools/vmhgfs-fuse/fsutil.h b/open-vm-tools/vmhgfs-fuse/fsutil.h index 34b6d489a..a75cff82f 100644 --- a/open-vm-tools/vmhgfs-fuse/fsutil.h +++ b/open-vm-tools/vmhgfs-fuse/fsutil.h @@ -32,10 +32,6 @@ #include "hgfsProto.h" #include -#if defined(__FreeBSD__) || defined(__SOLARIS__) || defined(__APPLE__) -typedef long long loff_t; -#endif - /* * Struct used to pass around attributes. * These aren't just the attributes seen in HgfsAttr[V2]; we add a filename @@ -73,7 +69,7 @@ ssize_t HgfsWrite(struct fuse_file_info *fi, const char *buf, size_t count, - loff_t offset); + off64_t offset); int HgfsRename(const char* from, const char* to); @@ -93,7 +89,7 @@ ssize_t HgfsRead(struct fuse_file_info *fi, char *buf, size_t count, - loff_t offset); + off64_t offset); int HgfsSetattr(const char* path, From f4ced29ecbabf24c74ed6fd4d8b1d1ffbd2d297f Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 17 Nov 2021 14:41:34 +0100 Subject: [PATCH 10/10] lib/misc: Recognize Alpine Linux Signed-off-by: Natanael Copa --- open-vm-tools/lib/include/guest_os.h | 1 + open-vm-tools/lib/misc/hostinfoPosix.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/open-vm-tools/lib/include/guest_os.h b/open-vm-tools/lib/include/guest_os.h index 5825cfa85..85f9d7a9a 100644 --- a/open-vm-tools/lib/include/guest_os.h +++ b/open-vm-tools/lib/include/guest_os.h @@ -295,6 +295,7 @@ Bool Gos_InSetArray(uint32 gos, const uint32 *set); /* Linux */ #define STR_OS_ALMA_LINUX "almaLinux" #define STR_OS_AMAZON_LINUX "amazonlinux" +#define STR_OS_ALPINE "Alpine" #define STR_OS_ANNVIX "Annvix" #define STR_OS_ARCH "Arch" #define STR_OS_ARKLINUX "Arklinux" diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c index ab9271744..c11286ee7 100644 --- a/open-vm-tools/lib/misc/hostinfoPosix.c +++ b/open-vm-tools/lib/misc/hostinfoPosix.c @@ -201,6 +201,7 @@ typedef struct { static const DistroInfo distroArray[] = { { "ALT", "/etc/altlinux-release" }, + { "Alpine", "/etc/alpine-release" }, { "Annvix", "/etc/annvix-release" }, { "Arch", "/etc/arch-release" }, { "Arklinux", "/etc/arklinux-release" }, @@ -1254,6 +1255,7 @@ HostinfoSetSuseShortName(const ShortNameSet *entry, // IN: static const ShortNameSet shortNameArray[] = { /* Long distro name Short distro name Short name set function */ { "almalinux", STR_OS_ALMA_LINUX, HostinfoGenericSetShortName }, +{ "alpine", STR_OS_ALPINE, HostinfoGenericSetShortName}, { "amazon", NULL, HostinfoSetAmazonShortName }, { "annvix", STR_OS_ANNVIX, HostinfoGenericSetShortName }, { "arch", STR_OS_ARCH, HostinfoGenericSetShortName },