[ooo-build-commit] Branch 'ooo-build-3-2' - patches/dev300

Tor Lillqvist tml at kemper.freedesktop.org
Fri Jan 15 07:30:43 PST 2010


 patches/dev300/apply                                   |    2 -
 patches/dev300/win32-pdfimport-use-temporary-file.diff |   26 +++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 0d42e0928472dca2cb59c7bd78c7581ac538eddc
Author: Tor Lillqvist <tml at hemulen.(none)>
Date:   Fri Jan 15 17:25:38 2010 +0200

    Solve the pdfimport problem in a better way
    
    Just always copy the stream into a temporary file and load it from
    there. Then we don't nee to bypass the check for an encrypted
    document, that should work now. Remove the temp file after it has been
    loaded to avoid leaving potentially discriminating evidence around.
    
    Thanks to Fridrich for the idea.

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 1fc691b..1f80f68 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3261,7 +3261,7 @@ boost-1.39-extra-header.diff, kohei
 [ Win32Only ]
 win32-boost-crack.diff
 
-win32-pdfimport-assume-no-encryption.diff, n#569319, fridrich
+win32-pdfimport-use-temporary-file.diff, n#569319, fridrich
 
 [ NovellOnly ]
 # remove Macro Recorder from UI since it is borked by design
diff --git a/patches/dev300/win32-pdfimport-use-temporary-file.diff b/patches/dev300/win32-pdfimport-use-temporary-file.diff
new file mode 100644
index 0000000..cb04a62
--- /dev/null
+++ b/patches/dev300/win32-pdfimport-use-temporary-file.diff
@@ -0,0 +1,26 @@
+--- sdext/source/pdfimport/pdfiadaptor.cxx
++++ sdext/source/pdfimport/pdfiadaptor.cxx
+@@ -254,7 +254,7 @@
+ 
+     bool bSuccess=false;
+ 
+-    if( xInput.is() && (!rURL.getLength() || rURL.compareToAscii( "file:", 5 ) != 0) )
++    if( xInput.is() )
+         bSuccess = xpdf_ImportFromStream( xInput, pSink, xIHdl, rPwd, m_xContext );
+     else
+         bSuccess = xpdf_ImportFromFile( rURL, pSink, xIHdl, rPwd, m_xContext );
+--- sdext/source/pdfimport/wrapper/wrapper.cxx
++++ sdext/source/pdfimport/wrapper/wrapper.cxx
+@@ -1041,7 +1041,11 @@
+ 
+     osl_closeFile( aFile );
+ 
+-    return bSuccess && xpdf_ImportFromFile( aURL, rSink, xIHdl, rPwd, xContext );
++    if ( bSuccess )
++        bSuccess = xpdf_ImportFromFile( aURL, rSink, xIHdl, rPwd, xContext );
++    osl_removeFile( aURL.pData );
++
++    return bSuccess;
+ }
+ 
+ }


More information about the ooo-build-commit mailing list