From 4ac9c8324237efd6778cfa6e41e4ae5dd5f3394f Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 19 Aug 2025 21:36:34 -0400 Subject: [PATCH] auth: add debugging for client cephx methods In particular, to see when an auth helper is created/destroyed. Signed-off-by: Patrick Donnelly (cherry picked from commit 23f0345b73093593aa5d5672b7d2b6b9f1b2f8ea) --- src/auth/cephx/CephxClientHandler.cc | 17 ++++++++++++++++- src/auth/cephx/CephxClientHandler.h | 24 +++++++----------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/auth/cephx/CephxClientHandler.cc b/src/auth/cephx/CephxClientHandler.cc index 9515cecc6d1..e39b35d16c4 100644 --- a/src/auth/cephx/CephxClientHandler.cc +++ b/src/auth/cephx/CephxClientHandler.cc @@ -26,12 +26,27 @@ #define dout_subsys ceph_subsys_auth #undef dout_prefix -#define dout_prefix *_dout << "cephx client: " +#define dout_prefix *_dout << "cephx_client(" << this << "): " using std::string; using ceph::bufferlist; +CephxClientHandler::CephxClientHandler(CephContext *cct_, RotatingKeyRing *rsecrets) + : AuthClientHandler(cct_), + tickets(cct_), + rotating_secrets(rsecrets), + keyring(rsecrets->get_keyring()) +{ + ldout(cct, 20) << "con" << dendl; + reset(); +} + +CephxClientHandler::~CephxClientHandler() +{ + ldout(cct, 20) << "des" << dendl; +} + void CephxClientHandler::reset() { ldout(cct,10) << __func__ << dendl; diff --git a/src/auth/cephx/CephxClientHandler.h b/src/auth/cephx/CephxClientHandler.h index e9dd1107114..9b01669fcc3 100644 --- a/src/auth/cephx/CephxClientHandler.h +++ b/src/auth/cephx/CephxClientHandler.h @@ -23,30 +23,20 @@ class KeyRing; class CephxClientHandler : public AuthClientHandler { - bool starting; + bool starting = false; /* envelope protocol parameters */ - uint64_t server_challenge; + uint64_t server_challenge = 0; CephXTicketManager tickets; - CephXTicketHandler* ticket_handler; + CephXTicketHandler* ticket_handler = nullptr; - RotatingKeyRing* rotating_secrets; - KeyRing *keyring; + RotatingKeyRing* rotating_secrets = nullptr; + KeyRing *keyring = nullptr; public: - CephxClientHandler(CephContext *cct_, - RotatingKeyRing *rsecrets) - : AuthClientHandler(cct_), - starting(false), - server_challenge(0), - tickets(cct_), - ticket_handler(NULL), - rotating_secrets(rsecrets), - keyring(rsecrets->get_keyring()) - { - reset(); - } + CephxClientHandler(CephContext *cct_, RotatingKeyRing *rsecrets); + ~CephxClientHandler(); CephxClientHandler* clone() const override { return new CephxClientHandler(*this); -- 2.39.5