From 488c0aa79eab91d1911c2fd40846f4449de22e89 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 20 Sep 2013 17:21:40 +0200 Subject: [PATCH] Bug 10925: fix LDAP auth failing if DEBUG is enabled 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 prints to 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 Signed-off-by: Galen Charlton (cherry picked from commit 561107bb5b348eaa14054e3470f39ff9cf080d22) Signed-off-by: Tomas Cohen Arazi --- 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 d7a5e9a3cf..0efeb95dca 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; -- 2.39.5