summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/stack.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h
index f06267c3848..1c3e3430e12 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 ...) \