From 9f2e9fc465361e7821627a8c3a22863bb25b0810 Mon Sep 17 00:00:00 2001 From: Pranith K Date: Thu, 3 Feb 2011 21:22:44 +0000 Subject: cluster/afr: Perform self-heal as root Signed-off-by: Pranith Kumar K Signed-off-by: Anand V. Avati BUG: 2370 (cluster/afr: Perform self-heal as root) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2370 --- libglusterfs/src/stack.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libglusterfs/src/stack.h') diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index f06267c38..1c3e3430e 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -182,6 +182,22 @@ STACK_DESTROY (call_stack_t *stack) #define cbk(x) cbk_##x +#define FRAME_SU_DO(frm, local_type) \ + do { \ + local_type *__local = (frm)->local; \ + __local->uid = frm->root->uid; \ + __local->gid = frm->root->gid; \ + frm->root->uid = 0; \ + frm->root->gid = 0; \ + } while (0); \ + +#define FRAME_SU_UNDO(frm, local_type) \ + do { \ + local_type *__local = (frm)->local; \ + frm->root->uid = __local->uid; \ + frm->root->gid = __local->gid; \ + } while (0); \ + /* make a call */ #define STACK_WIND(frame, rfn, obj, fn, params ...) \ -- cgit