From 3fcbb0bcf2bca58d6ca460ec036dc1a986c9875b Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Fri, 7 Apr 2023 23:51:26 +0530 Subject: [PATCH] mon/AuthMonitor: log when parsing caps fails AuthMonitor::valid_caps() checks whether or not caps are valid by checking if parsing caps is successful. The respective parsing methods print a error message to stderr when parsing fails but none print a log message. Let's add a log entry when parsing fails are caps are known to be invalid. Signed-off-by: Rishabh Dave --- src/mon/AuthMonitor.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 840ca38fcc4..4daffddebf9 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -1334,6 +1334,7 @@ bool AuthMonitor::valid_caps( if (type == "mon") { MonCap moncap; if (!moncap.parse(caps, out)) { + dout(20) << "Parsing MON caps failed. MON cap: " << caps << dendl; return false; } return true; @@ -1346,16 +1347,19 @@ bool AuthMonitor::valid_caps( if (type == "mgr") { MgrCap mgrcap; if (!mgrcap.parse(caps, out)) { + dout(20) << "Parsing MGR caps failed. MGR cap: " << caps << dendl; return false; } } else if (type == "osd") { OSDCap ocap; if (!ocap.parse(caps, out)) { + dout(20) << "Parsing OSD caps failed. OSD cap: " << caps << dendl; return false; } } else if (type == "mds") { MDSAuthCaps mdscap; if (!mdscap.parse(g_ceph_context, caps, out)) { + dout(20) << "Parsing MDS caps failed. MDS cap: " << caps << dendl; return false; } } else { -- 2.47.3