From 8a0dd2989915d4c19a91d86bcda1c859a7abd87d Mon Sep 17 00:00:00 2001 From: MANALIMALPANI Date: Fri, 18 Jun 2021 08:08:52 +0000 Subject: [PATCH] [FIX] auth_ldap: fix LDAP error handling In order to ensure consistent results of all error conditions returned by the LDAP server, the _authenticate() method should return `False` for every kind of exception, not just for INVALID_CREDENTIALS. This is not actually relevant in 12.0 as the result is exactly the same, due to the way the `entry` variable is being initialized, but it will make the code path "visibly consistent" across all supported versions closes odoo/odoo#72484 X-original-commit: 24a3f669e5199c35849dabbf7b0d37f43b684538 Signed-off-by: Olivier Dony (odo) --- addons/auth_ldap/models/res_company_ldap.py | 1 + doc/cla/individual/manalimalpani.md | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 doc/cla/individual/manalimalpani.md diff --git a/addons/auth_ldap/models/res_company_ldap.py b/addons/auth_ldap/models/res_company_ldap.py index 56779ed61b4..34e9cfdbad6 100644 --- a/addons/auth_ldap/models/res_company_ldap.py +++ b/addons/auth_ldap/models/res_company_ldap.py @@ -139,6 +139,7 @@ class CompanyLDAP(models.Model): return False except ldap.LDAPError as e: _logger.error('An LDAP exception occurred: %s', e) + return False return entry def _query(self, conf, filter, retrieve_attributes=None): diff --git a/doc/cla/individual/manalimalpani.md b/doc/cla/individual/manalimalpani.md new file mode 100644 index 00000000000..1668fde3a2f --- /dev/null +++ b/doc/cla/individual/manalimalpani.md @@ -0,0 +1,10 @@ +Ireland, 2021-06-18 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, +Manali Malpani manali.malpani@ibm.com https://github.com/manali-malpani \ No newline at end of file