1From 31ae6f42458f90d4994a4ad8e2b7673691612c36 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[Retrieved from:
13http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/open-vm-tools/open-vm-tools/0006-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch?h=sumo]
14Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
15---
16 open-vm-tools/lib/hgfsServer/hgfsServerLinux.c      | 8 +++++---
17 open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | 3 +--
18 2 files changed, 6 insertions(+), 5 deletions(-)
19
20Index: open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
21===================================================================
22--- open-vm-tools.orig/lib/hgfsServer/hgfsServerLinux.c
23+++ open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
24@@ -107,11 +107,13 @@ typedef struct DirectoryEntry {
25 #endif
26
27 /*
28- * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the
29- * Solaris version of <sys/stat.h>.
30+ * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not specified in
31+ * POSIX.
32  */
33-#ifdef sun
34+#ifndef ACCESSPERMS
35 #   define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
36+#endif
37+#ifndef ALLPERMS
38 #   define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
39 #endif
40
41Index: open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
42===================================================================
43--- open-vm-tools.orig/services/plugins/dndcp/dnd/dndLinux.c
44+++ open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
45@@ -51,7 +51,7 @@
46
47 #define DND_ROOTDIR_PERMS     (S_IRWXU | S_IRWXG | S_IRWXO)
48 #define DND_STAGINGDIR_PERMS  (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
49-#ifdef sun
50+#ifndef ACCESSPERMS
51 #define ACCESSPERMS           (S_IRWXU | S_IRWXG | S_IRWXO)
52 #endif
53 #ifdef __ANDROID__
54@@ -60,7 +60,6 @@
55  */
56 #define NO_SETMNTENT
57 #define NO_ENDMNTENT
58-#define ACCESSPERMS           (S_IRWXU | S_IRWXG | S_IRWXO)
59 #endif
60
61
62