path: root/xlators/system
diff options
authorRajesh Joseph <>2016-11-03 14:21:28 +0530
committerRaghavendra Talur <>2016-11-04 00:38:19 -0700
commitde7fe24663713fff364cfc2b52b675e3e979ee68 (patch)
tree08aaf17764c9e634ac2fd6ef10c7b7e97ea19711 /xlators/system
parent5b453380b15f34c0841f453a02fdabc46ad2f7ef (diff)
posix-acl: check dictionary before using it
If extended attributes are not present in md-cache it returns NULL as xattr. posix acl xlator should check for NULL before using xattr. If normal and default ACLs are not set on file then md-cache will not contain system.posix_acl_access and system.posix_acl_default extended attributes in its cache. Therefore posix_acl_lookup_cbk should check xattr before using it, otherwise the logs will get filled with dictionary errors. Change-Id: Icebf73cf0b313bd3e82ca8cbda63786dd0fa47da BUG: 1391387 Signed-off-by: Rajesh Joseph <> Reviewed-on: Reviewed-by: Raghavendra Talur <> Smoke: Gluster Build System <> Reviewed-by: jiffin tony Thottan <> NetBSD-regression: NetBSD Build System <> Reviewed-by: Vijay Bellur <> CentOS-regression: Gluster Build System <>
Diffstat (limited to 'xlators/system')
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index c1e8d78..9d46791 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -880,6 +880,9 @@ posix_acl_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
ret = posix_acl_get (inode, this, &old_access, &old_default);
+ if (xattr == NULL)
+ goto acl_set;
data = dict_get (xattr, POSIX_ACL_ACCESS_XATTR);
if (!data)
goto acl_default;