https://issues.shibboleth.net/jira/browse/SSPCPP-498 1.5.1
authorScott Cantor <cantor.2@osu.edu>
Thu, 6 Sep 2012 16:28:45 +0000 (16:28 +0000)
committerScott Cantor <cantor.2@osu.edu>
Thu, 6 Sep 2012 16:28:45 +0000 (16:28 +0000)
config_win32.h
configure.ac
cpp-xmltooling.sln
xmltooling/Makefile.am
xmltooling/util/ParserPool.cpp
xmltooling/util/PathResolver.cpp
xmltooling/version.h
xmltooling/xmltooling.rc

index 29f3446..0337856 100644 (file)
 #define PACKAGE_NAME "xmltooling"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "xmltooling 1.5.0"
+#define PACKAGE_STRING "xmltooling 1.5.1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "xmltooling"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.5.0"
+#define PACKAGE_VERSION "1.5.1"
 
 /* Define to the necessary symbol if this constant uses a non-standard name on
    your system. */
 /* #undef TM_IN_SYS_TIME */
 
 /* Version number of package */
-#define VERSION "1.5.0"
+#define VERSION "1.5.1"
 
 /* Define if you wish to disable XML-Security-dependent features. */
 /* #undef XMLTOOLING_NO_XMLSEC */
index 7d6c6b7..47d7da0 100644 (file)
@@ -1,6 +1,6 @@
 # Process this file with autoreconf
 AC_PREREQ([2.50])
