Skip to content

Commit

Permalink
Log LDAP info error (e.g. expired SSL cert error)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoschwald authored and sduehr committed Nov 4, 2021
1 parent d1e6689 commit 653fb00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/plugins/filed/python/ldap/BareosFdPluginLDAP.py
Expand Up @@ -256,16 +256,16 @@ def connect_and_bind(self, options, bulk=False):
except ldap.INVALID_CREDENTIALS:
bareosfd.JobMessage(
bareosfd.bJobMessageType["M_FATAL"],
"Failed to bind to LDAP uri %s\n" % (options["uri"]),
"Failed to bind to LDAP uri due to invalid credentials %s\n" % (options["uri"]),
)

return bareosfd.bRC_Error
except ldap.LDAPError as e:
if type(e.message) == dict and "desc" in e.message:
bareosfd.JobMessage(
bareosfd.bJobMessageType["M_FATAL"],
"Failed to bind to LDAP uri %s: %s\n"
% (options["uri"], e.message["desc"]),
"Failed to bind to LDAP uri %s: %s %s\n"
% (options["uri"], e.message["desc"], e.message["info"]),
)
else:
bareosfd.JobMessage(
Expand Down

0 comments on commit 653fb00

Please sign in to comment.