From 885b3c6ec5b4f08144b6a4708c53918a43fddf11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
Date: Tue, 30 Aug 2016 07:38:34 +0200
Subject: Fix authentication against hidden or uninitialized replica set
members
---
...thenticate-always-to-topology-type-Single.patch | 35 ++++++++++++++++++++++
perl-MongoDB.spec | 10 ++++++-
2 files changed, 44 insertions(+), 1 deletion(-)
create mode 100644
MongoDB-1.2.3-PERL-647-Authenticate-always-to-topology-type-Single.patch
diff --git a/MongoDB-1.2.3-PERL-647-Authenticate-always-to-topology-type-Single.patch
b/MongoDB-1.2.3-PERL-647-Authenticate-always-to-topology-type-Single.patch
new file mode 100644
index 0000000..ca97e1c
--- /dev/null
+++ b/MongoDB-1.2.3-PERL-647-Authenticate-always-to-topology-type-Single.patch
@@ -0,0 +1,35 @@
+From 96d3e69c968d8e226b7e642d86c60891b1751f77 Mon Sep 17 00:00:00 2001
+From: David Golden <xdg(a)xdg.me>
+Date: Wed, 27 Jul 2016 13:05:54 -0400
+Subject: [PATCH] PERL-647 Authenticate always to topology type Single
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This ensures that direct connections to hidden or uninitialized
+replica set members will authenticate so that users can issue
+administrative commands that require it.
+
+Petr Písař: Ported to 1.2.3.
+
+Signed-off-by: Petr Písař <ppisar(a)redhat.com>
+---
+ lib/MongoDB/_Topology.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/MongoDB/_Topology.pm b/lib/MongoDB/_Topology.pm
+index e717f17..80b7993 100644
+--- a/lib/MongoDB/_Topology.pm
++++ b/lib/MongoDB/_Topology.pm
+@@ -605,7 +605,7 @@ sub _initialize_link {
+ # we have a link and the server is a valid member, so
+ # try to authenticate; if authentication fails, all
+ # servers are considered invalid and we throw an error
+- if ( first { $_ eq $server->type } qw/Standalone Mongos RSPrimary RSSecondary/ )
{
++ if ( $self->type eq 'Single' || first { $_ eq $server->type }
qw/Standalone Mongos RSPrimary RSSecondary/ ) {
+ try {
+ $self->credential->authenticate($link, $self->bson_codec);
+ }
+--
+2.5.5
+
diff --git a/perl-MongoDB.spec b/perl-MongoDB.spec
index e58220a..8f617b2 100644
--- a/perl-MongoDB.spec
+++ b/perl-MongoDB.spec
@@ -1,6 +1,6 @@
Name: perl-MongoDB
Version: 1.2.3
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A MongoDB Driver for Perl
## Installed:
# lib/MongoDB/_Link.pm: ASL 2.0 and (GPL+ or Artistic)
@@ -17,6 +17,9 @@ URL:
http://search.cpan.org/dist/MongoDB/
Source0:
http://www.cpan.org/authors/id/M/MO/MONGODB/MongoDB-v%{version}.tar.gz
# Use system libbson if available <
https://jira.mongodb.org/browse/PERL-521>
Patch0: MongoDB-v1.2.2-Use-system-libbson-library-if-possible.patch
+# Fix authentication against hidden or uninitialized replica set members,
+# in upstream 1.4.4, <
https://jira.mongodb.org/browse/PERL-647>
+Patch1: MongoDB-1.2.3-PERL-647-Authenticate-always-to-topology-type-Single.patch
# Build
BuildRequires: coreutils
BuildRequires: findutils
@@ -134,6 +137,7 @@ The perl database access module for MongoDB.
%setup -q -n MongoDB-v%{version}
# Unbundle libbson
%patch0 -p1
+%patch1 -p1
rm -r bson
sed -i -e '/^bson\//d' MANIFEST
# Remove bundled modules
@@ -183,6 +187,10 @@ exit $test_rc
%{_mandir}/man3/*
%changelog
+* Tue Aug 30 2016 Petr Pisar <ppisar(a)redhat.com> - 1.2.3-2
+- Fix authentication against hidden or uninitialized replica set members
+ (upstream bug PERL-647)
+
* Wed Mar 09 2016 Petr Pisar <ppisar(a)redhat.com> - 1.2.3-1
- 1.2.3 bump
--
cgit v0.12
http://pkgs.fedoraproject.org/cgit/perl-MongoDB.git/commit/?h=f24&id=...