Projet

Général

Profil

0001-ldap-do-not-validate-session-stored-settings-fixes-2.patch

Benjamin Dauvergne, 19 juillet 2018 13:53

Télécharger (1,61 ko)

Voir les différences:

Subject: [PATCH] ldap: do not validate session stored settings (fixes #25369)

 src/authentic2/backends/ldap_backend.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/authentic2/backends/ldap_backend.py
201 201
        # must be redone if session is older than current code update and new
202 202
        # options have been added to the setting dictionnary for LDAP
203 203
        # authentication
204
        self.ldap_backend.update_default(self.block)
204
        self.ldap_backend.update_default(self.block, validate=False)
205 205
        return self.ldap_backend.get_connection(self.block, credentials=credentials)
206 206

  
207 207
    def get_attributes(self):
......
1088 1088
        log.error('could not get a connection')
1089 1089

  
1090 1090
    @classmethod
1091
    def update_default(cls, block):
1091
    def update_default(cls, block, validate=True):
1092 1092
        '''Add missing key to block based on default values'''
1093 1093
        for key in block:
1094
            if key not in cls._VALID_CONFIG_KEYS:
1094
            if key not in cls._VALID_CONFIG_KEYS and validate:
1095 1095
                raise ImproperlyConfigured(
1096 1096
                    '"{}" : invalid LDAP_AUTH_SETTINGS key, available are {}'.format(
1097 1097
                        key, cls._VALID_CONFIG_KEYS))
1098
-