From: Sage Weil Date: Mon, 18 Feb 2019 19:02:16 +0000 (-0600) Subject: common/options: add ms_mon_client_mode X-Git-Tag: v14.1.0~7^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b9c294e7a4c4ee77e691cfea83048c77e006dbe5;p=ceph.git common/options: add ms_mon_client_mode The server now has a list of *allowed* modes (no ordering) and the clients have a list of modes in order of preference. Since we want everything connecting to the mon to be secure by default (think: ceph auth set ...), we need a separate option to ensure we prefer secure mon connections from the CLI etc. Signed-off-by: Sage Weil --- diff --git a/src/auth/AuthRegistry.cc b/src/auth/AuthRegistry.cc index f7483d56211d..f89868cbfa5b 100644 --- a/src/auth/AuthRegistry.cc +++ b/src/auth/AuthRegistry.cc @@ -103,6 +103,8 @@ void AuthRegistry::_refresh_config() &mon_cluster_modes); _parse_mode_list(cct->_conf.get_val("ms_mon_service_mode"), &mon_service_modes); + _parse_mode_list(cct->_conf.get_val("ms_mon_client_mode"), + &mon_client_modes); _parse_mode_list(cct->_conf.get_val("ms_cluster_mode"), &cluster_modes); _parse_mode_list(cct->_conf.get_val("ms_service_mode"), @@ -115,8 +117,9 @@ void AuthRegistry::_refresh_config() << " client_methods " << client_methods << dendl; ldout(cct,10) << __func__ << " mon_cluster_modes " << mon_cluster_modes - << " mon_service_mdoes " << mon_service_modes - << " cluster_modes " << cluster_modes + << " mon_service_modes " << mon_service_modes + << " mon_client_modes " << mon_client_modes + << "; cluster_modes " << cluster_modes << " service_modes " << service_modes << " client_modes " << client_modes << dendl; @@ -163,7 +166,13 @@ void AuthRegistry::get_supported_methods( *methods = client_methods; } if (modes) { - *modes = client_modes; + switch (peer_type) { + case CEPH_ENTITY_TYPE_MON: + *modes = mon_client_modes; + break; + default: + *modes = client_modes; + } } return; case CEPH_ENTITY_TYPE_MON: diff --git a/src/auth/AuthRegistry.h b/src/auth/AuthRegistry.h index ae2cad4fcc3a..72335e1b156f 100644 --- a/src/auth/AuthRegistry.h +++ b/src/auth/AuthRegistry.h @@ -28,6 +28,7 @@ class AuthRegistry : public md_config_obs_t { // CEPH_CON_MODE_* std::vector mon_cluster_modes; std::vector mon_service_modes; + std::vector mon_client_modes; std::vector cluster_modes; std::vector service_modes; std::vector client_modes; diff --git a/src/common/options.cc b/src/common/options.cc index 8fa0414be987..07345d8f1469 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -844,6 +844,7 @@ std::vector