From 7e3dd526c62b3a1bb59945efdfed2c2fbbcf9cf9 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 23 Dec 2013 12:53:32 +0100 Subject: rpc/server: add anonuid and anongid options for root-squash Introduce new options to modify the behaviour of server.root-squash. With server.anonuid and server.anongid the uid/gid can be specified and the root user (uid=0 and gid=0) will be mapped to the given uid/gid instead of nfsnobody (uid=65534 and gid=65534). Many thanks to Vikhyat Umrao for writing the majority of the test-case! Change-Id: I6379a3d2ef52b9b9707f2f6f0529657580c8d779 BUG: 1043886 CC: Vikhyat Umrao Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/6546 Reviewed-by: Santosh Pradhan Reviewed-by: Vikhyat Umrao Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/protocol/server/src/server.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'xlators/protocol') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 3720372f9..a797a0d6c 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -1057,6 +1057,22 @@ struct volume_options options[] = { "uids or gids that might be equally sensitive, such " "as user bin or group staff." }, + { .key = {"anonuid"}, + .type = GF_OPTION_TYPE_INT, + .default_value = "65534", /* RPC_NOBODY_UID */ + .min = 0, + .max = (uint32_t) -1, + .description = "value of the uid used for the anonymous " + "user/nfsnobody when root-squash is enabled." + }, + { .key = {"anongid"}, + .type = GF_OPTION_TYPE_INT, + .default_value = "65534", /* RPC_NOBODY_GID */ + .min = 0, + .max = (uint32_t) -1, + .description = "value of the gid used for the anonymous " + "user/nfsnobody when root-squash is enabled." + }, { .key = {"statedump-path"}, .type = GF_OPTION_TYPE_PATH, .default_value = DEFAULT_VAR_RUN_DIRECTORY, -- cgit