summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/selinux/src/selinux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/features/selinux/src/selinux.c b/xlators/features/selinux/src/selinux.c
index 1a4b39f253c..386bce1bc44 100644
--- a/xlators/features/selinux/src/selinux.c
+++ b/xlators/features/selinux/src/selinux.c
@@ -22,7 +22,7 @@ selinux_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int ret = 0;
char *name = cookie;
- if (op_errno == 0 && name && (!strcmp(name, SELINUX_GLUSTER_XATTR))) {
+ if (op_errno == 0 && dict && name && (!strcmp(name, SELINUX_GLUSTER_XATTR))) {
ret = dict_rename_key (dict, SELINUX_GLUSTER_XATTR,
SELINUX_XATTR);
if (ret < 0)
@@ -77,7 +77,7 @@ selinux_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int ret = 0;
char *name = cookie;
- if (op_errno == 0 && name && (!strcmp(name, SELINUX_GLUSTER_XATTR))) {
+ if (op_errno == 0 && dict && name && (!strcmp(name, SELINUX_GLUSTER_XATTR))) {
ret = dict_rename_key (dict, SELINUX_GLUSTER_XATTR,
SELINUX_XATTR);
if (ret < 0)
@@ -147,7 +147,7 @@ selinux_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
GF_VALIDATE_OR_GOTO ("selinux", priv, err);
- if (!priv->selinux_enabled)
+ if (!priv->selinux_enabled && !dict)
goto off;
ret = dict_rename_key (dict, SELINUX_XATTR, SELINUX_GLUSTER_XATTR);
@@ -189,7 +189,7 @@ selinux_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
GF_VALIDATE_OR_GOTO ("selinux", priv, err);
- if (!priv->selinux_enabled)
+ if (!priv->selinux_enabled && !dict)
goto off;
ret = dict_rename_key (dict, SELINUX_XATTR, SELINUX_GLUSTER_XATTR);