[cpp-sp] branch maint-3 updated: Clean up some error paths.

Codeberg noreply at shibboleth.net
Thu Sep 10 18:37:43 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch maint-3
in repository cpp-sp.

View the commit online:
https://codeberg.org/Shibboleth/cpp-sp/commit/d5c64f5b2618f8e2154e3bd085c9ee94c8800406

The following commit(s) were added to refs/heads/maint-3 by this push:
     new d5c64f5b Clean up some error paths.
d5c64f5b is described below

commit d5c64f5b2618f8e2154e3bd085c9ee94c8800406
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Thu Sep 10 14:37:34 2026 -0400

    Clean up some error paths.
---
 util/mdquery.cpp | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/util/mdquery.cpp b/util/mdquery.cpp
index 20424698..38611c64 100644
--- a/util/mdquery.cpp
+++ b/util/mdquery.cpp
@@ -144,7 +144,15 @@ int main(int argc,char* argv[])
         return -3;
     }
 
-    app->getMetadataProvider()->lock();
+    MetadataProvider* mp = app->getMetadataProvider(false);
+    if (mp == nullptr) {
+        log.error("MetadataProvider not available");
+        sp->unlock();
+        conf.term();
+        return -4;
+    }
+
+    mp->lock();
     MetadataProviderCriteria mc(*app, entityID, nullptr, nullptr, strict);
     if (rname) {
         const XMLCh* ns = rns ? XMLString::transcode(rns) : samlconstants::SAML20MD_NS;
@@ -152,22 +160,21 @@ int main(int argc,char* argv[])
         QName q(ns, n.get());
         mc.role = &q;
         mc.protocol = protocol;
-        const RoleDescriptor* role = app->getMetadataProvider()->getEntityDescriptor(mc).second;
+        const RoleDescriptor* role = mp->getEntityDescriptor(mc).second;
         if (role)
             XMLHelper::serialize(role->marshall(), cout, true);
         else
             log.error("compatible role %s not found for (%s)", q.toString().c_str(), entityID);
     }
     else {
-        const EntityDescriptor* entity = app->getMetadataProvider()->getEntityDescriptor(mc).first;
+        const EntityDescriptor* entity = mp->getEntityDescriptor(mc).first;
         if (entity)
             XMLHelper::serialize(entity->marshall(), cout, true);
         else
             log.error("no metadata found for (%s)", entityID);
     }
 
-    app->getMetadataProvider()->unlock();
-
+    mp->unlock();
     sp->unlock();
     conf.term();
     return 0;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list