Project

General

Profile

0003-ldap-log-a-more-verbose-error-message.patch

Loïc Dachary, 11 February 2021 04:10 PM

Download (1.29 KB)

View differences:

Subject: [PATCH 3/4] ldap: log a more verbose error message

 src/authentic2/backends/ldap_backend.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/authentic2/backends/ldap_backend.py
575 575
        for c in ctrls:
576 576
            if c.controlType == ppolicy.PasswordPolicyControl.controlType:
577 577
                message = ' '.join(password_policy_control_messages(c))
578
                log.info('%s: %s', authz_id, message)
579 578
                if request is not None:
580 579
                    messages.add_message(request, messages.WARNING, message)
581 580
            else:
582
                log.info('%s: %s', authz_id, vars(c))
581
                message = str(vars(c))
582
            log.info('ldap: bind error with authz_id "%s" -> "%s"', authz_id, message)
583 583

  
584 584
    def authenticate(self, request=None, username=None, password=None, realm=None, ou=None):
585 585
        if username is None or password is None:
586
-