blob: 24279e34a0231903b8c32c3b2335865e7fbd5010 [file] [log] [blame]
Patrick Williams2194f502022-10-16 14:26:09 -05001From 6be6cda5aea42b951212ec5f8a72778b1ef9c2da 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
Patrick Williams2194f502022-10-16 14:26:09 -050018index 63c4e65f0..87d419a7b 100644
Brad Bishop15ae2502019-06-18 21:44:24 -040019--- 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
Patrick Williams2194f502022-10-16 14:26:09 -050039index 219065f74..b5b7e6203 100644
Brad Bishop15ae2502019-06-18 21:44:24 -040040--- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
41+++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
Patrick Williams2194f502022-10-16 14:26:09 -050042@@ -53,7 +53,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__
Patrick Williams2194f502022-10-16 14:26:09 -050051@@ -62,7 +62,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
Patrick Williams2194f502022-10-16 14:26:09 -050059--
602.25.1
61