-AC_INIT([xmltooling],[1.5.0],[https://issues.shibboleth.net/],[xmltooling])
+AC_INIT([xmltooling],[1.5.1],[https://issues.shibboleth.net/],[xmltooling])
 AC_CONFIG_SRCDIR(xmltooling)
 AC_CONFIG_AUX_DIR(build-aux)
 AC_CONFIG_MACRO_DIR(m4)
index cdd98dd..7b85cf3 100644 (file)
@@ -1,6 +1,6 @@
 \r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 2012\r
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{61BF324D-2532-49C9-93CE-DF0E89529D4F}"\r
        ProjectSection(SolutionItems) = preProject\r
                m4\acinclude.m4 = m4\acinclude.m4\r
index f162795..d3e49dc 100644 (file)
@@ -204,13 +204,13 @@ common_sources = \
 libxmltooling_lite_la_SOURCES = \
        ${common_sources}
 libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE
-libxmltooling_lite_la_LDFLAGS = -version-info 6:0:0
+libxmltooling_lite_la_LDFLAGS = -version-info 6:1:0
 
 if BUILD_XMLSEC
 libxmltooling_la_SOURCES = \
        ${common_sources} \
        ${xmlsec_sources}
-libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 6:0:0
+libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 6:1:0
 endif
 
 install-exec-hook:
index 3650297..1176617 100644 (file)
@@ -229,8 +229,13 @@ bool ParserPool::loadSchema(const XMLCh* nsURI, const XMLCh* pathname)
         return false;
     }
 
+    // Roundtrip to local code page and back to translate path as needed.
+    string topath(p.get());
+    XMLToolingConfig::getConfig().getPathResolver()->resolve(topath, PathResolver::XMLTOOLING_XML_FILE);
+    auto_ptr_XMLCh temp(topath.c_str());
+
     Lock lock(m_lock);
-    m_schemaLocMap[nsURI]=pathname;
+    m_schemaLocMap[nsURI] = temp.get();
     m_schemaLocations.erase();
     for_each(m_schemaLocMap.begin(), m_schemaLocMap.end(), doubleit<xstring>(m_schemaLocations,chSpace));
 
@@ -251,7 +256,9 @@ bool ParserPool::loadCatalogs(const char* pathnames)
 
 bool ParserPool::loadCatalog(const char* pathname)
 {
-    auto_ptr_XMLCh temp(pathname);
+    string p(pathname);
+    XMLToolingConfig::getConfig().getPathResolver()->resolve(p, PathResolver::XMLTOOLING_XML_FILE);
+    auto_ptr_XMLCh temp(p.c_str());
     return loadCatalog(temp.get());
 }
 
@@ -300,13 +307,20 @@ bool ParserPool::loadCatalog(const XMLCh* pathname)
         }
 
         // Fetch all the <system> elements.
-        DOMNodeList* mappings=root->getElementsByTagNameNS(CATALOG_NS,system);
+        DOMNodeList* mappings = root->getElementsByTagNameNS(CATALOG_NS,system);
         Lock lock(m_lock);
-        for (XMLSize_t i=0; i<mappings->getLength(); i++) {
-            root=static_cast<DOMElement*>(mappings->item(i));
-            const XMLCh* from=root->getAttributeNS(nullptr,systemId);
-            const XMLCh* to=root->getAttributeNS(nullptr,uri);
-            m_schemaLocMap[from]=to;
+        for (XMLSize_t i = 0; i < mappings->getLength(); i++) {
+            root = static_cast<DOMElement*>(mappings->item(i));
+            const XMLCh* from = root->getAttributeNS(nullptr,systemId);
+            const XMLCh* to = root->getAttributeNS(nullptr,uri);
+
+            // Roundtrip to local code page and back to translate path as needed.
+            auto_ptr_char temp(to);
+            string topath(temp.get());
+            XMLToolingConfig::getConfig().getPathResolver()->resolve(topath, PathResolver::XMLTOOLING_XML_FILE);
+            auto_ptr_XMLCh temp2(topath.c_str());
+
+            m_schemaLocMap[from] = temp2.get();
         }
         m_schemaLocations.erase();
         for_each(m_schemaLocMap.begin(), m_schemaLocMap.end(), doubleit<xstring>(m_schemaLocations,chSpace));
index 1436e99..122561e 100644 (file)
 #include "exceptions.h"
 #include "util/PathResolver.h"
 
+#ifdef WIN32
+# include <Shlobj.h>
+#endif
+
 using namespace xmltooling;
 using namespace std;
 
@@ -106,7 +110,10 @@ const string& PathResolver::resolve(string& s, file_type_t filetype, const char*
     if (s.find('%') != string::npos) {
         // This is an ugly workaround for Windows XP/2003, which don't support the PROGRAMDATA variable.
         if (!getenv("PROGRAMDATA") && s.find("%PROGRAMDATA%") != string::npos) {
-            s.replace(s.find("%PROGRAMDATA%"), 13, "%ALLUSERSPROFILE%/Application Data");
+            char appdatapath[MAX_PATH + 2];
+            if (SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdatapath) == S_OK) {
+                s.replace(s.find("%PROGRAMDATA%"), 13, appdatapath);
+            }
         }
         char expbuf[MAX_PATH + 2];
         DWORD cnt = ExpandEnvironmentStrings(s.c_str(), expbuf, sizeof(expbuf));
index 6261811..2841b3e 100644 (file)
@@ -44,7 +44,7 @@
 
 #define XMLTOOLING_VERSION_MAJOR 1
 #define XMLTOOLING_VERSION_MINOR 5
-#define XMLTOOLING_VERSION_REVISION 0
+#define XMLTOOLING_VERSION_REVISION 1
 
 /** DO NOT MODIFY BELOW THIS LINE */
 
index c49352b..8d4a5ca 100644 (file)
@@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 //\r
 \r
 VS_VERSION_INFO VERSIONINFO\r
- FILEVERSION 1,5,0,0\r
+ FILEVERSION 1,5,1,0\r
  PRODUCTVERSION 2,5,0,0\r
  FILEFLAGSMASK 0x3fL\r
 #ifdef _DEBUG\r
@@ -51,7 +51,7 @@ BEGIN
 #else\r
             VALUE "FileDescription", "OpenSAML XMLTooling Library\0"\r
 #endif\r
-            VALUE "FileVersion", "1, 5, 0, 0\0"\r
+            VALUE "FileVersion", "1, 5, 1, 0\0"\r
 #ifdef XMLTOOLING_LITE\r
 #ifdef _DEBUG\r
             VALUE "InternalName", "xmltooling-lite1_5D\0"\r