Projet

Général

Profil

0001-ldap-differentiate-errors-during-bind-51353.patch

Valentin Deniaud, 24 février 2021 14:43

Télécharger (1,32 ko)

Voir les différences:

Subject: [PATCH] ldap: differentiate errors during bind (#51353)

 src/authentic2/backends/ldap_backend.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
src/authentic2/backends/ldap_backend.py
1449 1449
            return False, u'invalid credentials'
1450 1450
        except ldap.INVALID_DN_SYNTAX:
1451 1451
            return False, u'invalid dn syntax %s' % who
1452
        except (ldap.TIMEOUT, ldap.CONNECT_ERROR, ldap.SERVER_DOWN):
1453
            return False, u'ldap is down'
1452
        except ldap.CONNECT_ERROR:
1453
            log.error('connection to %r failed, did you forget to declare the TLS certificate '
1454
                      'in /etc/ldap/ldap.conf ?', block['url'])
1455
        except ldap.TIMEOUT:
1456
            log.error('connection to %r timed out', block['url'])
1457
        except ldap.SERVER_DOWN:
1458
            log.error('ldap authentication error: %r is down', block['url'])
1454 1459

  
1455 1460
    @classmethod
1456 1461
    def get_connection(cls, block, credentials=()):
1457
-