Linux porting changes
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 31 May 2007 20:44:09 +0000 (20:44 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 31 May 2007 20:44:09 +0000 (20:44 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2276 cb58f699-b61c-0410-a6fe-9272a202ed29

15 files changed:
apache/mod_apache.cpp
configure.ac
schemas/Makefile.am
shibd/shibd.cpp
shibsp/Makefile.am
shibsp/binding/impl/SOAPClient.cpp
shibsp/handler/impl/AssertionLookup.cpp
shibsp/handler/impl/SAML1Consumer.cpp
shibsp/handler/impl/SAML2Consumer.cpp
shibsp/handler/impl/Shib1SessionInitiator.cpp
shibsp/handler/impl/WAYFSessionInitiator.cpp
shibsp/impl/XMLRequestMapper.cpp
shibsp/impl/XMLServiceProvider.cpp
shibsp/remoting/impl/SocketListener.cpp
shibsp/remoting/impl/ddf.cpp

index 417892f..2d77272 100644 (file)
@@ -41,7 +41,7 @@
 #include <shibsp/ServiceProvider.h>
 #include <shibsp/SessionCache.h>
 #include <shibsp/attribute/Attribute.h>
-
+#include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/regx/RegularExpression.hpp>
 #include <xmltooling/XMLToolingConfig.h>
 #include <xmltooling/util/NDC.h>
index dd0c0da..f94e281 100644 (file)
@@ -170,7 +170,7 @@ LIBS="$XMLSEC_LIBS $LIBS"
 AC_CHECK_HEADER([saml/saml.h],,
                 AC_MSG_ERROR([unable to find saml header files]))
 AC_TRY_LINK(
-       [#include <saml/saml.h>
+       [#include <saml/SAMLConfig.h>
 #include <saml/version.h>],
        [#if _OPENSAML_VERSION >= 20000
 opensaml::SAMLConfig::getConfig();
@@ -186,9 +186,9 @@ LIBS="$save_LIBS"
 AC_SUBST(XMLSEC_LIBS)
 
 # output the underlying makefiles
-WANT_SUBDIRS="doc schemas configs shibsp shibd siterefresh util"
+WANT_SUBDIRS="doc schemas configs shibsp shibd util"
 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
-       configs/Makefile shibsp/Makefile shibd/Makefile siterefresh/Makefile \
+       configs/Makefile shibsp/Makefile shibd/Makefile \
        util/Makefile selinux/Makefile])
 
 #
index 5827db9..84c9e99 100644 (file)
@@ -5,14 +5,13 @@ AUTOMAKE_OPTIONS = foreign
 pkgxmldir = $(datadir)/xml/@PACKAGE@
 
 schemafiles = \
-       shibboleth.xsd \
+    shibboleth.xsd \
     shibboleth-metadata-1.0.xsd \
-    shibboleth-2.0-native-sp-config-2.0.xsd \
+    shibboleth-2.0-native-sp-config.xsd \
     shibboleth-2.0-afp.xsd \
     shibboleth-2.0-afp-mf-basic.xsd \
     shibboleth-2.0-afp-mf-saml.xsd \
     shibboleth-2.0-attribute-map.xsd \
-    shibboleth-2.0-simple-resolver.xsd \
     metadata_v12_to_v13.xsl \
     metadata_v13_to_v12.xsl \
     trust_v13_to_v12.xsl
index fbe7662..973645a 100644 (file)
@@ -292,9 +292,9 @@ int main(int argc, char *argv[])
         fprintf(stderr, "loading configuration file: %s\n", shar_config);\r
         static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h);\r
         static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);\r
-        DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();\r
-        XercesJanitor<DOMDocument> docjanitor(dummydoc);\r
-        DOMElement* dummy = dummydoc->createElementNS(NULL,path);\r
+        xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();\r
+        XercesJanitor<xercesc::DOMDocument> docjanitor(dummydoc);\r
+        xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path);\r
         auto_ptr_XMLCh src(shar_config);\r
         dummy->setAttributeNS(NULL,path,src.get());\r
         dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);\r
