summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfsd/src')
-rw-r--r--glusterfsd/src/glusterfsd.c23
-rw-r--r--glusterfsd/src/glusterfsd.h1
2 files changed, 24 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 79e6e593a53..3c92783cb3d 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -218,6 +218,8 @@ static struct argp_option gf_options[] = {
{"use-readdirp", ARGP_FUSE_USE_READDIRP_KEY, "BOOL", OPTION_ARG_OPTIONAL,
"Use readdirp mode in fuse kernel module"
" [default: \"off\"]"},
+ {"secure-mgmt", ARGP_SECURE_MGMT_KEY, "BOOL", OPTION_ARG_OPTIONAL,
+ "Override default for secure (SSL) management connections"},
{0, 0, 0, 0, "Miscellaneous Options:"},
{0, }
};
@@ -1145,6 +1147,19 @@ parse_opts (int key, char *arg, struct argp_state *state)
}
break;
+
+ case ARGP_SECURE_MGMT_KEY:
+ if (!arg)
+ arg = "yes";
+
+ if (gf_string2boolean (arg, &b) == 0) {
+ cmd_args->secure_mgmt = b ? 1 : 0;
+ break;
+ }
+
+ argp_failure (state, -1, 0,
+ "unknown secure-mgmt setting \"%s\"", arg);
+ break;
}
return 0;
@@ -1493,8 +1508,15 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx)
cmd_args = &ctx->cmd_args;
+ /* Do this before argp_parse so it can be overridden. */
+ if (access(SECURE_ACCESS_FILE,F_OK) == 0) {
+ cmd_args->secure_mgmt = 1;
+ }
+
argp_parse (&argp, argc, argv, ARGP_IN_ORDER, NULL, cmd_args);
+ ctx->secure_mgmt = cmd_args->secure_mgmt;
+
if (ENABLE_DEBUG_MODE == cmd_args->debug_mode) {
cmd_args->log_level = GF_LOG_DEBUG;
cmd_args->log_file = gf_strdup ("/dev/stderr");
@@ -1985,6 +2007,7 @@ main (int argc, char *argv[])
if (ret)
goto out;
+
/* log the version of glusterfs running here along with the actual
command line options. */
{
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
index a75369a24f5..41f7b1d9a38 100644
--- a/glusterfsd/src/glusterfsd.h
+++ b/glusterfsd/src/glusterfsd.h
@@ -91,6 +91,7 @@ enum argp_option_keys {
ARGP_LOG_FORMAT = 169,
ARGP_LOG_BUF_SIZE = 170,
ARGP_LOG_FLUSH_TIMEOUT = 171,
+ ARGP_SECURE_MGMT_KEY = 172,
};
struct _gfd_vol_top_priv_t {