Path resolution for error templates.
[shibboleth/sp.git] / shibsp / ServiceProvider.cpp
index 944dc26..df7cf81 100644 (file)
@@ -35,6 +35,7 @@
 #include <sstream>
 #include <xmltooling/XMLToolingConfig.h>
 #include <xmltooling/util/NDC.h>
+#include <xmltooling/util/PathResolver.h>
 #include <xmltooling/util/URLEncoder.h>
 #include <xmltooling/util/XMLHelper.h>
 
@@ -94,7 +95,8 @@ namespace shibsp {
                 pathname=props->getString(page);
         }
         if (pathname.first) {
-            ifstream infile(pathname.second);
+            string fname(pathname.second);
+            ifstream infile(XMLToolingConfig::getConfig().getPathResolver()->resolve(fname, PathResolver::XMLTOOLING_CFG_FILE).c_str());
             if (infile) {
                 tp.setPropertySet(props);
                 stringstream str;
@@ -525,6 +527,7 @@ pair<bool,long> ServiceProvider::doHandler(SPRequest& request) const
     catch (exception& e) {
         TemplateParameters tp(&e);
         tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?'));
+        tp.m_request = &request;
         return make_pair(true,sendError(log, request, app, "session", tp));
     }
 }