Bugzilla – Attachment 19197 Details for
Bug 10384
Software error when LDAP connexion fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10384 - Software error when LDAP connexion fails
Bug-10384---Software-error-when-LDAP-connexion-fai.patch (text/plain), 2.11 KB, created by
Chris Cormack
on 2013-06-23 06:59:48 UTC
(
hide
)
Description:
Bug 10384 - Software error when LDAP connexion fails
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2013-06-23 06:59:48 UTC
Size:
2.11 KB
patch
obsolete
>From 4bd88fdfa494ab670dc1288aee27cf877d80ac41 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Fri, 31 May 2013 10:17:08 +0200 >Subject: [PATCH] Bug 10384 - Software error when LDAP connexion fails > >When using LDAP authentication, the authentication falls back to normal authentication if user does not exist in LDAP. > >Actually, if the LDAP server is down, you get a software error (even with mysql user) : >Can't call method "bind" on an undefined value at C4/Auth_with_ldap.pm line 134, <DATA> line 558. > >This patch catches this error to allow normal authentication when LDAP connexion fails. > >Test plan : >- Configure LDAP connexion with a host not having LDAP. ie : > <useldapserver>1</useldapserver> > <ldapserver id="ldapserver"> > <hostname>localhost</hostname> > <base>dc=test,dc=com</base> > <user>cn=Manager,dc=test,dc=com</user> > <pass>passwd</pass> > <replicate>0</replicate> > <update>0</update> > <auth_by_bind>0</auth_by_bind> > <mapping> > <firstname is="givenname" ></firstname> > <surname is="sn" ></surname> > <branchcode is="branch" >MAIN</branchcode> > <userid is="uid" ></userid> > <password is="userpassword" ></password> > <email is="mail" ></email> > <categorycode is="employeetype" >PT</categorycode> > </mapping> > </ldapserver> >- Try to connect with mysql user (defined in koha-conf.xml) >- Try to connect with a user defined in borrowers >You may try to connect with working LDAP connexion > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > C4/Auth_with_ldap.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index 1f2f617..6143c9f 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/C4/Auth_with_ldap.pm >@@ -103,6 +103,11 @@ sub checkpw_ldap { > my ($dbh, $userid, $password) = @_; > my @hosts = split(',', $prefhost); > my $db = Net::LDAP->new(\@hosts); >+ unless ( $db ) { >+ warn "LDAP connexion failed"; >+ return 0; >+ } >+ > #$debug and $db->debug(5); > my $userldapentry; > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10384
:
18540
|
18641
|
19197
|
19403