From a9623ada6f7b39ac2d567f66a496072487d8e6ec Mon Sep 17 00:00:00 2001 From: Vijaykumar M Date: Thu, 12 Dec 2013 11:40:36 +0530 Subject: pathinfo: Provide user namespace access. Locality can be now queried by unprivileged users with key "glusterfs.pathinfo". Setting both "glusterfs.pathinfo" and "trusted.glusterfs.pathinfo" on disk is prevented with this patch. Original Author: Vijay Bellur Change-Id: I4f7a0db8ad59165c4aeda04b23173255157a8b79 Signed-off-by: Vijaykumar M Reviewed-on: http://review.gluster.org/5101 Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/stripe/src/stripe.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'xlators/cluster/stripe') diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 8ac14cb3a..c98126225 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -5548,9 +5548,7 @@ stripe_getxattr (call_frame_t *frame, xlator_t *this, return 0; } - if (name && - ((strncmp (name, GF_XATTR_PATHINFO_KEY, - strlen (GF_XATTR_PATHINFO_KEY)) == 0))) { + if (name && (XATTR_IS_PATHINFO (name))) { if (IA_ISREG (loc->inode->ia_type)) { ret = inode_ctx_get (loc->inode, this, (uint64_t *) &local->fctx); @@ -5637,8 +5635,7 @@ stripe_is_special_xattr (const char *name) if (!strncmp (name, GF_XATTR_LOCKINFO_KEY, strlen (GF_XATTR_LOCKINFO_KEY)) - || !strncmp (name, GF_XATTR_PATHINFO_KEY, - strlen (GF_XATTR_PATHINFO_KEY))) + || XATTR_IS_PATHINFO (name)) is_spl = _gf_true; out: return is_spl; -- cgit