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/dht/src/dht-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/dht/src/dht-common.c') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index ed4babd328c..f59bc96670c 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -2161,7 +2161,7 @@ dht_getxattr (call_frame_t *frame, xlator_t *this, * (until inode_link() happens) */ if (key && DHT_IS_DIR(layout) && - ((strcmp (key, GF_XATTR_PATHINFO_KEY) == 0) + (XATTR_IS_PATHINFO (key) || (strcmp (key, GF_XATTR_NODE_UUID_KEY) == 0))) { (void) strncpy (local->xsel, key, 256); cnt = local->call_cnt = layout->cnt; @@ -2176,7 +2176,7 @@ dht_getxattr (call_frame_t *frame, xlator_t *this, /* node-uuid or pathinfo for files */ if (key && ((strcmp (key, GF_XATTR_NODE_UUID_KEY) == 0) - || (strcmp (key, GF_XATTR_PATHINFO_KEY) == 0))) { + || XATTR_IS_PATHINFO (key))) { cached_subvol = local->cached_subvol; (void) strncpy (local->xsel, key, 256); -- cgit