summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorGaurav <gaurav@gluster.com>2011-09-21 17:10:23 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-21 22:37:17 -0700
commitc3b764cad74114f77e8c4acc4c040c4b20666b5d (patch)
treebaee6a137ea728182bebadccedc1cf2ea2576e2a /xlators
parent83a8938fec225268a3afdbcad1011f0e06e54d16 (diff)
NFS : Posix compliance fixes.
Change-Id: I3687fd16bcc0ddc8a352efb9a0b410f54bec6e74 BUG: 1337 Reviewed-on: http://review.gluster.com/482 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index 5cdcbecafd3..f7c3ad88026 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -575,13 +575,14 @@ nfs3_accessbits (int32_t accbits)
uint32_t accresult = 0;
if (accbits & POSIX_READ)
- accresult |= (ACCESS3_READ | ACCESS3_LOOKUP);
+ accresult |= ACCESS3_READ;
if (accbits & POSIX_WRITE)
accresult |= (ACCESS3_MODIFY | ACCESS3_EXTEND);
+ /* lookup on directory allowed only in case of execute permission */
if (accbits & POSIX_EXEC)
- accresult |= ACCESS3_EXECUTE;
+ accresult |= (ACCESS3_EXECUTE | ACCESS3_LOOKUP);
return accresult;
}
@@ -591,13 +592,14 @@ nfs3_request_to_accessbits (int32_t accbits)
{
uint32_t acc_request = 0;
- if (accbits & (ACCESS3_READ | ACCESS3_LOOKUP))
+ if (accbits & ACCESS3_READ)
acc_request |= POSIX_READ;
if (accbits & (ACCESS3_MODIFY | ACCESS3_EXTEND))
acc_request |= POSIX_WRITE;
- if (accbits & ACCESS3_EXECUTE)
+ /* For lookup on directory check for execute permission */
+ if (accbits & (ACCESS3_EXECUTE | ACCESS3_LOOKUP))
acc_request |= POSIX_EXEC;
return acc_request;