Convert ENDLINE refs to eol.
authorScott Cantor <cantor.2@osu.edu>
Thu, 11 Oct 2007 16:44:51 +0000 (16:44 +0000)
committerScott Cantor <cantor.2@osu.edu>
Thu, 11 Oct 2007 16:44:51 +0000 (16:44 +0000)
Make configure script check for proper logging version.

14 files changed:
configure.ac
shib-target/ArtifactMapper.cpp
shib-target/RPCListener.cpp
shib-target/XMLRequestMapper.cpp
shib-target/shib-ini.cpp
shib/ReloadableXMLFile.cpp
shib/ShibbolethTrust.cpp
siterefresh/siterefresh.cpp
xmlproviders/XMLAAP.cpp
xmlproviders/XMLAccessControl.cpp
xmlproviders/XMLCredentials.cpp
xmlproviders/XMLMetadata.cpp
xmlproviders/XMLProviders.cpp
xmlproviders/XMLTrust.cpp

index 3c6d1e0..dd60dc8 100644 (file)
@@ -167,10 +167,10 @@ AC_ARG_WITH(log4shib,
 if test -f "${LOG4SHIB_CONFIG}"; then
     LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
     CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
-       AC_CHECK_HEADER([log4shib/Category.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
+       AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
        AC_TRY_LINK(
-               [#include <log4shib/Category.hh>],
-               [log4shib::Category::getInstance("foo")],
+               [#include <log4shib/CategoryStream.hh>],
+               [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
                [AC_DEFINE(HAVE_LOG4SHIB,1,[Define if log4shib library is used.])],
                [AC_MSG_ERROR([unable to link with log4shib])])
 else
@@ -191,13 +191,12 @@ else
                AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
            LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
            CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
-               AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
-               AC_CHECK_HEADER([log4cpp/PropertyConfigurator.hh],,AC_MSG_ERROR([you need at least log4cpp 0.3.x]))
+               AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
                AC_TRY_LINK(
-                       [#include <log4cpp/Category.hh>],
-                       [log4cpp::Category::getInstance("foo")],
+                       [#include <log4cpp/CategoryStream.hh>],
+                       [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
                        [AC_DEFINE(HAVE_LOG4CPP,1,[Define if log4cpp library is used.])],
-                       [AC_MSG_ERROR([unable to link with log4cpp])])
+                       [AC_MSG_ERROR([unable to link with log4cpp, at least version 1.0 needed])])
        else
            AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
        fi
index d51989b..1da815d 100644 (file)
@@ -99,7 +99,7 @@ SAMLResponse* STArtifactMapper::resolve(SAMLRequest* request)
                        try {
                            response = binding->send(ep->getLocation(),*request,&callCtx);
                            if (log.isDebugEnabled())
-                               log.debugStream() << "SAML response from artifact request:\n" << *response << CategoryStream::ENDLINE;
+                               log.debugStream() << "SAML response from artifact request:\n" << *response << logging::eol;
                            
                            if (!response->getAssertions().hasNext()) {
                                delete response;
@@ -138,7 +138,7 @@ SAMLResponse* STArtifactMapper::resolve(SAMLRequest* request)
                                try {
                                    response = binding->send(ep->getLocation(),*request,&callCtx);
                                    if (log.isDebugEnabled())
-                                       log.debugStream() << "SAML response from artifact request:\n" << *response << CategoryStream::ENDLINE;
+                                       log.debugStream() << "SAML response from artifact request:\n" << *response << logging::eol;
                                    
                                    if (!response->getAssertions().hasNext()) {
                                        delete response;
index 1efffcd..58b184d 100644 (file)
@@ -237,21 +237,21 @@ EntryWrapper::EntryWrapper(shibrpc_get_session_ret_2& ret, Category& log)
 
     istringstream authstream(ret.auth_statement);
     log.debugStream() << "trying to decode authentication statement: "
-        << ((ret.auth_statement && *ret.auth_statement) ? ret.auth_statement : "(none)") << CategoryStream::ENDLINE;
+        << ((ret.auth_statement && *ret.auth_statement) ? ret.auth_statement : "(none)") << logging::eol;
     auto_ptr<SAMLAuthenticationStatement> s(
        (ret.auth_statement && *ret.auth_statement) ? new SAMLAuthenticationStatement(authstream) : NULL
        );
 
     istringstream prestream(ret.attr_response_pre);
     log.debugStream() << "trying to decode unfiltered attribute response: "
-        << ((ret.attr_response_pre && *ret.attr_response_pre) ? ret.attr_response_pre : "(none)") << CategoryStream::ENDLINE;
+        << ((ret.attr_response_pre && *ret.attr_response_pre) ? ret.attr_response_pre : "(none)") << logging::eol;
     auto_ptr<SAMLResponse> pre(
        (ret.attr_response_pre && *ret.attr_response_pre) ? new SAMLResponse(prestream,minor) : NULL
        );
 
     istringstream poststream(ret.attr_response_post);
     log.debugStream() << "trying to decode filtered attribute response: "
-        << ((ret.attr_response_post && *ret.attr_response_post) ? ret.attr_response_post : "(none)") << CategoryStream::ENDLINE;
+        << ((ret.attr_response_post && *ret.attr_response_post) ? ret.attr_response_post : "(none)") << logging::eol;
     auto_ptr<SAMLResponse> post(
        (ret.attr_response_post && *ret.attr_response_post) ? new SAMLResponse(poststream,minor) : NULL
        );
index 069641e..2c0e8dc 100644 (file)
@@ -528,7 +528,7 @@ void XMLRequestMapperImpl::init()
         }
     }
     catch (SAMLException& e) {
-        log->errorStream() << "Error while parsing request mapping configuration: " << e.what() << CategoryStream::ENDLINE;
+        log->errorStream() << "Error while parsing request mapping configuration: " << e.what() << logging::eol;
         throw;
     }
 #ifndef _DEBUG
index 3ded944..3d719de 100644 (file)
@@ -580,7 +580,7 @@ XMLApplication::XMLApplication(
         }
     }
     catch (SAMLException& e) {
-        log.errorStream() << "Error while processing applicaton element: " << e.what() << CategoryStream::ENDLINE;
+        log.errorStream() << "Error while processing applicaton element: " << e.what() << logging::eol;
         cleanup();
         throw;
     }
@@ -1150,7 +1150,7 @@ void XMLConfigImpl::init(bool first)
         }
     }
     catch (SAMLException& e) {
-        log.errorStream() << "Error while loading SP configuration: " << e.what() << CategoryStream::ENDLINE;
+        log.errorStream() << "Error while loading SP configuration: " << e.what() << logging::eol;
         throw;
     }
 #ifndef _DEBUG
index adafef4..0db0d53 100644 (file)
@@ -53,12 +53,12 @@ ReloadableXMLFileImpl::ReloadableXMLFileImpl(const char* pathname) : m_doc(NULL)
         m_doc=p.parse(dsrc);
         m_root=m_doc->getDocumentElement();
 
-        log.infoStream() << "Loaded and parsed XML file (" << pathname << ")" << CategoryStream::ENDLINE;
+        log.infoStream() << "Loaded and parsed XML file (" << pathname << ")" << logging::eol;
     }
     catch (XMLException& e)
     {
         auto_ptr_char msg(e.getMessage());
-        log.errorStream() << "Xerces error while opening configuration file (" << pathname << "): " << msg.get() << CategoryStream::ENDLINE;
+        log.errorStream() << "Xerces error while opening configuration file (" << pathname << "): " << msg.get() << logging::eol;
         if (m_doc) {
             m_doc->release();
             m_doc=NULL;
@@ -67,7 +67,7 @@ ReloadableXMLFileImpl::ReloadableXMLFileImpl(const char* pathname) : m_doc(NULL)
     }
     catch (SAMLException& e)
     {
-        log.errorStream() << "XML error while parsing configuration file (" << pathname << "): " << e.what() << CategoryStream::ENDLINE;
+        log.errorStream() << "XML error while parsing configuration file (" << pathname << "): " << e.what() << logging::eol;
         if (m_doc) {
             m_doc->release();
             m_doc=NULL;
@@ -77,7 +77,7 @@ ReloadableXMLFileImpl::ReloadableXMLFileImpl(const char* pathname) : m_doc(NULL)
 #ifndef _DEBUG
     catch (...)
     {
-        log.errorStream() << "Unexpected error while parsing configuration file (" << pathname << ")" << CategoryStream::ENDLINE;
+        log.errorStream() << "Unexpected error while parsing configuration file (" << pathname << ")" << logging::eol;
         if (m_doc) {
             m_doc->release();
             m_doc=NULL;
index ba24e04..c6bb916 100644 (file)
@@ -45,9 +45,9 @@ namespace {
         unsigned long code=ERR_get_error_line_data(&file,&line,&data,&flags);
         while (code) {
             Category& log=Category::getInstance("OpenSSL");
-            log.errorStream() << "error code: " << code << " in " << file << ", line " << line << CategoryStream::ENDLINE;
+            log.errorStream() << "error code: " << code << " in " << file << ", line " << line << logging::eol;
             if (data && (flags & ERR_TXT_STRING))
-                log.errorStream() << "error data: " << data << CategoryStream::ENDLINE;
+                log.errorStream() << "error data: " << data << logging::eol;
             code=ERR_get_error_line_data(&file,&line,&data,&flags);
         }
     }
@@ -312,7 +312,7 @@ bool ShibbolethTrust::validate(void* certEE, const Iterator<void*>& certChain, c
                 buf[len] = '\0';
                 subjectstr+=buf;
             }
-            log.infoStream() << "certificate subject: " << subjectstr << CategoryStream::ENDLINE;
+            log.infoStream() << "certificate subject: " << subjectstr << logging::eol;
             // The flags give us LDAP order instead of X.500, with a comma plus space separator.
             len=X509_NAME_print_ex(b2,subject,0,XN_FLAG_RFC2253 + XN_FLAG_SEP_CPLUS_SPC - XN_FLAG_SEP_COMMA_PLUS);
             BIO_flush(b2);
index ec229dc..9b3a840 100644 (file)
@@ -289,25 +289,25 @@ int main(int argc,char* argv[])
         ret=-1;
     }
     catch(SAMLException& e) {
-        log.errorStream() << "caught a SAML exception: " << e.what() << CategoryStream::ENDLINE;
+        log.errorStream() << "caught a SAML exception: " << e.what() << siterefresh::logging::eol;
         ret=-2;
     }
     catch(XMLException& e) {
         auto_ptr_char temp(e.getMessage());
-        log.errorStream() << "caught an XML exception: " << temp.get() << CategoryStream::ENDLINE;
+        log.errorStream() << "caught an XML exception: " << temp.get() << siterefresh::logging::eol;
         ret=-3;
     }
     catch(XSECException& e) {
         auto_ptr_char temp(e.getMsg());
-        log.errorStream() << "caught an XMLSec exception: " << temp.get() << CategoryStream::ENDLINE;
+        log.errorStream() << "caught an XMLSec exception: " << temp.get() << siterefresh::logging::eol;
         ret=-4;
     }
     catch(XSECCryptoException& e) {
-        log.errorStream() << "caught an XMLSecCrypto exception: " << e.getMsg() << CategoryStream::ENDLINE;
+        log.errorStream() << "caught an XMLSecCrypto exception: " << e.getMsg() << siterefresh::logging::eol;
         ret=-5;
     }
     catch(...) {
-        log.errorStream() << "caught an unknown exception" << CategoryStream::ENDLINE;
+        log.errorStream() << "caught an unknown exception" << siterefresh::logging::eol;
         ret=-6;
     }
 
index 6735e61..8ce7226 100644 (file)
@@ -197,7 +197,7 @@ void XMLAAPImpl::init()
     }
     catch (SAMLException& e)
     {
-        log.errorStream() << "Error while parsing AAP: " << e.what() << CategoryStream::ENDLINE;
+        log.errorStream() << "Error while parsing AAP: " << e.what() << xmlproviders::logging::eol;
         this->~XMLAAPImpl();
         throw;
     }
@@ -395,7 +395,7 @@ namespace {
         {
             auto_ptr<char> tmp(XMLString::transcode(ex.getMessage()));
             Category::getInstance(XMLPROVIDERS_LOGCAT".XMLAAPImpl").errorStream()
-                << "caught exception while parsing regular expression: " << tmp.get() << CategoryStream::ENDLINE;
+                << "caught exception while parsing regular expression: " << tmp.get() << xmlproviders::logging::eol;
         }
         return false;
     }
index 08c7a59..97a7ae7 100644 (file)
@@ -264,7 +264,7 @@ void XMLAccessControlImpl::init()
             m_rootAuthz=new Operator(rootElement);
     }
     catch (SAMLException& e) {
-        log->errorStream() << "Error while parsing access control configuration: " << e.what() << CategoryStream::ENDLINE;
+        log->errorStream() << "Error while parsing access control configuration: " << e.what() << xmlproviders::logging::eol;
         throw;
     }
 #ifndef _DEBUG
index 57f00f9..8d67052 100644 (file)
@@ -128,7 +128,7 @@ void XMLCredentialsImpl::init()
         }
     }
     catch (SAMLException& e) {
-        log.errorStream() << "Error while parsing creds configuration: " << e.what() << CategoryStream::ENDLINE;
+        log.errorStream() << "Error while parsing creds configuration: " << e.what() << xmlproviders::logging::eol;
         for (resolvermap_t::iterator j=m_resolverMap.begin(); j!=m_resolverMap.end(); j++)
             delete j->second;
         throw;
index d6d59b8..ddbc7af 100644 (file)
@@ -1194,7 +1194,7 @@ void XMLMetadataImpl::init()
     }
     catch (SAMLException& e)
     {
-        log.errorStream() << "Error while parsing SAML metadata: " << e.what() << CategoryStream::ENDLINE;
+        log.errorStream() << "Error while parsing SAML metadata: " << e.what() << xmlproviders::logging::eol;
         this->~XMLMetadataImpl();
         throw;
     }
@@ -1366,13 +1366,13 @@ bool XMLMetadata::verifySignature(DOMDocument* doc, const DOMElement* parent, bo
     }
     catch(XSECException& e) {
         auto_ptr_char msg(e.getMsg());
-        log.errorStream() << "caught XMLSec exception while verifying metadata signature: " << msg.get() << CategoryStream::ENDLINE;
+        log.errorStream() << "caught XMLSec exception while verifying metadata signature: " << msg.get() << xmlproviders::logging::eol;
         if (sig)
             prov.releaseSignature(sig);
         return false;
     }
     catch(XSECCryptoException& e) {
-        log.errorStream() << "caught XMLSecCrypto exception while verifying metadata signature: " << e.getMsg() << CategoryStream::ENDLINE;
+        log.errorStream() << "caught XMLSecCrypto exception while verifying metadata signature: " << e.getMsg() << xmlproviders::logging::eol;
         if (sig)
             prov.releaseSignature(sig);
         return false;
index 4565b7b..535109e 100644 (file)
@@ -99,9 +99,9 @@ void log_openssl()
     unsigned long code=ERR_get_error_line_data(&file,&line,&data,&flags);
     while (code) {
         Category& log=Category::getInstance("OpenSSL");
-        log.errorStream() << "error code: " << code << " in " << file << ", line " << line << CategoryStream::ENDLINE;
+        log.errorStream() << "error code: " << code << " in " << file << ", line " << line << xmlproviders::logging::eol;
         if (data && (flags & ERR_TXT_STRING))
-            log.errorStream() << "error data: " << data << CategoryStream::ENDLINE;
+            log.errorStream() << "error data: " << data << xmlproviders::logging::eol;
         code=ERR_get_error_line_data(&file,&line,&data,&flags);
     }
 }
index 5dfa234..6e6a04e 100644 (file)
@@ -329,7 +329,7 @@ void XMLTrustImpl::init()
         walker->release();    // This just cleans up aggressively, but there's no leak if we don't.
     }
     catch (SAMLException& e) {
-        log.errorStream() << "Error while parsing trust configuration: " << e.what() << CategoryStream::ENDLINE;
+        log.errorStream() << "Error while parsing trust configuration: " << e.what() << xmlproviders::logging::eol;
         this->~XMLTrustImpl();
         throw;
     }
@@ -470,7 +470,7 @@ bool XMLTrust::validate(void* certEE, const Iterator<void*>& certChain, const IR
                 buf[len] = '\0';
                 subjectstr+=buf;
             }
-            log.infoStream() << "certificate subject: " << subjectstr << CategoryStream::ENDLINE;
+            log.infoStream() << "certificate subject: " << subjectstr << xmlproviders::logging::eol;
             // The flags give us LDAP order instead of X.500, with a comma plus space separator.
             len=X509_NAME_print_ex(b2,subject,0,XN_FLAG_RFC2253 + XN_FLAG_SEP_CPLUS_SPC - XN_FLAG_SEP_COMMA_PLUS);
             BIO_flush(b2);