index 87dbc94..8666ca6 100644 (file)
@@ -142,28 +142,28 @@ libshibsp_la_SOURCES = \
        attribute/NameIDAttributeDecoder.cpp \
        attribute/ScopedAttributeDecoder.cpp \
        attribute/StringAttributeDecoder.cpp \
-       attribute/filtering/AttributeFilter.cpp \
-       attribute/filtering/ChainingAttributeFilter.cpp \
-       attribute/filtering/XMLAttributeFilter.cpp \
-       attribute/filtering/MatchFunctor.cpp \
-       attribute/filtering/AndMatchFunctor.cpp \
-       attribute/filtering/AnyMatchFunctor.cpp \
-       attribute/filtering/NotMatchFunctor.cpp \
-       attribute/filtering/OrMatchFunctor.cpp \
-       attribute/filtering/AttributeIssuerStringFunctor.cpp \
-       attribute/filtering/AttributeRequesterStringFunctor.cpp \
-       attribute/filtering/AttributeScopeStringFunctor.cpp \
-       attribute/filtering/AttributeValueStringFunctor.cpp \
-       attribute/filtering/AuthenticationMethodStringFunctor.cpp \
-       attribute/filtering/AttributeIssuerRegexFunctor.cpp \
-       attribute/filtering/AttributeRequesterRegexFunctor.cpp \
-       attribute/filtering/AttributeScopeRegexFunctor.cpp \
-       attribute/filtering/AttributeValueRegexFunctor.cpp \
-       attribute/filtering/AuthenticationMethodRegexFunctor.cpp \
-       attribute/filtering/NumberOfAttributeValuesFunctor.cpp \
-       attribute/filtering/AttributeIssuerInEntityGroupFunctor.cpp \
-       attribute/filtering/AttributeRequesterInEntityGroupFunctor.cpp \
-       attribute/filtering/AttributeScopeMatchesShibMDScopeFunctor.cpp \
+       attribute/filtering/impl/AttributeFilter.cpp \
+       attribute/filtering/impl/ChainingAttributeFilter.cpp \
+       attribute/filtering/impl/XMLAttributeFilter.cpp \
+       attribute/filtering/impl/MatchFunctor.cpp \
+       attribute/filtering/impl/AndMatchFunctor.cpp \
+       attribute/filtering/impl/AnyMatchFunctor.cpp \
+       attribute/filtering/impl/NotMatchFunctor.cpp \
+       attribute/filtering/impl/OrMatchFunctor.cpp \
+       attribute/filtering/impl/AttributeIssuerStringFunctor.cpp \
+       attribute/filtering/impl/AttributeRequesterStringFunctor.cpp \
+       attribute/filtering/impl/AttributeScopeStringFunctor.cpp \
+       attribute/filtering/impl/AttributeValueStringFunctor.cpp \
+       attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp \
+       attribute/filtering/impl/AttributeIssuerRegexFunctor.cpp \
+       attribute/filtering/impl/AttributeRequesterRegexFunctor.cpp \
+       attribute/filtering/impl/AttributeScopeRegexFunctor.cpp \
+       attribute/filtering/impl/AttributeValueRegexFunctor.cpp \
+       attribute/filtering/impl/AuthenticationMethodRegexFunctor.cpp \
+       attribute/filtering/impl/NumberOfAttributeValuesFunctor.cpp \
+       attribute/filtering/impl/AttributeIssuerInEntityGroupFunctor.cpp \
+       attribute/filtering/impl/AttributeRequesterInEntityGroupFunctor.cpp \
+       attribute/filtering/impl/AttributeScopeMatchesShibMDScopeFunctor.cpp \
        attribute/resolver/impl/ChainingAttributeResolver.cpp \
        attribute/resolver/impl/QueryAttributeResolver.cpp \
        attribute/resolver/impl/XMLAttributeExtractor.cpp \
index 9e1158f..0cb3a4e 100644 (file)
@@ -189,4 +189,5 @@ void SOAPClient::reset()
         m_credResolver->unlock();
     m_credResolver = NULL;
     opensaml::SOAPClient::reset();
