From e91d9b7385585023653ebffbeb0b083333afc949 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Tue, 12 May 2015 17:20:19 +0200
Subject: Fix warnings


diff --git 
a/CGI-Application-Plugin-Authentication-0.20-Silent-various-warnings.patch 
b/CGI-Application-Plugin-Authentication-0.20-Silent-various-warnings.patch
new file mode 100644
index 0000000..1dd84c8
--- /dev/null
+++ b/CGI-Application-Plugin-Authentication-0.20-Silent-various-warnings.patch
@@ -0,0 +1,84 @@
+From ef949f140931537af09d460d4b5d8be74d2fab4a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
+Date: Tue, 12 May 2015 17:14:55 +0200
+Subject: [PATCH] Silent various warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Some of them fail tests which sniffs for warnings. Some warning were
+introduced by CGI 4.05 or recent (5.20) perl.
+
+<https://rt.cpan.org/Public/Bug/Display.html?id=99460>
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ lib/CGI/Application/Plugin/Authentication.pm                     | 3 ++-
+ lib/CGI/Application/Plugin/Authentication/Driver/Filter/crypt.pm | 2 +-
+ lib/CGI/Application/Plugin/Authentication/Driver/Filter/md5.pm   | 2 +-
+ lib/CGI/Application/Plugin/Authentication/Driver/Filter/sha1.pm  | 2 +-
+ 4 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/CGI/Application/Plugin/Authentication.pm 
b/lib/CGI/Application/Plugin/Authentication.pm
+index 83230d2..2908925 100644
+--- a/lib/CGI/Application/Plugin/Authentication.pm
++++ b/lib/CGI/Application/Plugin/Authentication.pm
+@@ -767,6 +767,7 @@ sub is_protected_runmode {
+     my $self = shift;
+     my $runmode = shift;
+ 
++    require overload;
+     foreach my $runmode_test ($self->protected_runmodes) {
+         if (overload::StrVal($runmode_test) =~ /^Regexp=/) {
+             # We were passed a regular expression
+@@ -1205,7 +1206,7 @@ sub initialize {
+     my $field_names = $config->{CREDENTIALS} || [qw(authen_username 
authen_password)];
+ 
+     my $query = $self->_cgiapp->query;
+-    my @credentials = map { $query->param($_) } @$field_names;
++    my @credentials = map { scalar $query->param($_) } @$field_names;
+     if ($credentials[0]) {
+         # The user is trying to login
+         # make sure if they are already logged in, that we log them out first
+diff --git a/lib/CGI/Application/Plugin/Authentication/Driver/Filter/crypt.pm 
b/lib/CGI/Application/Plugin/Authentication/Driver/Filter/crypt.pm
+index 48dd28d..07377d4 100644
+--- a/lib/CGI/Application/Plugin/Authentication/Driver/Filter/crypt.pm
++++ b/lib/CGI/Application/Plugin/Authentication/Driver/Filter/crypt.pm
+@@ -15,7 +15,7 @@ sub check {
+ 
+ sub filter {
+     my $class = shift;
+-    my $param = lc shift; # not used
++    shift; # not used
+     my $plain = shift;
+     my $salt  = shift;
+     if (!$salt) {
+diff --git a/lib/CGI/Application/Plugin/Authentication/Driver/Filter/md5.pm 
b/lib/CGI/Application/Plugin/Authentication/Driver/Filter/md5.pm
+index 4b51ecf..56a0bea 100644
+--- a/lib/CGI/Application/Plugin/Authentication/Driver/Filter/md5.pm
++++ b/lib/CGI/Application/Plugin/Authentication/Driver/Filter/md5.pm
+@@ -25,7 +25,7 @@ sub check {
+ 
+ sub filter {
+     my $class = shift;
+-    my $param = lc shift || 'hex';
++    my $param = lc( shift || 'hex' );
+     my $plain = shift;
+ 
+     Digest::MD5->require || die "Digest::MD5 is required to check MD5 
passwords";
+diff --git a/lib/CGI/Application/Plugin/Authentication/Driver/Filter/sha1.pm 
b/lib/CGI/Application/Plugin/Authentication/Driver/Filter/sha1.pm
+index 610e9fa..b9f2f24 100644
+--- a/lib/CGI/Application/Plugin/Authentication/Driver/Filter/sha1.pm
++++ b/lib/CGI/Application/Plugin/Authentication/Driver/Filter/sha1.pm
+@@ -25,7 +25,7 @@ sub check {
+ 
+ sub filter {
+     my $class = shift;
+-    my $param = lc shift || 'hex';
++    my $param = lc( shift || 'hex' );
+     my $plain = shift;
+ 
+     Digest::SHA->require || die "Digest::SHA is required to check SHA1 
passwords";
+-- 
+2.1.0
+
diff --git a/perl-CGI-Application-Plugin-Authentication.spec 
b/perl-CGI-Application-Plugin-Authentication.spec
index a834ee7..53e76e1 100644
--- a/perl-CGI-Application-Plugin-Authentication.spec
+++ b/perl-CGI-Application-Plugin-Authentication.spec
@@ -1,6 +1,6 @@
 Name:           perl-CGI-Application-Plugin-Authentication
 Version:        0.20
-Release:        11%{?dist}
+Release:        12%{?dist}
 Summary:        Authentication framework for CGI::Application
 License:        GPL+ or Artistic
 
@@ -8,6 +8,8 @@ URL:            
http://search.cpan.org/dist/CGI-Application-Plugin-Authenticatio
 Source0:        
http://www.cpan.org/authors/id/S/SI/SILASMONK/CGI-Application-Plugin-Authentication-%{version}.tar.gz
 # Disable tests failing due to hash randomization, CPAN RT#85969
 Patch0:         
CGI-Application-Plugin-Authentication-0.20-links-in-html-tests-break-on-hash-reordering.patch
+# Fix warnings, bug #1195338, CPAN RT#99460
+Patch1:         
CGI-Application-Plugin-Authentication-0.20-Silent-various-warnings.patch
 
 BuildArch:      noarch
 BuildRequires:  perl(Apache::Htpasswd)
@@ -22,6 +24,7 @@ BuildRequires:  perl(Crypt::PasswdMD5)
 BuildRequires:  perl(DBD::SQLite)
 BuildRequires:  perl(Digest::SHA)
 BuildRequires:  perl(Module::Build)
+BuildRequires:  perl(overload)
 BuildRequires:  perl(Readonly)
 BuildRequires:  perl(Task::Weaken)
 BuildRequires:  perl(Test::ConsistentVersion)
@@ -36,6 +39,7 @@ BuildRequires:  perl(Test::Warn)
 BuildRequires:  perl(Test::Without::Module)
 BuildRequires:  perl(UNIVERSAL::require)
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo 
$version))
+Requires:       perl(overload)
 
 %{?perl_default_filter}
 
@@ -49,6 +53,7 @@ CGI::Application::Plugin::Authentication plugin.
 %prep
 %setup -q -n CGI-Application-Plugin-Authentication-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{__perl} Build.PL installdirs=vendor
@@ -69,6 +74,9 @@ find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 
2>/dev/null \;
 %{_mandir}/man3/*
 
 %changelog
+* Tue May 12 2015 Petr Pisar <ppi...@redhat.com> - 0.20-12
+- Fix warnings (bug #1195338)
+
 * Fri Aug 29 2014 Jitka Plesnikova <jples...@redhat.com> - 0.20-11
 - Perl 5.20 rebuild
 
-- 
cgit v0.10.2


        
http://pkgs.fedoraproject.org/cgit/perl-CGI-Application-Plugin-Authentication.git/commit/?h=master&id=e91d9b7385585023653ebffbeb0b083333afc949
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/perl-devel

Reply via email to