blob: e107ecf235eed9772f544cffda69ab85c980cb44 [file] [log] [blame]
Brad Bishop15ae2502019-06-18 21:44:24 -04001From 5a795b234c617150915a607776c76377948870a6 Mon Sep 17 00:00:00 2001
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Wed, 18 Nov 2015 09:10:14 +0000
Brad Bishop15ae2502019-06-18 21:44:24 -04004Subject: [PATCH] Fix definition of ALLPERMS and ACCESSPERMS
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005
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
Brad Bishop15ae2502019-06-18 21:44:24 -040017diff --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 {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022 #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
Brad Bishop15ae2502019-06-18 21:44:24 -040038diff --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 @@
Brad Bishopd7bf8c12018-02-25 22:55:05 -050043
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__
Brad Bishop15ae2502019-06-18 21:44:24 -040051@@ -61,7 +61,6 @@
Brad Bishopd7bf8c12018-02-25 22:55:05 -050052 */
53 #define NO_SETMNTENT
54 #define NO_ENDMNTENT
55-#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO)
56 #endif
57
58