Subject: | LWP::Debug::debug called, no 'use LWP::Debug;' |
LWP::Authen::Negotiate (0.06) calls LWP::Debug::debug() without use'ing
LWP::Debug - and so it dies with an Undefined subroutine error.
This can be reproduced by running this script:
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $response = $ua->get('http://localhost:3000/');
if ($response->is_success) {
print $response->content;
}
else {
die $response->status_line;
}
(almost directly from the documentation) against something that requests
WWW-Authentication: Negotiate.
I simply ran "socket -s 3000", then the test-script above, and pasted
this back to the test-script:
HTTP/1.1 401 Authorization Required
WWW-Authenticate: Negotiate
Connection: close
Content-Type: text/html
TEST
^C
Which resulted in:
$ ./test.pl
Undefined subroutine &LWP::Debug::debug called at
/usr/share/perl/LWP/Authen/Negotiate.pm line 37.
$
I think the trivial fix is to add 'use LWP::Debug;' in
LWP/Authen/Negotiate.pm (patch included.)
LWP::Debug is deprecated, so a more elaborate fix would perhaps be to
stop using the module?
Best regards,
Adam
--- LWP/Authen/Negotiate.pm.orig 2009-09-18 10:58:49.000000000 +0200
+++ LWP/Authen/Negotiate.pm 2009-10-27 14:49:31.000000000 +0100
@@ -30,7 +30,7 @@
use MIME::Base64 "2.12";
use GSSAPI 0.18;
-
+use LWP::Debug;
sub authenticate
{