-}
\ No newline at end of file
+}
+
index 86e9657..b3b7b97 100644 (file)
@@ -97,7 +97,7 @@ pair<bool,long> AssertionLookup::run(SPRequest& request, bool isHandler) const
     SPConfig& conf = SPConfig::getConfig();
     if (conf.isEnabled(SPConfig::InProcess)) {
         if (m_acl.count(request.getRemoteAddr()) == 0) {
-            m_log.error("request for assertion lookup blocked from invalid address (%s)", request.getRemoteAddr());
+            m_log.error("request for assertion lookup blocked from invalid address (%s)", request.getRemoteAddr().c_str());
             istringstream msg("Assertion Lookup Blocked");
             return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_FORBIDDEN));
         }
index c2870ee..dc3508e 100644 (file)
@@ -201,7 +201,7 @@ string SAML1Consumer::implementProtocol(
 
     // Session expiration for SAML 1.x is purely SP-driven, and the method is mapped to a ctx class.
     const PropertySet* sessionProps = application.getPropertySet("Sessions");
-    pair<bool,unsigned int> lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : make_pair(true,28800);
+    pair<bool,unsigned int> lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair<bool,unsigned int>(true,28800);
     if (!lifetime.first)
         lifetime.second = 28800;
     auto_ptr_char authnInstant(
index dfe89f5..b574db7 100644 (file)
@@ -41,6 +41,9 @@ using namespace opensaml::saml2;
 using namespace opensaml::saml2p;
 using namespace opensaml::saml2md;
 using namespace opensaml;
+# ifndef min
+#  define min(a,b)            (((a) < (b)) ? (a) : (b))
+# endif
 #endif
 
 using namespace shibsp;
@@ -325,7 +328,7 @@ string SAML2Consumer::implementProtocol(
     // Session expiration for SAML 2.0 is jointly IdP- and SP-driven.
     time_t sessionExp = ssoStatement->getSessionNotOnOrAfter() ? ssoStatement->getSessionNotOnOrAfterEpoch() : 0;
     const PropertySet* sessionProps = application.getPropertySet("Sessions");
-    pair<bool,unsigned int> lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : make_pair(true,28800);
+    pair<bool,unsigned int> lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair<bool,unsigned int>(true,28800);
     if (!lifetime.first)
         lifetime.second = 28800;
     if (lifetime.second != 0) {
index d98b608..e1fbc90 100644 (file)
@@ -251,7 +251,7 @@ pair<bool,long> Shib1SessionInitiator::doRequest(
         relayState = "default";
 
     char timebuf[16];
-    sprintf(timebuf,"%u",time(NULL));
+    sprintf(timebuf,"%lu",time(NULL));
     const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder();
     auto_ptr_char dest(ep->getLocation());
     string req=string(dest.get()) + (strchr(dest.get(),'?') ? '&' : '?') + "shire=" + urlenc->encode(acsLocation) +
index be55d48..0d5e541 100644 (file)
@@ -137,7 +137,7 @@ pair<bool,long> WAYFSessionInitiator::run(SPRequest& request, const char* entity
         target = "default";
 
     char timebuf[16];
-    sprintf(timebuf,"%u",time(NULL));
+    sprintf(timebuf,"%lu",time(NULL));
     const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder();
     string req=string(m_url) + (strchr(m_url,'?') ? '&' : '?') + "shire=" + urlenc->encode(ACSloc.c_str()) +
         "&time=" + timebuf + "&target=" + urlenc->encode(target.c_str()) +
index e69a00f..5cfe91d 100644 (file)
@@ -145,7 +145,7 @@ namespace shibsp {
     static const XMLCh Host[] =                     UNICODE_LITERAL_4(H,o,s,t);\r
     static const XMLCh Path[] =                     UNICODE_LITERAL_4(P,a,t,h);\r
     static const XMLCh name[] =                     UNICODE_LITERAL_4(n,a,m,e);\r
-    static const XMLCh type[] =                     UNICODE_LITERAL_4(t,y,p,e);\r
+    static const XMLCh _type[] =                    UNICODE_LITERAL_4(t,y,p,e);\r
 }\r
 \r
 void SHIBSP_API shibsp::registerRequestMappers()\r
@@ -190,7 +190,7 @@ void Override::loadACL(const DOMElement* e, Category& log)
             else {\r
                 acl=XMLHelper::getFirstChildElement(e,AccessControlProvider);\r
                 if (acl) {\r
-                    xmltooling::auto_ptr_char type(acl->getAttributeNS(NULL,type));\r
+                    auto_ptr_char type(acl->getAttributeNS(NULL,_type));\r
                     log.info("building AccessControl provider of type %s...",type.get());\r
                     m_acl=SPConfig::getConfig().AccessControlManager.newPlugin(type.get(),acl);\r
                 }\r
index b886e93..ad339fa 100644 (file)
@@ -373,7 +373,7 @@ namespace {
     static const XMLCh _CredentialResolver[] =  UNICODE_LITERAL_18(C,r,e,d,e,n,t,i,a,l,R,e,s,o,l,v,e,r);
     static const XMLCh DefaultRelyingParty[] =  UNICODE_LITERAL_19(D,e,f,a,u,l,t,R,e,l,y,i,n,g,P,a,r,t,y);
     static const XMLCh _Extensions[] =          UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s);
-    static const XMLCh fatal[] =                UNICODE_LITERAL_5(f,a,t,a,l);
+    static const XMLCh _fatal[] =               UNICODE_LITERAL_5(f,a,t,a,l);
     static const XMLCh _Handler[] =             UNICODE_LITERAL_7(H,a,n,d,l,e,r);
     static const XMLCh _id[] =                  UNICODE_LITERAL_2(i,d);
     static const XMLCh Implementation[] =       UNICODE_LITERAL_14(I,m,p,l,e,m,e,n,t,a,t,i,o,n);
@@ -1005,7 +1005,7 @@ void XMLConfigImpl::doExtensions(const DOMElement* e, const char* label, Categor
                 }
             }
             catch (exception& e) {
-                const XMLCh* fatal=exts->getAttributeNS(NULL,fatal);
+                const XMLCh* fatal=exts->getAttributeNS(NULL,_fatal);
                 if (fatal && (*fatal==chLatin_t || *fatal==chDigit_1)) {
                     log.fatal("unable to load mandatory %s extension library %s: %s", label, path.get(), e.what());
                     throw;
index 17cecb9..c67958e 100644 (file)
@@ -30,8 +30,8 @@
 #include <shibsp/SPConfig.h>
 #include <xmltooling/util/NDC.h>
 
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
+#ifndef WIN32
+# include <netinet/in.h>
 #endif
 
 using namespace shibsp;
@@ -54,9 +54,9 @@ namespace shibsp {
   
     private:
         SocketListener::ShibSocket connect();
-        
+       
+        Category& m_log; 
         const SocketListener* m_listener;
-        Category& m_log;
         auto_ptr<Mutex> m_lock;
         stack<SocketListener::ShibSocket> m_pool;
     };
@@ -155,7 +155,7 @@ void SocketPool::put(SocketListener::ShibSocket s)
 }
 
 SocketListener::SocketListener(const DOMElement* e) : log(&Category::getInstance(SHIBSP_LOGCAT".Listener")),
-    m_shutdown(NULL), m_child_lock(NULL), m_child_wait(NULL), m_socketpool(NULL), m_socket((ShibSocket)0)
+    m_socketpool(NULL), m_shutdown(NULL), m_child_lock(NULL), m_child_wait(NULL), m_socket((ShibSocket)0)
 {
     // Are we a client?
     if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
index 6fe18f6..38db272 100644 (file)
@@ -896,6 +896,7 @@ SHIBSP_API ostream& shibsp::operator<<(ostream& os, const DDF& obj)
 // This is a DTD internal subset based on a compatible permutation of the WDDX spec, with the
 // extension of a name attribute on all the typed elements, which DDF has, but WDDX does not.
 
+/*
 static const char* g_DocType=
 "\
 <!DOCTYPE wddxPacket [\n\
@@ -919,6 +920,7 @@ static const char* g_DocType=
 <!ELEMENT var (null | number | string | array | struct)>\n\
 <!ATTLIST var name CDATA #REQUIRED>\n\
 ]>\n";
+*/
 
 // This function constructs a DDF object equivalent to the wddx data element rooted
 // by the input.