summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2011-01-27 05:23:32 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-01-27 03:17:03 -0800
commit482d77b85d84bf5c2b48e4717f8d186967e42e63 (patch)
tree26464428f8bbb777a3c45e838214e3e0914f1c5a /glusterfsd
parenta2a92b99fc031544ff8a87861d34b2bbbdd2753c (diff)
implement "--client-pid" option which can forcibly set the pid value in messages to a predefined value
Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2310 (georeplication) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2310
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c22
-rw-r--r--glusterfsd/src/glusterfsd.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 8cfe4f4a9..4977e2b72 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -171,6 +171,8 @@ static struct argp_option gf_options[] = {
{"attribute-timeout", ARGP_ATTRIBUTE_TIMEOUT_KEY, "SECONDS", 0,
"Set attribute timeout to SECONDS for inodes in fuse kernel module "
"[default: 1]"},
+ {"client-pid", ARGP_CLIENT_PID_KEY, "PID", OPTION_HIDDEN,
+ "client will authenticate itself with process id PID to server"},
{"dump-fuse", ARGP_DUMP_FUSE_KEY, "PATH", 0,
"Dump fuse traffic to PATH"},
{"volfile-check", ARGP_VOLFILE_CHECK_KEY, 0, 0,
@@ -246,6 +248,16 @@ create_fuse_mount (glusterfs_ctx_t *ctx)
}
}
+ if (cmd_args->client_pid_set) {
+ ret = dict_set_int32 (master->options, "client-pid",
+ cmd_args->client_pid);
+ if (ret < 0) {
+ gf_log ("glusterfsd", GF_LOG_ERROR,
+ "failed to set dict value.");
+ goto err;
+ }
+ }
+
if (cmd_args->volfile_check) {
ret = dict_set_int32 (master->options, ZR_STRICT_VOLFILE_CHECK,
cmd_args->volfile_check);
@@ -598,6 +610,16 @@ parse_opts (int key, char *arg, struct argp_state *state)
"unknown attribute timeout %s", arg);
break;
+ case ARGP_CLIENT_PID_KEY:
+ if (gf_string2int (arg, &cmd_args->client_pid) == 0) {
+ cmd_args->client_pid_set = 1;
+ break;
+ }
+
+ argp_failure (state, -1, 0,
+ "unknown client pid %s", arg);
+ break;
+
case ARGP_VOLFILE_CHECK_KEY:
cmd_args->volfile_check = 1;
break;
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
index 634eb8679..aec0253ad 100644
--- a/glusterfsd/src/glusterfsd.h
+++ b/glusterfsd/src/glusterfsd.h
@@ -75,6 +75,7 @@ enum argp_option_keys {
ARGP_DUMP_FUSE_KEY = 150,
ARGP_BRICK_NAME_KEY = 151,
ARGP_BRICK_PORT_KEY = 152,
+ ARGP_CLIENT_PID_KEY = 153,
};
int glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx);