From dbfcc74e23067a1cc2ceb3bccfff9e8868947419 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 9 Jan 2022 14:38:01 +0000 Subject: Always catch exceptions as a constant reference. --- src/modules/m_ldapauth.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/m_ldapauth.cpp') diff --git a/src/modules/m_ldapauth.cpp b/src/modules/m_ldapauth.cpp index 05d1d822e..96704e2e3 100644 --- a/src/modules/m_ldapauth.cpp +++ b/src/modules/m_ldapauth.cpp @@ -167,7 +167,7 @@ class BindInterface final LDAP->Compare(this, DN, attr, val); ++attrCount; } - catch (LDAPException &ex) + catch (const LDAPException& ex) { if (verbose) ServerInstance->SNO.WriteToSnoMask('c', "Unable to compare attributes %s=%s: %s", attr.c_str(), val.c_str(), ex.GetReason().c_str()); @@ -244,7 +244,7 @@ class SearchInterface final LDAP->Bind(new BindInterface(this->creator, provider, uid, bindDn), bindDn, user->password); } - catch (LDAPException& ex) + catch (const LDAPException& ex) { ServerInstance->SNO.WriteToSnoMask('a', "Error searching LDAP server: " + ex.GetReason()); } @@ -284,7 +284,7 @@ class AdminBindInterface final { LDAP->Search(new SearchInterface(this->creator, provider, uuid), base, what); } - catch (LDAPException& ex) + catch (const LDAPException& ex) { ServerInstance->SNO.WriteToSnoMask('a', "Error searching LDAP server: " + ex.GetReason()); } @@ -428,7 +428,7 @@ public: { LDAP->BindAsManager(new AdminBindInterface(this, LDAP.GetProvider(), user->uuid, base, what)); } - catch (LDAPException &ex) + catch (const LDAPException& ex) { ServerInstance->SNO.WriteToSnoMask('a', "LDAP exception: " + ex.GetReason()); ServerInstance->Users.QuitUser(user, killreason); -- cgit v1.3.1-10-gc9f91