Solaris port fixes.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 15 Nov 2007 18:37:39 +0000 (18:37 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 15 Nov 2007 18:37:39 +0000 (18:37 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2618 cb58f699-b61c-0410-a6fe-9272a202ed29

shibsp/AbstractSPRequest.cpp
shibsp/ServiceProvider.cpp
shibsp/attribute/ScopedAttribute.h
shibsp/attribute/filtering/BasicFilteringContext.h
shibsp/handler/impl/AbstractHandler.cpp
shibsp/handler/impl/AssertionConsumerService.cpp
shibsp/handler/impl/LogoutHandler.cpp
shibsp/handler/impl/RemotedHandler.cpp

index dffe00c..bdceb28 100644 (file)
@@ -113,51 +113,51 @@ Session* AbstractSPRequest::getSession(bool checkTimeout, bool ignoreAddress, bo
     return session;
 }
 
-static char _x2c(const char *what)\r
-{\r
-    register char digit;\r
-\r
-    digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 : (what[0] - '0'));\r
-    digit *= 16;\r
-    digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A')+10 : (what[1] - '0'));\r
-    return(digit);\r
-}\r
+static char _x2c(const char *what)
+{
+    register char digit;
+
+    digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 : (what[0] - '0'));
+    digit *= 16;
+    digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A')+10 : (what[1] - '0'));
+    return(digit);
+}
 
 void AbstractSPRequest::setRequestURI(const char* uri)
 {
-    // Fix for bug 574, secadv 20061002\r
-    // Unescape URI up to query string delimiter by looking for %XX escapes.\r
-    // Adapted from Apache's util.c, ap_unescape_url function.\r
-    if (uri) {\r
-        while (*uri) {\r
-            if (*uri == '?') {\r
-                m_uri += uri;\r
-                break;\r
-            }\r
-            else if (*uri == ';') {\r
-                // If this is Java being stupid, skip everything up to the query string, if any.\r
-                if (!strncmp(uri, ";jsessionid=", 12)) {\r
-                    if (uri = strchr(uri, '?'))\r
-                        m_uri += uri;\r
-                    break;\r
-                }\r
-                else {\r
-                    m_uri += *uri;\r
-                }\r
-            }\r
-            else if (*uri != '%') {\r
-                m_uri += *uri;\r
-            }\r
-            else {\r
-                ++uri;\r
-                if (!isxdigit(*uri) || !isxdigit(*(uri+1)))\r
-                    throw ConfigurationException("Bad request, contained unsupported encoded characters.");\r
-                m_uri += _x2c(uri);\r
-                ++uri;\r
-            }\r
-            ++uri;\r
-        }\r
-    }\r
+    // Fix for bug 574, secadv 20061002
+    // Unescape URI up to query string delimiter by looking for %XX escapes.
+    // Adapted from Apache's util.c, ap_unescape_url function.
+    if (uri) {
+        while (*uri) {
+            if (*uri == '?') {
+                m_uri += uri;
+                break;
+            }
+            else if (*uri == ';') {
+                // If this is Java being stupid, skip everything up to the query string, if any.
+                if (!strncmp(uri, ";jsessionid=", 12)) {
+                    if (uri = strchr(uri, '?'))
+                        m_uri += uri;
+                    break;
+                }
+                else {
+                    m_uri += *uri;
+                }
+            }
+            else if (*uri != '%') {
+                m_uri += *uri;
+            }
+            else {
+                ++uri;
+                if (!isxdigit(*uri) || !isxdigit(*(uri+1)))
+                    throw ConfigurationException("Bad request, contained unsupported encoded characters.");
+                m_uri += _x2c(uri);
+                ++uri;
+            }
+            ++uri;
+        }
+    }
 }
 
 const char* AbstractSPRequest::getRequestURL() const
index 22fbfe4..e441e3c 100644 (file)
@@ -238,7 +238,7 @@ pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handl
         // We're done.  Everything is okay.  Nothing to report.  Nothing to do..
         // Let the caller decide how to proceed.
         request.log(SPRequest::SPDebug, "doAuthentication succeeded");
-        return make_pair(false,0);
+        return make_pair(false,0L);
     }
     catch (exception& e) {
         TemplateParameters tp(&e);
@@ -345,7 +345,7 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
                if (requireSession)
                 throw opensaml::RetryableProfileException("Unable to obtain session to export to request.");
                else
-                       return make_pair(false,0);      // just bail silently
+                       return make_pair(false,0L);     // just bail silently
         }
         
         request.setHeader("Shib-Application-ID", app->getId());
