diff -urN a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
+++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c
@@ -105,11 +105,13 @@
 #endif
 
 /*
- * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the
- * Solaris version of <sys/stat.h>.
+ * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not specified in
+ * POSIX.
  */
-#ifdef sun
+#ifndef ACCESSPERMS
 #   define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+#ifndef ALLPERMS
 #   define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
 #endif
 
diff -urN a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
--- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
+++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c
@@ -52,7 +52,7 @@
 
 #define DND_ROOTDIR_PERMS     (S_IRWXU | S_IRWXG | S_IRWXO)
 #define DND_STAGINGDIR_PERMS  (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
-#ifdef sun
+#ifndef ACCESSPERMS
 #define ACCESSPERMS           (S_IRWXU | S_IRWXG | S_IRWXO)
 #endif
 #ifdef __ANDROID__
@@ -61,7 +61,6 @@
  */
 #define NO_SETMNTENT
 #define NO_ENDMNTENT
-#define ACCESSPERMS           (S_IRWXU | S_IRWXG | S_IRWXO)
 #endif
 
 
