diff options
| -rw-r--r-- | libglusterfs/src/glusterfs.h | 8 | ||||
| -rw-r--r-- | rpc/xdr/src/glusterfs3.h | 4 | ||||
| -rw-r--r-- | xlators/system/posix-acl/src/posix-acl.c | 7 | 
3 files changed, 18 insertions, 1 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 5bd5d5437fe..ad3bae14bf4 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -33,6 +33,7 @@  #include <sys/poll.h>  #include <pthread.h> +  #include "list.h"  #include "logging.h" @@ -41,7 +42,12 @@  #ifndef O_LARGEFILE  /* savannah bug #20053, patch for compiling on darwin */ -#define O_LARGEFILE 0 +#define O_LARGEFILE 0100000 /* from bits/fcntl.h */ +#endif + +#ifndef O_FMODE_EXEC +/* redhat bug 843080, added from linux/fs.h */ +#define O_FMODE_EXEC 040 //0x20  #endif  #ifndef O_DIRECT diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h index 186735d247d..798413e3145 100644 --- a/rpc/xdr/src/glusterfs3.h +++ b/rpc/xdr/src/glusterfs3.h @@ -44,6 +44,8 @@  #define GF_O_LARGEFILE     0100000 +#define GF_O_FMODE_EXEC        040 +  #define XLATE_BIT(from, to, bit)    do {                \                  if (from & bit)                         \                          to = to | GF_##bit;             \ @@ -102,6 +104,7 @@ gf_flags_from_flags (uint32_t flags)          XLATE_BIT (flags, gf_flags, O_CLOEXEC);  #endif          XLATE_BIT (flags, gf_flags, O_LARGEFILE); +        XLATE_BIT (flags, gf_flags, O_FMODE_EXEC);          return gf_flags;  } @@ -132,6 +135,7 @@ gf_flags_to_flags (uint32_t gf_flags)          UNXLATE_BIT (gf_flags, flags, O_CLOEXEC);  #endif          UNXLATE_BIT (gf_flags, flags, O_LARGEFILE); +        UNXLATE_BIT (gf_flags, flags, O_FMODE_EXEC);          return flags;  } diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c index 0962f64044d..f54e20a6970 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -919,6 +919,13 @@ posix_acl_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,          switch (flags & O_ACCMODE) {          case O_RDONLY:                  perm = POSIX_ACL_READ; + +                /* If O_FMODE_EXEC is present, its good enough +                   to have '--x' perm, and its not covered in +                   O_ACCMODE bits */ +                if (flags & O_FMODE_EXEC) +                        perm = POSIX_ACL_EXECUTE; +                  break;          case O_WRONLY:          case O_APPEND:  | 