@@ -429,7 +429,7 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
             request.setHeader(a->first.c_str(), header.c_str());
         }
 
-        return make_pair(false,0);
+        return make_pair(false,0L);
     }
     catch (exception& e) {
         TemplateParameters tp(&e);
index 5c87fe8..d72cd0c 100644 (file)
@@ -66,7 +66,7 @@ namespace shibsp {
                 m_delimeter = static_cast<char>(val.integer());
             val = in.first().first();
             while (val.name() && val.string()) {
-                m_values.push_back(std::make_pair(val.name(), val.string()));
+                m_values.push_back(std::make_pair(std::string(val.name()), std::string(val.string())));
                 val = in.first().next();
             }
         }
index 2207941..6c66f57 100644 (file)
@@ -49,7 +49,7 @@ namespace shibsp {
             if (role)
                 m_issuer = dynamic_cast<opensaml::saml2md::EntityDescriptor*>(role->getParent())->getEntityID();
             for (std::vector<Attribute*>::const_iterator a = attributes.begin(); a != attributes.end(); ++a)
-                m_attributes.insert(std::make_pair((*a)->getId(), *a));
+                m_attributes.insert(std::multimap<std::string,Attribute*>::value_type((*a)->getId(), *a));
         }
 
         virtual ~BasicFilteringContext() {}
index d7cd79b..e1f3801 100644 (file)
@@ -183,7 +183,7 @@ long AbstractHandler::sendMessage(
 {
     const EntityDescriptor* entity = role ? dynamic_cast<const EntityDescriptor*>(role->getParent()) : NULL;
     const PropertySet* relyingParty = application.getRelyingParty(entity);
-    pair<bool,const char*> flag = signIfPossible ? make_pair(true,"true") : relyingParty->getString("signing");
+    pair<bool,const char*> flag = signIfPossible ? make_pair(true,(const char*)"true") : relyingParty->getString("signing");
     if (role && flag.first &&
         (!strcmp(flag.second, "true") ||
             (encoder.isUserAgentPresent() && !strcmp(flag.second, "front")) ||
index 57dacb3..2499eeb 100644 (file)
@@ -69,7 +69,7 @@ AssertionConsumerService::AssertionConsumerService(const DOMElement* e, const ch
 #ifndef SHIBSP_LITE
     if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
         m_decoder = SAMLConfig::getConfig().MessageDecoderManager.newPlugin(
-            getString("Binding").second,make_pair(e,shibspconstants::SHIB2SPCONFIG_NS)
+            getString("Binding").second, pair<const DOMElement*,const XMLCh*>(e,shibspconstants::SHIB2SPCONFIG_NS)
             );
         m_decoder->setArtifactResolver(SPConfig::getConfig().getArtifactResolver());
     }
index 336492f..695db99 100644 (file)
@@ -64,18 +64,18 @@ pair<bool,long> LogoutHandler::run(SPRequest& request, bool isHandler) const
 {
     // If we're inside a chain, so do nothing.
     if (getParent())
-        return make_pair(false,0);
+        return make_pair(false,0L);
     
     // If this isn't a LogoutInitiator, we only "continue" a notification loop, rather than starting one.
     if (!m_initiator && !request.getParameter("notifying"))
-        return make_pair(false,0);
+        return make_pair(false,0L);
 
     // Try another front-channel notification. No extra parameters and the session is implicit.
     pair<bool,long> ret = notifyFrontChannel(request.getApplication(), request, request);
     if (ret.first)
         return ret;
 
-    return make_pair(false,0);
+    return make_pair(false,0L);
 }
 
 void LogoutHandler::receive(DDF& in, ostream& out)
@@ -123,7 +123,7 @@ pair<bool,long> LogoutHandler::notifyFrontChannel(
     // Fetch the next front notification URL and bump the index for the next round trip.
     string loc = application.getNotificationURL(request.getRequestURL(), true, index++);
     if (loc.empty())
-        return make_pair(false,0);
+        return make_pair(false,0L);
 
     const URLEncoder* encoder = XMLToolingConfig::getConfig().getURLEncoder();
 
index e2c18ff..238f1e3 100644 (file)
@@ -309,7 +309,7 @@ pair<bool,long> RemotedHandler::unwrap(SPRequest& request, DDF& out) const
         istringstream s(h["data"].string());
         return make_pair(true, request.sendResponse(s, h["status"].integer()));
     }
-    return make_pair(false,0);
+    return make_pair(false,0L);
 }
 
 HTTPRequest* RemotedHandler::getRequest(DDF& in) const