From fc1a2372e14adf41b810fc3e83bf8719369bdb41 Mon Sep 17 00:00:00 2001 From: Rajesh Joseph Date: Thu, 3 Nov 2016 14:21:28 +0530 Subject: [PATCH 157/157] 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: 1386366 Signed-off-by: Rajesh Joseph Reviewed-on: http://review.gluster.org/15769 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 Reviewed-on: https://code.engineering.redhat.com/gerrit/89419 Reviewed-by: Jiffin Thottan Reviewed-by: Atin Mukherjee --- xlators/system/posix-acl/src/posix-acl.c | 3 +++ 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 f3666ef..8a21202 100644 --- a/xlators/system/posix-acl/src/posix-acl.c +++ b/xlators/system/posix-acl/src/posix-acl.c @@ -876,6 +876,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; -- 1.7.1