diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 8 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_blockcaps.cpp | 14 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_connectban.cpp | 15 | ||||
-rw-r--r-- | src/modules/m_nationalchars.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_xline_db.cpp | 2 |
7 files changed, 16 insertions, 35 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index a3502a57b..28755f05e 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -684,10 +684,10 @@ class ModuleSSLGnuTLS : public Module ConfigTag* Conf = ServerInstance->Config->ConfValue("gnutls"); - cafile = Conf->getString("cafile", CONFIG_PATH "/ca.pem"); - crlfile = Conf->getString("crlfile", CONFIG_PATH "/crl.pem"); - certfile = Conf->getString("certfile", CONFIG_PATH "/cert.pem"); - keyfile = Conf->getString("keyfile", CONFIG_PATH "/key.pem"); + cafile = ServerInstance->Config->Paths.PrependConfig(Conf->getString("cafile", "ca.pem")); + crlfile = ServerInstance->Config->Paths.PrependConfig(Conf->getString("crlfile", "crl.pem")); + certfile = ServerInstance->Config->Paths.PrependConfig(Conf->getString("certfile", "cert.pem")); + keyfile = ServerInstance->Config->Paths.PrependConfig(Conf->getString("keyfile", "key.pem")); int dh_bits = Conf->getInt("dhbits"); std::string hashname = Conf->getString("hash", "md5"); diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 29f574fd0..c94527ab0 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -558,10 +558,10 @@ class ModuleSSLOpenSSL : public Module ConfigTag* conf = ServerInstance->Config->ConfValue("openssl"); - cafile = conf->getString("cafile", CONFIG_PATH "/ca.pem"); - certfile = conf->getString("certfile", CONFIG_PATH "/cert.pem"); - keyfile = conf->getString("keyfile", CONFIG_PATH "/key.pem"); - dhfile = conf->getString("dhfile", CONFIG_PATH "/dhparams.pem"); + cafile = ServerInstance->Config->Paths.PrependConfig(conf->getString("cafile", "ca.pem")); + certfile = ServerInstance->Config->Paths.PrependConfig(conf->getString("certfile", "cert.pem")); + keyfile = ServerInstance->Config->Paths.PrependConfig(conf->getString("keyfile", "key.pem")); + dhfile = ServerInstance->Config->Paths.PrependConfig(conf->getString("dhfile", "dhparams.pem")); std::string hash = conf->getString("hash", "md5"); iohook.digest = EVP_get_digestbyname(hash.c_str()); diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index 8e7d76f4a..f80c6d16d 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -104,22 +104,12 @@ public: void ReadConf() { ConfigTag* tag = ServerInstance->Config->ConfValue("blockcaps"); - percent = tag->getInt("percent", 100); - minlen = tag->getInt("minlen", 1); + percent = tag->getInt("percent", 100, 1, 100); + minlen = tag->getInt("minlen", 1, 1, ServerInstance->Config->Limits.MaxLine); std::string hmap = tag->getString("capsmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); memset(capsmap, 0, sizeof(capsmap)); for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) capsmap[(unsigned char)*n] = 1; - if (percent < 1 || percent > 100) - { - ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "<blockcaps:percent> out of range, setting to default of 100."); - percent = 100; - } - if (minlen < 1 || minlen > ServerInstance->Config->Limits.MaxLine) - { - ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "<blockcaps:minlen> out of range, setting to default of 1."); - minlen = 1; - } } Version GetVersion() CXX11_OVERRIDE diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 65671632d..2352fa217 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -206,7 +206,7 @@ class ModuleCgiIRC : public Module RecheckClass(user); // Don't create the resolver if the core couldn't put the user in a connect class or when dns is disabled - if (user->quitting || !DNS || user->MyClass->nouserdns) + if (user->quitting || !DNS || !user->MyClass->resolvehostnames) return; CGIResolver* r = new CGIResolver(*this->DNS, this, cmd.notify, newip, user, (was_pass ? "PASS" : "IDENT"), waiting); diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index c730602a1..36e10ec5b 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -43,18 +43,9 @@ class ModuleConnectBan : public Module { ConfigTag* tag = ServerInstance->Config->ConfValue("connectban"); - ipv4_cidr = tag->getInt("ipv4cidr", 32); - if (ipv4_cidr == 0) - ipv4_cidr = 32; - - ipv6_cidr = tag->getInt("ipv6cidr", 128); - if (ipv6_cidr == 0) - ipv6_cidr = 128; - - threshold = tag->getInt("threshold", 10); - if (threshold == 0) - threshold = 10; - + ipv4_cidr = tag->getInt("ipv4cidr", 32, 1, 32); + ipv6_cidr = tag->getInt("ipv6cidr", 128, 1, 128); + threshold = tag->getInt("threshold", 10, 1); banduration = InspIRCd::Duration(tag->getString("duration", "10m")); if (banduration == 0) banduration = 10*60; diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp index 10347ac67..99e525398 100644 --- a/src/modules/m_nationalchars.cpp +++ b/src/modules/m_nationalchars.cpp @@ -298,7 +298,7 @@ class ModuleNationalChars : public Module /*so Bynets Unreal distribution stuff*/ void loadtables(std::string filename, unsigned char ** tables, unsigned char cnt, char faillimit) { - std::ifstream ifs(filename.c_str()); + std::ifstream ifs(ServerInstance->Config->Paths.PrependConfig(filename).c_str()); if (ifs.fail()) { ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "loadtables() called for missing file: %s", filename.c_str()); diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp index df6f4c10c..63eb6d3ee 100644 --- a/src/modules/m_xline_db.cpp +++ b/src/modules/m_xline_db.cpp @@ -36,7 +36,7 @@ class ModuleXLineDB : public Module * ...and so is discarding all current in-memory XLines for the ones in the database. */ ConfigTag* Conf = ServerInstance->Config->ConfValue("xlinedb"); - xlinedbpath = Conf->getString("filename", DATA_PATH "/xline.db"); + xlinedbpath = ServerInstance->Config->Paths.PrependData(Conf->getString("filename", "xline.db")); // Read xlines before attaching to events ReadDatabase(); |