]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrClient: fix open condition 31256/head
authorSage Weil <sage@redhat.com>
Wed, 30 Oct 2019 14:39:47 +0000 (09:39 -0500)
committerSage Weil <sage@redhat.com>
Thu, 31 Oct 2019 02:23:45 +0000 (21:23 -0500)
Do not open a mgr daemon session if we are a client using a non-client
key to authenticate.  This is a bit of a corner case, but it can
happen when using the mon. key do bootstrap functions.

This aligns the MgrClient condition with the mgr/DaemonServer.cc
handle_report condition, which rejects non-daemon client connections
based on the connection entity type, not the auth identity.

Fixes: https://tracker.ceph.com/issues/42566
Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/MgrClient.cc

index 94ff99c390fd9bc1d5b9bed9883872dc4bad83f4..0f24ab8171e178245db234a4532edc773084c49f 100644 (file)
@@ -183,7 +183,7 @@ void MgrClient::reconnect()
 
   // Don't send an open if we're just a client (i.e. doing
   // command-sending, not stats etc)
-  if (!cct->_conf->name.is_client() || service_daemon) {
+  if (msgr->get_mytype() != CEPH_ENTITY_TYPE_CLIENT || service_daemon) {
     _send_open();
   }
 
@@ -574,7 +574,7 @@ int MgrClient::service_daemon_register(
   daemon_dirty_status = true;
 
   // late register?
-  if (cct->_conf->name.is_client() && session && session->con) {
+  if (msgr->get_mytype() != CEPH_ENTITY_TYPE_CLIENT && session && session->con) {
     _send_open();
   }