diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2014-04-17 23:21:05 +0000 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-07-02 02:47:05 -0700 |
commit | caa8a4ea50734378e7e19f70b39a837c58e9d229 (patch) | |
tree | a06a99e143a1dd8c99cc10e84e9d3bca72a63cf7 /xlators/mgmt/glusterd/src/glusterd-volgen.c | |
parent | 831efecf927788f26b630cb82d5d6ff4af411a3d (diff) |
rpc/auth: allow SSL identity to be used for authorization
Access to a volume is now controlled by the following options, based on
whether SSL is enabled or not.
* server.ssl-allow: get identity from certificate, no password needed
* auth.allow: get identity and matching password from command line
It is not possible to allow both simultaneously, since the connection
itself is either using SSL or it isn't.
Change-Id: I5a5be66520f56778563d62f4b3ab35c66cc41ac0
BUG: 1114604
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/3695
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 664c37af9d6..777e69535df 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -1517,6 +1517,7 @@ server_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, gf_boolean_t quota_enabled = _gf_true; gf_boolean_t pgfid_feat = _gf_false; char *value = NULL; + char *ssl_user = NULL; brickinfo = param; path = brickinfo->path; @@ -1816,6 +1817,15 @@ server_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, return -1; } + if (dict_get_str (volinfo->dict, "auth.ssl-allow", &ssl_user) == 0) { + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "auth.login.%s.ssl-allow", path); + + ret = xlator_set_option (xl, key, ssl_user); + if (ret) + return -1; + } + ret = volgen_graph_set_options_generic (graph, set_dict, (xlator && loglevel) ? (void *)set_dict : volinfo, (xlator && loglevel) ? &server_spec_extended_option_handler : |