Patchwork [BRANCH:release-3.1,BUG:2818] NFS : Check proper permissions in access control for setattr.

login
register
Submitter Gaurav
Date 2011-04-20 10:50:22
Message ID <1303296622-31477-1-git-send-email-gaurav@gluster.com>
Download mbox | patch
Permalink /patch/7001/
State Accepted
Delegated to: Shehjar Tikoo
Headers show

Comments

Gaurav - 2011-04-20 10:50:22
From: Gaurav <gaurav@gluster.com>


Signed-off-by: Gaurav <gaurav@gluster.com>
---
 .../features/access-control/src/access-control.c   |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/xlators/features/access-control/src/access-control.c b/xlators/features/access-control/src/access-control.c
index 7b5689d..78a0629 100644
--- a/xlators/features/access-control/src/access-control.c
+++ b/xlators/features/access-control/src/access-control.c
@@ -1687,7 +1687,7 @@  ac_setattr_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         op_ret = ac_test_access (buf, frame->root->uid, frame->root->gid,
                                  frame->root->groups, frame->root->ngrps,
-                                 ACCTEST_DONTCARE, ACCTEST_OWNER,
+                                 ACCTEST_WRITE, ACCTEST_ANY,
                                  &op_errno);
         if (op_ret == -1)
                 goto out;
@@ -1797,7 +1797,7 @@  ac_fsetattr_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
 
         op_ret = ac_test_access (buf, frame->root->uid, frame->root->gid,
                                  frame->root->groups, frame->root->ngrps,
-                                 ACCTEST_DONTCARE, ACCTEST_OWNER,
+                                 ACCTEST_WRITE, ACCTEST_ANY,
                                  &op_errno);
         if (op_ret == -1)
                 goto out;