summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-03-26 21:08:12 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-27 00:21:33 -0700
commitd15dedd8c99e84018a50130a8ffe5e971b9f7bd4 (patch)
treefd4cbfede70d25d019509ec42b5864a708429965
parentc8a723ac7cbd7bdc8bd01350c56e15fd7fa5e7ca (diff)
xlators/lib: Handle NULL 'name' for marker xattrs
Change-Id: I18f00b7e92f483673250821c457d1e8be2eef081 BUG: 1200372 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10015 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rwxr-xr-xtests/basic/geo-replication/marker-xattrs.t2
-rw-r--r--xlators/lib/src/libxlator.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/basic/geo-replication/marker-xattrs.t b/tests/basic/geo-replication/marker-xattrs.t
index a7dcb50aa78..7061b4532a3 100755
--- a/tests/basic/geo-replication/marker-xattrs.t
+++ b/tests/basic/geo-replication/marker-xattrs.t
@@ -30,6 +30,7 @@ TEST kill_brick $V0 $H0 $B0/${V0}-0
TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="
+TEST getfattr -d -m. -e hex $M1
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1
@@ -65,6 +66,7 @@ TEST kill_brick $V0 $H0 $B0/${V0}-0
TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="
+TEST getfattr -d -m. -e hex $M1
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1
diff --git a/xlators/lib/src/libxlator.c b/xlators/lib/src/libxlator.c
index 30436131b6b..0f703904fab 100644
--- a/xlators/lib/src/libxlator.c
+++ b/xlators/lib/src/libxlator.c
@@ -458,6 +458,9 @@ cluster_handle_marker_getxattr (call_frame_t *frame, loc_t *loc,
if (GF_CLIENT_PID_GSYNCD != frame->root->pid)
return -EINVAL;
+ if (name == NULL)
+ return -EINVAL;
+
if (strcmp (GF_XATTR_MARKER_KEY, name) == 0) {
type = MARKER_UUID_TYPE;
memcpy (gauge, marker_uuid_default_gauge, sizeof (gauge));