Try empty string instead of NULL as password if needed

Resolves: #845578
This commit is contained in:
Marek Kasik 2012-08-06 14:25:50 +02:00
parent be7bb7a7d4
commit 8e2bbaf043
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,27 @@
commit a53e0641365608f832b455404f1ee584d278e0c4
Author: Albert Astals Cid <aacid@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;
}

View File

@ -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@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@lists.fedoraproject.org> - 0.20.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild