1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-05 15:48:40 +01:00

gfapi: Move the SECURE_ACCESS_FILE check out of glfs_mgmt_init

glfs_mgmt_init is only called for glfs_set_volfile_server, but
secure_mgmt is also required to use glfs_set_volfile with SSL.

fixes: #829
Change-Id: Ibc769fe634d805e085232f85ce6e1c48bf4acc66
This commit is contained in:
Môshe van der Sterre
2020-09-28 06:12:32 +02:00
committed by MOHIT AGRAWAL
parent 773aaddc65
commit eb4b2cb003
5 changed files with 223 additions and 5 deletions

View File

@@ -1013,11 +1013,6 @@ glfs_mgmt_init(struct glfs *fs)
if (ret)
goto out;
if (sys_access(SECURE_ACCESS_FILE, F_OK) == 0) {
ctx->secure_mgmt = 1;
ctx->ssl_cert_depth = glusterfs_read_secure_access_file();
}
rpc = rpc_clnt_new(options, THIS, THIS->name, 8);
if (!rpc) {
ret = -1;

View File

@@ -251,6 +251,11 @@ glfs_volumes_init(struct glfs *fs)
if (!vol_assigned(cmd_args))
return -1;
if (sys_access(SECURE_ACCESS_FILE, F_OK) == 0) {
fs->ctx->secure_mgmt = 1;
fs->ctx->ssl_cert_depth = glusterfs_read_secure_access_file();
}
if (cmd_args->volfile_server) {
ret = glfs_mgmt_init(fs);
goto out;