From: Scott Cantor Date: Thu, 31 May 2007 20:44:09 +0000 (+0000) Subject: Linux porting changes X-Git-Tag: 2.0-alpha1~30 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-sp.git;a=commitdiff_plain;h=f60329c65a91669111c367840369dc2d4c84fc18 Linux porting changes --- diff --git a/apache/mod_apache.cpp b/apache/mod_apache.cpp index 417892f..2d77272 100644 --- a/apache/mod_apache.cpp +++ b/apache/mod_apache.cpp @@ -41,7 +41,7 @@ #include #include #include - +#include #include #include #include diff --git a/configure.ac b/configure.ac index dd0c0da..f94e281 100644 --- a/configure.ac +++ b/configure.ac @@ -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 + [#include #include ], [#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]) # diff --git a/schemas/Makefile.am b/schemas/Makefile.am index 5827db9..84c9e99 100644 --- a/schemas/Makefile.am +++ b/schemas/Makefile.am @@ -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 diff --git a/shibd/shibd.cpp b/shibd/shibd.cpp index fbe7662..973645a 100644 --- a/shibd/shibd.cpp +++ b/shibd/shibd.cpp @@ -292,9 +292,9 @@ int main(int argc, char *argv[]) fprintf(stderr, "loading configuration file: %s\n", shar_config); static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h); static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e); - DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); - XercesJanitor docjanitor(dummydoc); - DOMElement* dummy = dummydoc->createElementNS(NULL,path); + xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument(); + XercesJanitor docjanitor(dummydoc); + xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path); auto_ptr_XMLCh src(shar_config); dummy->setAttributeNS(NULL,path,src.get()); dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE); diff --git a/shibsp/Makefile.am b/shibsp/Makefile.am index 87dbc94..8666ca6 100644 --- a/shibsp/Makefile.am +++ b/shibsp/Makefile.am @@ -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 \ diff --git a/shibsp/binding/impl/SOAPClient.cpp b/shibsp/binding/impl/SOAPClient.cpp index 9e1158f..0cb3a4e 100644 --- a/shibsp/binding/impl/SOAPClient.cpp +++ b/shibsp/binding/impl/SOAPClient.cpp @@ -189,4 +189,5 @@ void SOAPClient::reset() m_credResolver->unlock(); m_credResolver = NULL; opensaml::SOAPClient::reset(); -} \ No newline at end of file +} + diff --git a/shibsp/handler/impl/AssertionLookup.cpp b/shibsp/handler/impl/AssertionLookup.cpp index 86e9657..b3b7b97 100644 --- a/shibsp/handler/impl/AssertionLookup.cpp +++ b/shibsp/handler/impl/AssertionLookup.cpp @@ -97,7 +97,7 @@ pair 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)); } diff --git a/shibsp/handler/impl/SAML1Consumer.cpp b/shibsp/handler/impl/SAML1Consumer.cpp index c2870ee..dc3508e 100644 --- a/shibsp/handler/impl/SAML1Consumer.cpp +++ b/shibsp/handler/impl/SAML1Consumer.cpp @@ -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 lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : make_pair(true,28800); + pair lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair(true,28800); if (!lifetime.first) lifetime.second = 28800; auto_ptr_char authnInstant( diff --git a/shibsp/handler/impl/SAML2Consumer.cpp b/shibsp/handler/impl/SAML2Consumer.cpp index dfe89f5..b574db7 100644 --- a/shibsp/handler/impl/SAML2Consumer.cpp +++ b/shibsp/handler/impl/SAML2Consumer.cpp @@ -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 lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : make_pair(true,28800); + pair lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair(true,28800); if (!lifetime.first) lifetime.second = 28800; if (lifetime.second != 0) { diff --git a/shibsp/handler/impl/Shib1SessionInitiator.cpp b/shibsp/handler/impl/Shib1SessionInitiator.cpp index d98b608..e1fbc90 100644 --- a/shibsp/handler/impl/Shib1SessionInitiator.cpp +++ b/shibsp/handler/impl/Shib1SessionInitiator.cpp @@ -251,7 +251,7 @@ pair 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) + diff --git a/shibsp/handler/impl/WAYFSessionInitiator.cpp b/shibsp/handler/impl/WAYFSessionInitiator.cpp index be55d48..0d5e541 100644 --- a/shibsp/handler/impl/WAYFSessionInitiator.cpp +++ b/shibsp/handler/impl/WAYFSessionInitiator.cpp @@ -137,7 +137,7 @@ pair 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()) + diff --git a/shibsp/impl/XMLRequestMapper.cpp b/shibsp/impl/XMLRequestMapper.cpp index e69a00f..5cfe91d 100644 --- a/shibsp/impl/XMLRequestMapper.cpp +++ b/shibsp/impl/XMLRequestMapper.cpp @@ -145,7 +145,7 @@ namespace shibsp { static const XMLCh Host[] = UNICODE_LITERAL_4(H,o,s,t); static const XMLCh Path[] = UNICODE_LITERAL_4(P,a,t,h); static const XMLCh name[] = UNICODE_LITERAL_4(n,a,m,e); - static const XMLCh type[] = UNICODE_LITERAL_4(t,y,p,e); + static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e); } void SHIBSP_API shibsp::registerRequestMappers() @@ -190,7 +190,7 @@ void Override::loadACL(const DOMElement* e, Category& log) else { acl=XMLHelper::getFirstChildElement(e,AccessControlProvider); if (acl) { - xmltooling::auto_ptr_char type(acl->getAttributeNS(NULL,type)); + auto_ptr_char type(acl->getAttributeNS(NULL,_type)); log.info("building AccessControl provider of type %s...",type.get()); m_acl=SPConfig::getConfig().AccessControlManager.newPlugin(type.get(),acl); } diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp index b886e93..ad339fa 100644 --- a/shibsp/impl/XMLServiceProvider.cpp +++ b/shibsp/impl/XMLServiceProvider.cpp @@ -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; diff --git a/shibsp/remoting/impl/SocketListener.cpp b/shibsp/remoting/impl/SocketListener.cpp index 17cecb9..c67958e 100644 --- a/shibsp/remoting/impl/SocketListener.cpp +++ b/shibsp/remoting/impl/SocketListener.cpp @@ -30,8 +30,8 @@ #include #include -#ifdef HAVE_UNISTD_H -# include +#ifndef WIN32 +# include #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 m_lock; stack 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)) { diff --git a/shibsp/remoting/impl/ddf.cpp b/shibsp/remoting/impl/ddf.cpp index 6fe18f6..38db272 100644 --- a/shibsp/remoting/impl/ddf.cpp +++ b/shibsp/remoting/impl/ddf.cpp @@ -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= "\ \n\ \n\ ]>\n"; +*/ // This function constructs a DDF object equivalent to the wddx data element rooted // by the input.