summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index 688e60914dc..3f4d40af48e 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -855,17 +855,25 @@ posix_acl_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, inode_t *inode,
struct iatt *buf, dict_t *xattr, struct iatt *postparent)
{
- struct posix_acl *acl_access = NULL;
+ struct posix_acl *acl_access = NULL;
struct posix_acl *acl_default = NULL;
- struct posix_acl *old_access = NULL;
+ struct posix_acl *old_access = NULL;
struct posix_acl *old_default = NULL;
- data_t *data = NULL;
- int ret = 0;
- dict_t *my_xattr = NULL;
+ struct posix_acl_ctx *ctx = NULL;
+ data_t *data = NULL;
+ int ret = 0;
+ dict_t *my_xattr = NULL;
if (op_ret != 0)
goto unwind;
+ ctx = posix_acl_ctx_new (inode, this);
+ if (!ctx) {
+ op_ret = -1;
+ op_errno = ENOMEM;
+ goto unwind;
+ }
+
ret = posix_acl_get (inode, this, &old_access, &old_default);
data = dict_get (xattr, POSIX_ACL_ACCESS_XATTR);
@@ -1626,11 +1634,12 @@ posix_acl_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, gf_dirent_t *entries,
dict_t *xdata)
{
- gf_dirent_t *entry = NULL;
- struct posix_acl *acl_access = NULL;
- struct posix_acl *acl_default = NULL;
- data_t *data = NULL;
- int ret = 0;
+ gf_dirent_t *entry = NULL;
+ struct posix_acl *acl_access = NULL;
+ struct posix_acl *acl_default = NULL;
+ struct posix_acl_ctx *ctx = NULL;
+ data_t *data = NULL;
+ int ret = 0;
if (op_ret <= 0)
goto unwind;
@@ -1640,6 +1649,13 @@ posix_acl_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (!entry->dict || !entry->inode)
continue;
+ ctx = posix_acl_ctx_new (entry->inode, this);
+ if (!ctx) {
+ op_ret = -1;
+ op_errno = ENOMEM;
+ goto unwind;
+ }
+
ret = posix_acl_get (entry->inode, this,
&acl_access, &acl_default);