Bugzilla – Attachment 33868 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 with LDAP
BUG-12831-Local-Only-logins-with-LDAP.patch (text/plain), 2.05 KB, created by
Martin Renvoize (ashimema)
on 2014-11-24 16:12:59 UTC
(
hide
)
Description:
BUG 12831: Local Only logins with LDAP
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2014-11-24 16:12:59 UTC
Size:
2.05 KB
patch
obsolete
>From 5f334e48e060cea05abf33cceb3bddff1c12251a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 24 Nov 2014 16:07:58 +0000 >Subject: [PATCH] BUG 12831: Local Only logins with LDAP > >Local only logins should continue to function when LDAP is enabled. >This was not the case after bug 8148 [LDAP Auth should FAIL when ldap >contains a NEW password]. For this case, we need to diferentiate >between local accounts and ldap accounts. This is somewhat challenging >and thus this patch is only part of the story. > >The other half can be achieved with bug 9165 >--- > C4/Auth_with_ldap.pm | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index b42506d..e781baf 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/C4/Auth_with_ldap.pm >@@ -145,8 +145,19 @@ sub checkpw_ldap { > # Perform a LDAP bind for the given username using the matched DN > my $res = $db->bind( $principal_name, password => $password ); > if ( $res->code ) { >- warn "LDAP bind failed as kohauser $userid: " . description($res); >- return -1; >+ if ( $ldap->{anonymous_bind} ) { >+ # With anonymous_bind approach we can be sure we have found the correct user >+ # and that any 'code' response indicates a 'bad' user (be that blocked, banned >+ # or password changed). We should not fall back to local accounts in this case. >+ warn "LDAP bind failed as kohauser $userid: " . description($res); >+ return -1; >+ } else { >+ # Without a anonymous_bind, we cannot be sure we are looking at a valid ldap user >+ # at all, and thus we should fall back to local logins to restore previous behaviour >+ # see bug 12831 >+ warn "LDAP bind failed as kohauser $userid: " . description($res); >+ return 0; >+ } > } > if ( !defined($userldapentry) > && ( $config{update} or $config{replicate} ) ) >-- >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 12831
:
31275
|
31619
|
33868
|
33946
|
33989
|
34002
|
34003