[shibboleth-sp2] 99/100: Added option to read file from stdin, easier way to support SSL

Ferenc Wágner wferi-guest at moszumanska.debian.org
Tue Jan 26 21:29:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

wferi-guest pushed a commit to annotated tag 1.2.1
in repository shibboleth-sp2.

commit 756ce8332d7fa2dd0f2c54c0d631ee7bd8b4daad
Author: Scott Cantor <cantor.2 at osu.edu>
Date:   Mon Nov 8 04:38:44 2004 +0000

    Added option to read file from stdin, easier way to support SSL
---
 siterefresh/siterefresh.cpp | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/siterefresh/siterefresh.cpp b/siterefresh/siterefresh.cpp
index d6ca239..a45195f 100644
--- a/siterefresh/siterefresh.cpp
+++ b/siterefresh/siterefresh.cpp
@@ -61,6 +61,7 @@
 #include <log4cpp/Category.hh>
 #include <log4cpp/OstreamAppender.hh>
 #include <xercesc/framework/URLInputSource.hpp>
+#include <xercesc/framework/StdInInputSource.hpp>
 #include <xsec/enc/XSECCryptoProvider.hpp>
 #include <xsec/enc/XSECKeyInfoResolverDefault.hpp>
 #include <xsec/enc/XSECCryptoException.hpp>
@@ -175,7 +176,7 @@ int main(int argc,char* argv[])
             name_param=argv[++i];
     }
 
-    if (!url_param || !out_param || (verify && !cert_param)) {
+    if (!out_param || (verify && !cert_param)) {
         cout << "usage: " << argv[0] << endl <<
             "\t--url <URL of metadata>" << endl <<
             "\t--out <pathname to copy data to>" << endl <<
@@ -221,10 +222,18 @@ int main(int argc,char* argv[])
         // Parse the specified document.
         saml::XML::Parser p;
         static XMLCh base[]={chLatin_f, chLatin_i, chLatin_l, chLatin_e, chColon, chForwardSlash, chForwardSlash, chForwardSlash, chNull};
-        URLInputSource src(base,url_param);
-        Wrapper4InputSource dsrc(&src,false);
-        DOMDocument* doc=p.parse(dsrc);
-
+        DOMDocument* doc=NULL;
+        if (url_param && *url_param) {
+            URLInputSource src(base,url_param);
+            Wrapper4InputSource dsrc(&src,false);
+            doc=p.parse(dsrc);
+        }
+        else {
+            StdInInputSource src;
+            Wrapper4InputSource dsrc(&src,false);
+            doc=p.parse(dsrc);
+        }
+    
         // Check root element.
         if (ns_param && name_param) {
             auto_ptr_XMLCh ns(ns_param);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/shibboleth-sp2.git



More information about the Pkg-shibboleth-devel mailing list