diff options
author | Rajesh Joseph <rjoseph@redhat.com> | 2016-11-03 14:21:28 +0530 |
---|---|---|
committer | Raghavendra Talur <rtalur@redhat.com> | 2016-11-09 22:26:40 -0800 |
commit | 494dbb8d178b4da925079eea8abeef13df3a129d (patch) | |
tree | a8f6d8d5fc52b2d61d16aabef463e99c58d04d7e /xlators | |
parent | ce95b633e859d90edcbd2868da73d7ff392defaf (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.
> Reviewed-on: http://review.gluster.org/15769
> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
(cherry picked from commit de7fe24663713fff364cfc2b52b675e3e979ee68)
Change-Id: Icebf73cf0b313bd3e82ca8cbda63786dd0fa47da
BUG: 1392868
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/15799
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | 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 f3666ef9432..8a212020a5f 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; |