[Bug 10384] New: Software error when LDAP connexion fails
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Bug ID: 10384 Summary: Software error when LDAP connexion fails Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Authentication Assignee: gmcharlt@gmail.com Reporter: fridolyn.somers@biblibre.com CC: dpavlin@rot13.org 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 /home/fsomers/workspace/versions/community_master/C4/Auth_with_ldap.pm line 134, <DATA> line 558. This error should be avoided to allow normal authentication when LDAP connexion fails. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|gmcharlt@gmail.com |fridolyn.somers@biblibre.co | |m --- Comment #1 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 18540 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18540&action=edit Proposed patch See commit message -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 --- Comment #2 from Galen Charlton <gmcharlt@gmail.com> --- Comment on attachment 18540 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18540 Proposed patch Review of attachment 18540: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=10384&attachment=18540) ----------------------------------------------------------------- ::: C4/Auth_with_ldap.pm @@ +103,5 @@
my ($dbh, $userid, $password) = @_; my @hosts = split(',', $prefhost); my $db = Net::LDAP->new(\@hosts); + unless ( $db ) { + $debug and warn "LDAP connexion failed";
I think this might be better as a plain warn -- being unable to connect to the LDAP server is an operational problem that should be logged. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18540|0 |1 is obsolete| | --- Comment #3 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 18641 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18641&action=edit Proposed patch Here is a new patch with warn regardless to debug mode. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18641|0 |1 is obsolete| | --- Comment #4 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 19197 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19197&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19197|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 19403 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19403&action=edit 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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #6 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Fridolyn! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |tomascohen@gmail.com --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This patch has been pushed to 3.12.x, will be in 3.12.2. Thanks Fridolyn! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com --- Comment #8 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Pushed to 3.10.x, will be in 3.10.10 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10384 Chris Hall <chrish@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chrish@catalyst.net.nz --- Comment #9 from Chris Hall <chrish@catalyst.net.nz> --- Pushed to 3.8.x, will be in 3.8.17 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org