From 6756245b1514374712136c8dc1f4ac2a19a6da21 Mon Sep 17 00:00:00 2001 From: Rajesh Amaravathi Date: Wed, 29 Feb 2012 15:16:53 +0530 Subject: fops/removexattr: prevent users from removing glusterfs xattrs * Each xlator prevents the user from removing xlator-specific xattrs like trusted.gfid by handling it in respective removexattr functions. * For xlators which did not define remove and fremovexattr, the functions have been implemented with appropriate checks. xlator | fops-added _______________|__________________________ | 1. stripe | removexattr and fremovexattr 2. quota | removexattr and fremovexattr Change-Id: I98e22109717978134378bc75b2eca83fefb2abba BUG: 783525 Signed-off-by: Rajesh Amaravathi Reviewed-on: http://review.gluster.com/2836 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Jeff Darcy --- xlators/mount/fuse/src/fuse-bridge.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/mount/fuse') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index b5059878845..3f3962cbc66 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -3009,6 +3009,12 @@ fuse_removexattr (xlator_t *this, fuse_in_header_t *finh, void *msg) int32_t ret = -1; char *newkey = NULL; + if (!strcmp (GFID_XATTR_KEY, name)) { + send_fuse_err (this, finh, EPERM); + GF_FREE (finh); + return; + } + priv = this->private; GET_STATE (this, finh, state); -- cgit