From a29f1a0e36bde5ca7b8f3762f10b210b5e12a875 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 5 Oct 2011 16:56:30 +0530 Subject: fuse: flip xattr key from user to trusted namespace for certain clients. This is needed for gsyncd/hadoop-plugin running as non-super user to be able to request extended attributes under trusted namespace. Request for a key is made under 'user.' namespace and is flipped by fuse xlator for specific xattr name to the corresponding 'trusted.' extended attribute. Both applications set a identifier (client-pid) while doing a FUSE mount, which is checked by get/set/remove interfaces in FUSE translator. Change-Id: I72f77a5dd1ee1d69c8b0e09209449348dbcf879a BUG: 3701 Reviewed-on: http://review.gluster.com/563 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/common-utils.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libglusterfs/src/common-utils.c') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index e7d54d48b..6a5e2504b 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -1946,3 +1946,11 @@ get_mem_size () return memsize; } + + +int +gf_client_pid_check (gf_client_pid_t npid) +{ + return ( (npid > GF_CLIENT_PID_MIN) && (npid < GF_CLIENT_PID_MAX) ) + ? 0 : -1; +} -- cgit