]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/AuthMonitor: log when parsing caps fails 51004/head
authorRishabh Dave <ridave@redhat.com>
Fri, 7 Apr 2023 18:21:26 +0000 (23:51 +0530)
committerRishabh Dave <ridave@redhat.com>
Tue, 11 Apr 2023 10:26:10 +0000 (15:56 +0530)
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 <ridave@redhat.com>
src/mon/AuthMonitor.cc

index 840ca38fcc4d6fa9a3c61e77965c631bedec743b..4daffddebf96993381427a6d0bfb7fabeef80d96 100644 (file)
@@ -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 {