blautenb    2004/01/25 16:16:04

  Modified:    c/src/utils/winutils XSECURIResolverGenericWin32.cpp
  Log:
  Remove escapes from URI before retrieving a path on the file system
  
  Revision  Changes    Path
  1.8       +11 -4     
xml-security/c/src/utils/winutils/XSECURIResolverGenericWin32.cpp
  
  Index: XSECURIResolverGenericWin32.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-security/c/src/utils/winutils/XSECURIResolverGenericWin32.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSECURIResolverGenericWin32.cpp   11 Sep 2003 11:11:05 -0000      1.7
  +++ XSECURIResolverGenericWin32.cpp   26 Jan 2004 00:16:04 -0000      1.8
  @@ -71,6 +71,9 @@
    * $Id$
    *
    * $Log$
  + * Revision 1.8  2004/01/26 00:16:04  blautenb
  + * Remove escapes from URI before retrieving a path on the file system
  + *
    * Revision 1.7  2003/09/11 11:11:05  blautenb
    * Cleaned up usage of Xerces namespace - no longer inject into global 
namespace in headers
    *
  @@ -108,6 +111,7 @@
   
   #include <xsec/framework/XSECError.hpp>
   #include <xsec/utils/winutils/XSECBinHTTPURIInputStream.hpp>
  +#include <xsec/utils/XSECDOMUtils.hpp>
   
   static const XMLCh gFileScheme[] = {
   
  @@ -225,14 +229,17 @@
        if (!XMLString::compareIString(xmluri->getScheme(), gFileScheme)) {
   
                // This is a file.  We only really understand if this is 
localhost
  -             // XMLUri has already cleaned of escape characters (%xx)
           
  -             if (xmluri->getHost() == NULL || 
  +             if (xmluri->getHost() == NULL || xmluri->getHost()[0] == chNull 
||
                        !XMLString::compareIString(xmluri->getHost(), 
XMLUni::fgLocalHostString)) {
   
  +                     // Clean hex escapes
  +                     XMLCh * realPath = cleanURIEscapes(xmluri->getPath());
  +                     ArrayJanitor<XMLCh> j_realPath(realPath);
  +
                        // Localhost
   
  -            BinFileInputStream* retStrm = new 
BinFileInputStream(xmluri->getPath());
  +            BinFileInputStream* retStrm = new BinFileInputStream(realPath);
               if (!retStrm->getIsOpen())
               {
                   delete retStrm;
  
  
  

Reply via email to