[libauthen-simple-http-perl] 03/04: Add patch to fix incompatibility with LWP 6.x

Daniel Lintott dlintott-guest at moszumanska.debian.org
Fri Apr 25 14:00:43 UTC 2014


This is an automated email from the git hooks/post-receive script.

dlintott-guest pushed a commit to branch master
in repository libauthen-simple-http-perl.

commit a8a3058720cfb41221af749c4e21a0d3794c68a9
Author: Daniel Lintott <daniel at serverb.co.uk>
Date:   Fri Apr 25 14:56:21 2014 +0100

    Add patch to fix incompatibility with LWP 6.x
    
    https://rt.cpan.org/Public/Bug/Display.html?id=82575
---
 debian/patches/LWP-fix.patch | 75 ++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series        |  1 +
 2 files changed, 76 insertions(+)

diff --git a/debian/patches/LWP-fix.patch b/debian/patches/LWP-fix.patch
new file mode 100644
index 0000000..ea4891c
--- /dev/null
+++ b/debian/patches/LWP-fix.patch
@@ -0,0 +1,75 @@
+Description: Fix for incompatability with LWP 6.x under persistent environments
+ LWP::UserAgent::credentials and LWP::UserAgent::get_basic_credentials changed at some 
+ point around after 5.805 and before 6.02. Also, LWP::Authen::Basic changed. 
+ .
+ Authen::Simple::HTTP implements credential handling by overriding the 
+ get_basic_credentials methods in LWP::UserAgent (or the given LWP class).
+ .
+ This breaks with the new LWP because Authen::Simple::HTTP keeps the LWP::UserAgent 
+ instance as class data (Class::Data::Inheritable), so a new instance of LWP isn't 
+ created for every new Authen::Simple::HTTP... and LWP is caching the user/pass per 
+ instance (per host+port+realm) via the credentials sub in an instance variable.
+Author: Joshua I. Miller <unrtst at cpan.org>
+Origin: https://rt.cpan.org/Public/Bug/Display.html?id=82575
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=82575
+Reviewed-by: Daniel Lintott <daniel at serverb.co.uk>
+Last-Update: 2014-04-25
+--- a/Changes
++++ b/Changes
+@@ -1,5 +1,12 @@
+ Revision history for Perl extension Authen::Simple::HTTP
+ 
++    - work around for libwww-perl 6.x+ when used in a persistent environment.
++      LWP::UserAgent sub credentials and get_basic_credentials changed and now
++      cache data per-instance differently than before.
++      LWP::Authen::Basic calls credentials directly, which will get the previously
++      used credentials under this new version of LWP. This breaks persistent usage
++      of Authen::Simple::HTTP (ex. using it undef mod_perl).
++
+ 0.2 2006-01-12 00:00
+     - use HEAD method instead of GET.
+ 
+--- a/lib/Authen/Simple/HTTP.pm
++++ b/lib/Authen/Simple/HTTP.pm
+@@ -33,7 +33,9 @@
+     # way to implement this without forking a lot of code from LWP::UserAgent.
+     # Please let me know if you have any ideas of improvements.
+ 
+-    my $override = sprintf '%s::get_basic_credentials', ref $self->agent;
++    my $lwpclass  = ref $self->agent;
++    my $override  = sprintf '%s::get_basic_credentials', $lwpclass;
++    my $override2 = sprintf '%s::credentials', $lwpclass;
+     my $response = undef;
+     my $url      = $self->url;
+ 
+@@ -46,6 +48,11 @@
+         local *$override = sub {
+             return ( undef, undef );
+         };
++        # make sure we don't use cached credentials (interaction bug between us and LWP 6.x)
++        local *$override2 = sub {
++            # we want to force no user/pass at this point... so just return
++            return;
++        };
+ 
+         $response = $self->agent->head($url);
+     }
+@@ -75,6 +82,18 @@
+         local *$override = sub {
+             return ( $username, $password );
+         };
++        # save orig credentials subref
++        my $credentials_sub = $self->agent->can( 'credentials' );
++        # make sure we don't use cached credentials (interaction bug between us and LWP 6.x)
++        local *$override2 = sub {
++            my $self = shift;
++            my $netloc = shift;
++            my $realm  = shift;
++            # call orig method to set any instance variables, forcing user/pass
++            $credentials_sub->( $self, $netloc, $realm, $username, $password );
++            # call orig method as a getter to get what we just put there
++            return $credentials_sub->( $self, $netloc, $realm );
++        };
+ 
+         $response = $self->agent->head($url);
+     }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0dab073
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+LWP-fix.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libauthen-simple-http-perl.git



More information about the Pkg-perl-cvs-commits mailing list