[poppler] Try empty string instead of NULL as password if needed

mkasik mkasik at fedoraproject.org
Mon Aug 6 12:27:23 UTC 2012


commit 8e2bbaf043d5975b070d9419734cd9467dbbf0a7
Author: Marek Kasik <mkasik at redhat.com>
Date:   Mon Aug 6 14:25:50 2012 +0200

    Try empty string instead of NULL as password if needed
    
    Resolves: #845578

 poppler-0.20.1-empty-password.patch |   27 +++++++++++++++++++++++++++
 poppler.spec                        |   12 +++++++++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/poppler-0.20.1-empty-password.patch b/poppler-0.20.1-empty-password.patch
new file mode 100644
index 0000000..26eb892
--- /dev/null
+++ b/poppler-0.20.1-empty-password.patch
@@ -0,0 +1,27 @@
+commit a53e0641365608f832b455404f1ee584d278e0c4
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sun Aug 5 15:07:16 2012 +0200
+
+    If NULL, NULL fails as password try EMPTY, EMPTY before failing
+    
+    Reviewed by Jose Aliste
+    Bug #3498
+
+diff --git a/poppler/SecurityHandler.cc b/poppler/SecurityHandler.cc
+index 00c4ae1..a48449a 100644
+--- a/poppler/SecurityHandler.cc
++++ b/poppler/SecurityHandler.cc
+@@ -105,7 +105,12 @@ GBool SecurityHandler::checkEncryption(GooString *ownerPassword,
+     }
+   }
+   if (!ok) {
+-    error(errCommandLine, -1, "Incorrect password");
++    if (!ownerPassword && !userPassword) {
++      GooString dummy;
++      return checkEncryption(&dummy, &dummy);
++    } else {
++      error(errCommandLine, -1, "Incorrect password");
++    }
+   }
+   return ok;
+ }
diff --git a/poppler.spec b/poppler.spec
index c1158aa..fe1d92f 100644
--- a/poppler.spec
+++ b/poppler.spec
@@ -2,7 +2,7 @@
 Summary: PDF rendering library
 Name: poppler
 Version: 0.20.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2 or GPLv3
 Group: Development/Libraries
 URL:     http://poppler.freedesktop.org/
@@ -12,6 +12,11 @@ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.gz
 # http://bugzilla.redhat.com/show_bug.cgi?id=480868
 Patch1: poppler-0.12.4-annot-appearance.patch
 
+## backported patches
+# http://bugzilla.redhat.com/show_bug.cgi?id=845578
+# https://bugs.freedesktop.org/show_bug.cgi?id=3498
+Patch2: poppler-0.20.1-empty-password.patch
+
 Requires: poppler-data >= 0.4.0
 BuildRequires: automake libtool
 BuildRequires: gettext-devel
@@ -119,6 +124,7 @@ converting PDF files to a number of other formats.
 %setup -q
 
 #patch1 -p1 -b .annot
+%patch2 -p1 -b .empty-password
 
 chmod -x goo/GooTimer.h
 
@@ -239,6 +245,10 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}"
 
 
 %changelog
+* Mon Aug  6 2012 Marek Kasik <mkasik at redhat.com> 0.20.1-3
+- Try empty string instead of NULL as password if needed
+- Resolves: #845578
+
 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.20.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list