Bugzilla – Attachment 31619 Details for
Bug 12831
local only logins should still work when ldap authentication is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12831 - local only logins should work with LDAP
Bug-12831---local-only-logins-should-work-with-LDA.patch (text/plain), 1.50 KB, created by
Chris Cormack
on 2014-09-16 08:58:03 UTC
(
hide
)
Description:
Bug 12831 - local only logins should work with LDAP
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-09-16 08:58:03 UTC
Size:
1.50 KB
patch
obsolete
>From 4f33e1bdd2ccf5c44e8b6aa8501319f62d2d81da Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Fri, 29 Aug 2014 13:37:07 +0200 >Subject: [PATCH] Bug 12831 - local only logins should work with LDAP > >This fixes regression introducted in Bug 8148. > >If ldap is enabled, and using auth_by_bind, one will not be able to login >using any local accounts which do not appear in the ldap directory. > >This is problematic because a number of koha system accounts are unlikely >to have a parallel in the active directory.. for instance SIP Service User >accounts. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> > >Seems to work as advertised, there may be other error codes we need to >trap, but this is a good start >--- > C4/Auth_with_ldap.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index b42506d..c313af9 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/C4/Auth_with_ldap.pm >@@ -146,7 +146,11 @@ sub checkpw_ldap { > my $res = $db->bind( $principal_name, password => $password ); > if ( $res->code ) { > warn "LDAP bind failed as kohauser $userid: " . description($res); >- return -1; >+ if ( $res->code == 34 ) { # invalid DN, probably local user >+ return 0; # fallback to local auth >+ } else { >+ return -1; # invalid password >+ } > } > if ( !defined($userldapentry) > && ( $config{update} or $config{replicate} ) ) >-- >1.9.1
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 12831
:
31275
|
31619
|
33868
|
33946
|
33989
|
34002
|
34003