From: Sage Weil Date: Thu, 21 Feb 2019 19:45:49 +0000 (-0600) Subject: auth/AuthRegistry: register as an observer X-Git-Tag: v14.1.0~7^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=06559913be09ade6ed702bb529a47f5f9c0bf578;p=ceph.git auth/AuthRegistry: register as an observer Signed-off-by: Sage Weil --- diff --git a/src/auth/AuthRegistry.cc b/src/auth/AuthRegistry.cc index f10271800dac..241db4a9c733 100644 --- a/src/auth/AuthRegistry.cc +++ b/src/auth/AuthRegistry.cc @@ -16,6 +16,20 @@ #undef dout_prefix #define dout_prefix *_dout << "AuthRegistry(" << this << ") " +AuthRegistry::AuthRegistry(CephContext *cct) + : cct(cct) +{ + cct->_conf.add_observer(this); +} + +AuthRegistry::~AuthRegistry() +{ + cct->_conf.remove_observer(this); + for (auto i : authorize_handlers) { + delete i.second; + } +} + const char** AuthRegistry::get_tracked_conf_keys() const { static const char *keys[] = { @@ -23,6 +37,12 @@ const char** AuthRegistry::get_tracked_conf_keys() const "auth_client_required", "auth_cluster_required", "auth_service_required", + "ms_mon_cluster_mode", + "ms_mon_service_mode", + "ms_mon_client_mode", + "ms_cluster_mode", + "ms_service_mode", + "ms_client_mode", "keyring", NULL }; @@ -338,9 +358,3 @@ AuthAuthorizeHandler *AuthRegistry::get_handler(int peer_type, int method) return ah; } -AuthRegistry::~AuthRegistry() -{ - for (auto i : authorize_handlers) { - delete i.second; - } -} diff --git a/src/auth/AuthRegistry.h b/src/auth/AuthRegistry.h index 72335e1b156f..ce55dca0c8c7 100644 --- a/src/auth/AuthRegistry.h +++ b/src/auth/AuthRegistry.h @@ -38,8 +38,7 @@ class AuthRegistry : public md_config_obs_t { void _refresh_config(); public: - AuthRegistry(CephContext *cct) : cct(cct) { - } + AuthRegistry(CephContext *cct); ~AuthRegistry(); void refresh_config() {