Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 1 | From 6be6cda5aea42b951212ec5f8a72778b1ef9c2da Mon Sep 17 00:00:00 2001 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | From: Natanael Copa <ncopa@alpinelinux.org> |
| 3 | Date: Wed, 18 Nov 2015 09:10:14 +0000 |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 4 | Subject: [PATCH] Fix definition of ALLPERMS and ACCESSPERMS |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 | |
| 6 | The ALLPERMS and ACCESSPERMS defines are not specified in POSIX so |
| 7 | assume it is not there instead of testing for specific implementations. |
| 8 | |
| 9 | This is needed for musl libc. |
| 10 | |
| 11 | Signed-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 Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 17 | diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 18 | index 63c4e65f0..87d419a7b 100644 |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 38 | diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 39 | index 219065f74..b5b7e6203 100644 |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 40 | --- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c |
| 41 | +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 42 | @@ -53,7 +53,7 @@ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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__ |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 51 | @@ -62,7 +62,6 @@ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 52 | */ |
| 53 | #define NO_SETMNTENT |
| 54 | #define NO_ENDMNTENT |
| 55 | -#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) |
| 56 | #endif |
| 57 | |
| 58 | |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 59 | -- |
| 60 | 2.25.1 |
| 61 | |