From fa194179431b7e9aac68333c91a9c3254a15335d Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 25 Feb 2010 15:38:08 +0000 Subject: distribute: perform self-heal as root prerserve original frame uid and gid and perform self-heal by changing uid/gid to root (0) temporarily. Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 597 (miscellaneous fixes for xlators to work well with NFS xlator) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=597 --- xlators/cluster/dht/src/dht-helper.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'xlators/cluster/dht/src/dht-helper.c') diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index ebc0e5e014a..fc7f7a4bf1e 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -367,6 +367,36 @@ dht_stat_merge (xlator_t *this, struct stat *to, return 0; } +int +dht_frame_su_do (call_frame_t *frame) +{ + dht_local_t *local = NULL; + + local = frame->local; + + local->uid = frame->root->uid; + local->gid = frame->root->gid; + + frame->root->uid = 0; + frame->root->gid = 0; + + return 0; +} + + +int +dht_frame_su_undo (call_frame_t *frame) +{ + dht_local_t *local = NULL; + + local = frame->local; + + frame->root->uid = local->uid; + frame->root->gid = local->gid; + + return 0; +} + int dht_build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name) -- cgit