1From 5a795b234c617150915a607776c76377948870a6 Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Wed, 18 Nov 2015 09:10:14 +0000
4Subject: [PATCH] Fix definition of ALLPERMS and ACCESSPERMS
5
6The ALLPERMS and ACCESSPERMS defines are not specified in POSIX so
7assume it is not there instead of testing for specific implementations.
8
9This is needed for musl libc.
10
11Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
12---
13 open-vm-tools/lib/hgfsServer/hgfsServerLinux.c      | 8 +++++---
14 open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | 3 +--
15 2 files changed, 6 insertions(+), 5 deletions(-)
16
17diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
18index f2b7ce67..0e6351a9 100644
19--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
20+++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
21@@ -105,11 +105,13 @@ typedef struct DirectoryEntry {
22 #endif
23
24 /*
25- * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the
26- * Solaris version of <sys/stat.h>.
27+ * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not specified in
28+ * POSIX.
29  */
30-#ifdef sun
31+#ifndef ACCESSPERMS
32 #   define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
33+#endif
34+#ifndef ALLPERMS
35 #   define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
36 #endif
37
38diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
39index 89133652..7e9c3a91 100644
40--- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
41+++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
42@@ -52,7 +52,7 @@
43
44 #define DND_ROOTDIR_PERMS     (S_IRWXU | S_IRWXG | S_IRWXO)
45 #define DND_STAGINGDIR_PERMS  (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
46-#ifdef sun
47+#ifndef ACCESSPERMS
48 #define ACCESSPERMS           (S_IRWXU | S_IRWXG | S_IRWXO)
49 #endif
50 #ifdef __ANDROID__
51@@ -61,7 +61,6 @@
52  */
53 #define NO_SETMNTENT
54 #define NO_ENDMNTENT
55-#define ACCESSPERMS           (S_IRWXU | S_IRWXG | S_IRWXO)
56 #endif
57
58
59