From 59464915fd0ad74087b31c76014bebbfad7412f6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 20 Sep 2013 17:21:40 +0200 Subject: [PATCH] Bug 10925: LDAP auth fails if DEBUG is enable To reproduce: 1/ Edit your apache virtual host and set the DEBUG environment variable (SetEnv DEBUG 1). 2/ Try to login with an ldap user 3/ You will be redirected to the 500 error page. The Koha logs contains: malformed header from script. Bad header=------------------------------: mainpage.pl The hashdump routine directly punks to the STDOUT (!) and breaks the headers. It appears Net::LDAP::?->dump does the same thing. Signed-off-by: Mark Tompsett Signed-off-by: Chris Cormack Maybe we can kill C4::Utils after getting rid of this --- C4/Auth_with_ldap.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index d7a5e9a..0efeb95 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -26,7 +26,6 @@ use C4::Context; use C4::Members qw(AddMember changepassword); use C4::Members::Attributes; use C4::Members::AttributeTypes; -use C4::Utils qw( :all ); use List::MoreUtils qw( any ); use Net::LDAP; use Net::LDAP::Filter; @@ -203,10 +202,8 @@ sub ldap_entry_2_hash { my %memberhash; $userldapentry->exists('uid'); # This is bad, but required! By side-effect, this initializes the attrs hash. if ($debug) { - print STDERR "\nkeys(\%\$userldapentry) = " . join(', ', keys %$userldapentry), "\n", $userldapentry->dump(); foreach (keys %$userldapentry) { print STDERR "\n\nLDAP key: $_\t", sprintf('(%s)', ref $userldapentry->{$_}), "\n"; - hashdump("LDAP key: ",$userldapentry->{$_}); } } my $x = $userldapentry->{attrs} or return; -- 1.8.1.2