Bug 18947: LDAP - do not assume anonymous bind if no user or password
authorNick Clemens <nick@bywatersolutions.com>
Wed, 13 Dec 2017 13:27:36 +0000 (13:27 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 24 Sep 2018 12:59:44 +0000 (14:59 +0200)
commit0c56d4e0f3112557c484954491e990c1d39abbd3
tree324030470a1b50acb82613bcc7428e8926285b42
parentb535a0da267c3b1dd4e833a0af3bae48d28879e9
Bug 18947: LDAP - do not assume anonymous bind if no user or password

To test:
Ideally tested on a working ldap server with bind by auth and no
anonymous bind
1  - Define an LDAP config with bind by auth
2  - Don't define user/pass
3  - Define anonymous_bind = 0
4  - Attempt bind by auth
5  - Error is something like:
LDAP search failed to return object : XXXXXXXXX: LdapErr: XXXX-XXXXXX,
     comment: In order to perform this operation a successful bind must
     be completed on the connection., data 0, v2580 at
     /usr/share/koha/lib/C4/Auth_with_ldap.pm line 102.
6  - Define user/pass
7  - Now bind by auth should work
8  - remove user/pass
9  - Apply patch
10 - Attempt again
11 - Bind by auth shoudl succeed

prove -v t/db_dependent/Auth_with_ldap.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8eed0466381435a0426fe9c2ea75fa295d906533)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2cb4bbd8baba9df1177fb965619df0328263541f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7b5968612d251c0a40e06f4bed1a99fa951d2b23)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Auth_with_ldap.pm
t/db_dependent/Auth_with_ldap.t