SSPCPP-616 - fix tuple namespaces and string literal errors
[shibboleth/cpp-sp.git] / shibsp / impl / XMLServiceProvider.cpp
index d719d42..59c86eb 100644 (file)
@@ -304,7 +304,7 @@ namespace {
 #ifndef SHIBSP_LITE
         scoped_ptr<TransactionLog> m_tranLog;
         scoped_ptr<SecurityPolicyProvider> m_policy;
-        vector< tuple<string,string,string> > m_transportOptions;
+        vector< boost::tuple<string,string,string> > m_transportOptions;
 #endif
         scoped_ptr<RequestMapper> m_requestMapper;
         map< string,boost::shared_ptr<Application> > m_appmap;
@@ -335,7 +335,7 @@ namespace {
 #endif
     {
     public:
-        XMLConfig(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT".Config")) {}
+        XMLConfig(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT ".Config")) {}
 
         void init() {
             background_load();
@@ -439,7 +439,7 @@ namespace {
 
         bool setTransportOptions(SOAPTransport& transport) const {
             bool ret = true;
-            for (vector< tuple<string,string,string> >::const_iterator opt = m_impl->m_transportOptions.begin();
+            for (vector< boost::tuple<string,string,string> >::const_iterator opt = m_impl->m_transportOptions.begin();
                     opt != m_impl->m_transportOptions.end(); ++opt) {
                 if (!transport.setProviderOption(opt->get<0>().c_str(), opt->get<1>().c_str(), opt->get<2>().c_str())) {
                     m_log.error("failed to set SOAPTransport option (%s)", opt->get<1>().c_str());
@@ -544,7 +544,7 @@ XMLApplication::XMLApplication(
 #ifdef _DEBUG
     xmltooling::NDC ndc("XMLApplication");
 #endif
-    Category& log = Category::getInstance(SHIBSP_LOGCAT".Application");
+    Category& log = Category::getInstance(SHIBSP_LOGCAT ".Application");
 
     // First load any property sets.
     map<string,string> remapper;
@@ -576,6 +576,7 @@ XMLApplication::XMLApplication(
                 prop = sessionProps->getString("redirectWhitelist");
                 if (prop.first) {
                     string dup(prop.second);
+                    trim(dup);
                     split(m_redirectWhitelist, dup, is_space(), algorithm::token_compress_on);
                 }
             }
@@ -832,6 +833,7 @@ void XMLApplication::doAttributeInfo()
     pair<bool,const char*> attributes = getString("REMOTE_USER");
     if (attributes.first) {
         string dup(attributes.second);
+        trim(dup);
         split(m_remoteUsers, dup, is_space(), algorithm::token_compress_on);
     }
 
@@ -851,6 +853,7 @@ void XMLApplication::doAttributeInfo()
             }
 
             string dup(attributes.second);
+            trim(dup);
             vector<string> headerNames;
             split(headerNames, dup, is_space(), algorithm::token_compress_on);
             for (vector<string>::const_iterator h = headerNames.begin(); h != headerNames.end(); ++h) {
@@ -1793,7 +1796,7 @@ void XMLApplication::limitRedirect(const GenericRequest& request, const char* ur
                 boost::bind(startsWithI, url, boost::bind(&string::c_str, _1))) != m_redirectWhitelist.end()) {
             return;
         }
-        Category::getInstance(SHIBSP_LOGCAT".Application").warn("redirectLimit policy enforced, blocked redirect to (%s)", url);
+        Category::getInstance(SHIBSP_LOGCAT ".Application").warn("redirectLimit policy enforced, blocked redirect to (%s)", url);
         throw opensaml::SecurityPolicyException("Blocked unacceptable redirect location.");
     }
 }
@@ -2068,6 +2071,7 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, XMLConfig* outer,
         if (unsafe.first) {
             HTTPResponse::getAllowedSchemes().clear();
             string schemes(unsafe.second);
+            trim(schemes);
             split(HTTPResponse::getAllowedSchemes(), schemes, is_space(), algorithm::token_compress_on);
         }
 
@@ -2190,7 +2194,7 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, XMLConfig* outer,
             string option(XMLHelper::getAttrString(child, nullptr, _option));
             auto_ptr_char value(child->getFirstChild()->getNodeValue());
             if (!provider.empty() && !option.empty() && value.get() && *value.get()) {
-                m_transportOptions.push_back(make_tuple(provider, option, string(value.get())));
+                m_transportOptions.push_back(boost::make_tuple(provider, option, string(value.get())));
             }
         }
         child = XMLHelper::getPreviousSiblingElement(child, TransportOption);
@@ -2237,6 +2241,7 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, XMLConfig* outer,
             pair<bool,const char*> extraAuthTypes = inprocs->getString("extraAuthTypes");
             if (extraAuthTypes.first) {
                 string types(extraAuthTypes.second);
+                trim(types);
                 split(outer->m_authTypes, types, is_space(), algorithm::token_compress_on);
                 outer->m_authTypes.insert("shibboleth");
             }
@@ -2266,7 +2271,7 @@ void XMLConfig::receive(DDF& in, ostream& out)
             }
         }
         else {
-            Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error(
+            Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").error(
                 "Storage-backed RelayState with invalid StorageService ID (%s)", id
                 );
         }
@@ -2293,7 +2298,7 @@ void XMLConfig::receive(DDF& in, ostream& out)
                 storage->createText("RelayState", rsKey.c_str(), value, time(nullptr) + 600);
         }
         else {
-            Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error(
+            Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").error(
                 "Storage-backed RelayState with invalid StorageService ID (%s)", id
                 );
         }
@@ -2317,7 +2322,7 @@ void XMLConfig::receive(DDF& in, ostream& out)
             }
         }
         else {
-            Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error(
+            Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").error(
                 "Storage-backed PostData with invalid StorageService ID (%s)", id
                 );
         }
@@ -2347,7 +2352,7 @@ void XMLConfig::receive(DDF& in, ostream& out)
             storage->createText("PostData", rsKey.c_str(), params.str().c_str(), time(nullptr) + 600);
         }
         else {
-            Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error(
+            Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").error(
                 "Storage-backed PostData with invalid StorageService ID (%s)", id
                 );
         }