Fix for bug #74.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 28 Oct 2003 03:55:07 +0000 (03:55 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 28 Oct 2003 03:55:07 +0000 (03:55 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@712 cb58f699-b61c-0410-a6fe-9272a202ed29

shib-target/shib-config.cpp

index ed1b3e3..f4562a0 100644 (file)
@@ -246,12 +246,29 @@ void STConfig::init()
     ShibINI::Iterator* iter=ini->tag_iterator(tag);
     for (const string* prov=iter->begin(); prov; prov=iter->next())
     {
-        const string source=ini->get(tag,*prov);
-        log.info("registering metadata provider: type=%s, source=%s",prov->c_str(),source.c_str());
-        if (!shibConf.addMetadata(prov->c_str(),source.c_str()))
+        string sources=ini->get(tag,*prov);
+        int j = 0;
+        for (int i = 0; i < sources.length(); i++)
         {
-            log.crit("error adding metadata provider: type=%s, source=%s",prov->c_str(),source.c_str());
-            if (!strcmp(app.c_str(), SHIBTARGET_SHAR))
+            if (sources.at(i) == ';')
+            {
+                string val = sources.substr(j, i-j);
+                j = i+1;
+                log.info("registering metadata provider: type=%s, source=%s",prov->c_str(),val.c_str());
+                if (!shibConf.addMetadata(prov->c_str(),val.c_str()))
+                {
+                    log.crit("error adding metadata provider: type=%s, source=%s",prov->c_str(),val.c_str());
+                    if (app == SHIBTARGET_SHAR)
+                        throw runtime_error("error adding metadata provider");
+                }
+            }
+        }
+        string val = sources.substr(j, sources.length()-j);
+        log.info("registering metadata provider: type=%s, source=%s",prov->c_str(),val.c_str());
+        if (!shibConf.addMetadata(prov->c_str(),val.c_str()))
+        {
+            log.crit("error adding metadata provider: type=%s, source=%s",prov->c_str(),val.c_str());
+            if (app == SHIBTARGET_SHAR)
                 throw runtime_error("error adding metadata provider");
         }
     }