diff options
Diffstat (limited to 'modules/extra/m_ldap.cpp')
-rw-r--r-- | modules/extra/m_ldap.cpp | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 1005d2efe..b72c9af56 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -29,18 +29,15 @@ class LDAPRequest public: LDAPService *service; LDAPInterface *inter; - LDAPMessage *message; /* message returned by ldap_ */ - LDAPResult *result; /* final result */ + LDAPMessage *message = nullptr; /* message returned by ldap_ */ + LDAPResult *result = nullptr; /* final result */ struct timeval tv; - QueryType type; + QueryType type = QUERY_UNKNOWN; LDAPRequest(LDAPService *s, LDAPInterface *i) : service(s) , inter(i) - , message(NULL) - , result(NULL) { - type = QUERY_UNKNOWN; tv.tv_sec = 0; tv.tv_usec = 100000; } @@ -70,7 +67,7 @@ class LDAPBind : public LDAPRequest type = QUERY_BIND; } - int run() anope_override; + int run() override; }; class LDAPSearch : public LDAPRequest @@ -87,7 +84,7 @@ class LDAPSearch : public LDAPRequest type = QUERY_SEARCH; } - int run() anope_override; + int run() override; }; class LDAPAdd : public LDAPRequest @@ -104,7 +101,7 @@ class LDAPAdd : public LDAPRequest type = QUERY_ADD; } - int run() anope_override; + int run() override; }; class LDAPDel : public LDAPRequest @@ -119,7 +116,7 @@ class LDAPDel : public LDAPRequest type = QUERY_DELETE; } - int run() anope_override; + int run() override; }; class LDAPModify : public LDAPRequest @@ -136,7 +133,7 @@ class LDAPModify : public LDAPRequest type = QUERY_MODIFY; } - int run() anope_override; + int run() override; }; class LDAPService : public LDAPProvider, public Thread, public Condition @@ -147,7 +144,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition LDAP *con; - time_t last_connect; + time_t last_connect = 0; public: static LDAPMod **BuildMods(const LDAPMods &attributes) @@ -232,7 +229,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition query_queue queries, results; Mutex process_mutex; /* held when processing requests not in either queue */ - LDAPService(Module *o, const Anope::string &n, const Anope::string &s, const Anope::string &b, const Anope::string &p) : LDAPProvider(o, n), server(s), admin_binddn(b), admin_pass(p), last_connect(0) + LDAPService(Module *o, const Anope::string &n, const Anope::string &s, const Anope::string &b, const Anope::string &p) : LDAPProvider(o, n), server(s), admin_binddn(b), admin_pass(p) { Connect(); } @@ -275,18 +272,18 @@ class LDAPService : public LDAPProvider, public Thread, public Condition ldap_unbind_ext(this->con, NULL, NULL); } - void BindAsAdmin(LDAPInterface *i) anope_override + void BindAsAdmin(LDAPInterface *i) override { this->Bind(i, this->admin_binddn, this->admin_pass); } - void Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) anope_override + void Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) override { LDAPBind *b = new LDAPBind(this, i, who, pass); QueueRequest(b); } - void Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) anope_override + void Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) override { if (i == NULL) throw LDAPException("No interface"); @@ -295,19 +292,19 @@ class LDAPService : public LDAPProvider, public Thread, public Condition QueueRequest(s); } - void Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) anope_override + void Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) override { LDAPAdd *add = new LDAPAdd(this, i, dn, attributes); QueueRequest(add); } - void Del(LDAPInterface *i, const Anope::string &dn) anope_override + void Del(LDAPInterface *i, const Anope::string &dn) override { LDAPDel *del = new LDAPDel(this, i, dn); QueueRequest(del); } - void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) anope_override + void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) override { LDAPModify *mod = new LDAPModify(this, i, base, attributes); QueueRequest(mod); @@ -414,7 +411,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition } public: - void Run() anope_override + void Run() override { while (!this->GetExitState()) { @@ -457,7 +454,7 @@ class ModuleLDAP : public Module, public Pipe LDAPServices.clear(); } - void OnReload(Configuration::Conf *config) anope_override + void OnReload(Configuration::Conf *config) override { Configuration::Block *conf = config->GetModule(this); @@ -513,7 +510,7 @@ class ModuleLDAP : public Module, public Pipe } } - void OnModuleUnload(User *, Module *m) anope_override + void OnModuleUnload(User *, Module *m) override { for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end(); ++it) { @@ -550,7 +547,7 @@ class ModuleLDAP : public Module, public Pipe } } - void OnNotify() anope_override + void OnNotify() override { for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end(); ++it) { |