]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Set the minimum length to 1 for most config items with a default.
authorSadie Powell <sadie@witchery.services>
Thu, 9 Apr 2020 14:18:04 +0000 (15:18 +0100)
committerSadie Powell <sadie@witchery.services>
Thu, 9 Apr 2020 14:18:04 +0000 (15:18 +0100)
26 files changed:
src/configreader.cpp
src/coremods/core_channel/core_channel.cpp
src/coremods/core_info/cmd_motd.cpp
src/coremods/core_stats.cpp
src/coremods/core_whois.cpp
src/listensocket.cpp
src/modules/extra/m_geo_maxmind.cpp
src/modules/extra/m_regex_stdlib.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_mbedtls.cpp
src/modules/extra/m_ssl_openssl.cpp
src/modules/m_anticaps.cpp
src/modules/m_blockcaps.cpp
src/modules/m_chghost.cpp
src/modules/m_customtitle.cpp
src/modules/m_filter.cpp
src/modules/m_flashpolicyd.cpp
src/modules/m_hostchange.cpp
src/modules/m_nationalchars.cpp
src/modules/m_opermotd.cpp
src/modules/m_passforward.cpp
src/modules/m_randquote.cpp
src/modules/m_sethost.cpp
src/modules/m_sqloper.cpp
src/modules/m_xline_db.cpp
src/users.cpp

index a43a9d78cd2f8a4e8c7ede9a13ac208d873dcb9d..b83de6f1cf3f36f0a66218ae151e1b1da39576ab 100644 (file)
@@ -53,10 +53,10 @@ ServerLimits::ServerLimits(ConfigTag* tag)
 }
 
 ServerConfig::ServerPaths::ServerPaths(ConfigTag* tag)
-       : Config(tag->getString("configdir", INSPIRCD_CONFIG_PATH))
-       , Data(tag->getString("datadir", INSPIRCD_DATA_PATH))
-       , Log(tag->getString("logdir", INSPIRCD_LOG_PATH))
-       , Module(tag->getString("moduledir", INSPIRCD_MODULE_PATH))
+       : Config(tag->getString("configdir", INSPIRCD_CONFIG_PATH, 1))
+       , Data(tag->getString("datadir", INSPIRCD_DATA_PATH, 1))
+       , Log(tag->getString("logdir", INSPIRCD_LOG_PATH, 1))
+       , Module(tag->getString("moduledir", INSPIRCD_MODULE_PATH, 1))
 {
 }
 
@@ -365,7 +365,7 @@ void ServerConfig::Fill()
                if (!sid.empty() && !InspIRCd::IsSID(sid))
                        throw CoreException(sid + " is not a valid server ID. A server ID must be 3 characters long, with the first character a digit and the next two characters a digit or letter.");
 
-               CaseMapping = options->getString("casemapping", "rfc1459");
+               CaseMapping = options->getString("casemapping", "rfc1459", 1);
                if (CaseMapping == "ascii")
                        national_case_insensitive_map = ascii_case_insensitive_map;
                else if (CaseMapping == "rfc1459")
@@ -394,8 +394,8 @@ void ServerConfig::Fill()
        MaxConn = ConfValue("performance")->getUInt("somaxconn", SOMAXCONN);
        TimeSkipWarn = ConfValue("performance")->getDuration("timeskipwarn", 2, 0, 30);
        XLineMessage = options->getString("xlinemessage", options->getString("moronbanner", "You're banned!"));
-       ServerDesc = server->getString("description", "Configure Me");
-       Network = server->getString("network", "Network");
+       ServerDesc = server->getString("description", "Configure Me", 1);
+       Network = server->getString("network", "Network", 1);
        NetBufferSize = ConfValue("performance")->getInt("netbuffersize", 10240, 1024, 65534);
        CustomVersion = security->getString("customversion");
        HideBans = security->getBool("hidebans");
@@ -437,7 +437,7 @@ void ServerConfig::Fill()
        ReadXLine(this, "badhost", "host", ServerInstance->XLines->GetFactory("K"));
        ReadXLine(this, "exception", "host", ServerInstance->XLines->GetFactory("E"));
 
-       const std::string restrictbannedusers = options->getString("restrictbannedusers", "yes");
+       const std::string restrictbannedusers = options->getString("restrictbannedusers", "yes", 1);
        if (stdalgo::string::equalsci(restrictbannedusers, "no"))
                RestrictBannedUsers = ServerConfig::BUT_NORMAL;
        else if (stdalgo::string::equalsci(restrictbannedusers, "silent"))
index 58e8afc03c9bafc1f91dcb0f7f6f0bb51c1b0b08..dc9019e04d0bb991f4f0019f0affb65d6a75f6bb 100644 (file)
@@ -170,7 +170,7 @@ class CoreModChannel : public Module, public CheckExemption::EventListener
                }
 
                ConfigTag* securitytag = ServerInstance->Config->ConfValue("security");
-               const std::string announceinvites = securitytag->getString("announceinvites", "dynamic");
+               const std::string announceinvites = securitytag->getString("announceinvites", "dynamic", 1);
                Invite::AnnounceState newannouncestate;
                if (stdalgo::string::equalsci(announceinvites, "none"))
                        newannouncestate = Invite::ANNOUNCE_NONE;
index f0b9fee953a942199c98842d1e9676c66b8d5fc5..69caf7de1136f0e29836e67c43e4198a777fa360 100644 (file)
@@ -48,7 +48,8 @@ CmdResult CommandMotd::Handle(User* user, const Params& parameters)
        LocalUser* localuser = IS_LOCAL(user);
        if (localuser)
                tag = localuser->GetClass()->config;
-       std::string motd_name = tag->getString("motd", "motd");
+
+       const std::string motd_name = tag->getString("motd", "motd", 1);
        ConfigFileCache::iterator motd = motds.find(motd_name);
        if (motd == motds.end())
        {
index 4b30fa5b4ac7a82d046712c03f0429cdfd436b8d..951a702b754b41849e10c1f24761656c462fe9ca 100644 (file)
@@ -117,8 +117,8 @@ void CommandStats::DoStats(Stats::Context& stats)
                        for (std::vector<ListenSocket*>::const_iterator i = ServerInstance->ports.begin(); i != ServerInstance->ports.end(); ++i)
                        {
                                ListenSocket* ls = *i;
-                               std::string type = ls->bind_tag->getString("type", "clients");
-                               std::string hook = ls->bind_tag->getString("ssl", "plaintext");
+                               const std::string type = ls->bind_tag->getString("type", "clients", 1);
+                               const std::string hook = ls->bind_tag->getString("ssl", "plaintext", 1);
 
                                stats.AddRow(249, ls->bind_sa.str() + " (" + type + ", " + hook + ")");
                        }
@@ -149,7 +149,7 @@ void CommandStats::DoStats(Stats::Context& stats)
                                else
                                        param.append(c->host);
 
-                               row.push(param).push(c->config->getString("port", "*"));
+                               row.push(param).push(c->config->getString("port", "*", 1));
                                row.push(ConvToStr(c->GetRecvqMax())).push(ConvToStr(c->GetSendqSoftMax())).push(ConvToStr(c->GetSendqHardMax())).push(ConvToStr(c->GetCommandRate()));
 
                                param = ConvToStr(c->GetPenaltyThreshold());
index 10fbd54188e49f67a2b93b55d40d900a713a678d..8ac86337e27bee694a4f21744841a2c16368e5bf 100644 (file)
@@ -364,7 +364,7 @@ class CoreModWhois : public Module
        void ReadConfig(ConfigStatus&) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("options");
-               const std::string splitwhois = tag->getString("splitwhois", "no");
+               const std::string splitwhois = tag->getString("splitwhois", "no", 1);
                SplitWhoisState newsplitstate;
                if (stdalgo::string::equalsci(splitwhois, "no"))
                        newsplitstate = SPLITWHOIS_NONE;
index d7217650e4ffba86e1cedb8a1805c7bcbe422e55..7e73c192650ef4fab930807bbacfb52a55001a5e 100644 (file)
@@ -207,7 +207,7 @@ void ListenSocket::OnEventHandlerRead()
        FIRST_MOD_RESULT(OnAcceptConnection, res, (incomingSockfd, this, &client, &server));
        if (res == MOD_RES_PASSTHRU)
        {
-               std::string type = bind_tag->getString("type", "clients");
+               const std::string type = bind_tag->getString("type", "clients", 1);
                if (stdalgo::string::equalsci(type, "clients"))
                {
                        ServerInstance->Users->AddUser(incomingSockfd, this, &client, &server);
index 0cf082775b911a7283bd5fee4a6c86e622540946..984a2c6cb32c6e8aee75caa21a970fca4d5f3da2 100644 (file)
@@ -160,7 +160,7 @@ class ModuleGeoMaxMind : public Module
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("maxmind");
-               const std::string file = ServerInstance->Config->Paths.PrependConfig(tag->getString("file", "GeoLite2-Country.mmdb"));
+               const std::string file = ServerInstance->Config->Paths.PrependConfig(tag->getString("file", "GeoLite2-Country.mmdb", 1));
 
                // Try to read the new database.
                MMDB_s mmdb;
index 418237dd1aa901c229c91143d7d851e18bef023a..80cf299f1cdb576b5e0d0cf61978b11956f30220 100644 (file)
@@ -75,8 +75,8 @@ public:
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* Conf = ServerInstance->Config->ConfValue("stdregex");
-               std::string regextype = Conf->getString("type", "ecmascript");
 
+               const std::string regextype = Conf->getString("type", "ecmascript", 1);
                if (stdalgo::string::equalsci(regextype, "bre"))
                        ref.regextype = std::regex::basic;
                else if (stdalgo::string::equalsci(regextype, "ere"))
index bc8b0b4723f48f6537b49a7415a2909aa8616b23..1953851e3247767d085bf92d3a36ad98e0a6fac6 100644 (file)
@@ -664,12 +664,12 @@ namespace GnuTLS
 
                        Config(const std::string& profilename, ConfigTag* tag)
                                : name(profilename)
-                               , certstr(ReadFile(tag->getString("certfile", "cert.pem")))
-                               , keystr(ReadFile(tag->getString("keyfile", "key.pem")))
-                               , dh(DHParams::Import(ReadFile(tag->getString("dhfile", "dhparams.pem"))))
+                               , certstr(ReadFile(tag->getString("certfile", "cert.pem", 1)))
+                               , keystr(ReadFile(tag->getString("keyfile", "key.pem", 1)))
+                               , dh(DHParams::Import(ReadFile(tag->getString("dhfile", "dhparams.pem", 1))))
                                , priostr(GetPrioStr(profilename, tag))
                                , mindh(tag->getUInt("mindhbits", 1024))
-                               , hashstr(tag->getString("hash", "md5"))
+                               , hashstr(tag->getString("hash", "md5", 1))
                                , requestclientcert(tag->getBool("requestclientcert", true))
                        {
                                // Load trusted CA and revocation list, if set
index a1e0c9f289279723e1b83c732a6e5e67f193dd3c..d330afe51a45e9087ca497b08a7ed9192bd201ab 100644 (file)
@@ -419,13 +419,13 @@ namespace mbedTLS
                        Config(const std::string& profilename, ConfigTag* tag, CTRDRBG& ctr_drbg)
                                : name(profilename)
                                , ctrdrbg(ctr_drbg)
-                               , certstr(ReadFile(tag->getString("certfile", "cert.pem")))
-                               , keystr(ReadFile(tag->getString("keyfile", "key.pem")))
-                               , dhstr(ReadFile(tag->getString("dhfile", "dhparams.pem")))
+                               , certstr(ReadFile(tag->getString("certfile", "cert.pem", 1)))
+                               , keystr(ReadFile(tag->getString("keyfile", "key.pem", 1)))
+                               , dhstr(ReadFile(tag->getString("dhfile", "dhparams.pem", 1)))
                                , ciphersuitestr(tag->getString("ciphersuites"))
                                , curvestr(tag->getString("curves"))
                                , mindh(tag->getUInt("mindhbits", 2048))
-                               , hashstr(tag->getString("hash", "sha256"))
+                               , hashstr(tag->getString("hash", "sha256", 1))
                                , castr(tag->getString("cafile"))
                                , minver(tag->getUInt("minver", 0))
                                , maxver(tag->getUInt("maxver", 0))
index c27626639932d2efd5ccc65c014e0a9cffbc5d2b..9a5fa98af96458f0b2344a40aa04243b1fc31ecc 100644 (file)
@@ -386,7 +386,7 @@ namespace OpenSSL
         public:
                Profile(const std::string& profilename, ConfigTag* tag)
                        : name(profilename)
-                       , dh(ServerInstance->Config->Paths.PrependConfig(tag->getString("dhfile", "dhparams.pem")))
+                       , dh(ServerInstance->Config->Paths.PrependConfig(tag->getString("dhfile", "dhparams.pem", 1)))
                        , ctx(SSL_CTX_new(SSLv23_server_method()))
                        , clictx(SSL_CTX_new(SSLv23_client_method()))
                        , allowrenego(tag->getBool("renegotiation")) // Disallow by default
@@ -395,7 +395,7 @@ namespace OpenSSL
                        if ((!ctx.SetDH(dh)) || (!clictx.SetDH(dh)))
                                throw Exception("Couldn't set DH parameters");
 
-                       std::string hash = tag->getString("hash", "md5");
+                       const std::string hash = tag->getString("hash", "md5", 1);
                        digest = EVP_get_digestbyname(hash.c_str());
                        if (digest == NULL)
                                throw Exception("Unknown hash type " + hash);
@@ -411,7 +411,7 @@ namespace OpenSSL
                        }
 
 #ifndef OPENSSL_NO_ECDH
-                       std::string curvename = tag->getString("ecdhcurve", "prime256v1");
+                       const std::string curvename = tag->getString("ecdhcurve", "prime256v1", 1);
                        if (!curvename.empty())
                                ctx.SetECDH(curvename);
 #endif
@@ -422,14 +422,14 @@ namespace OpenSSL
                        /* Load our keys and certificates
                         * NOTE: OpenSSL's error logging API sucks, don't blame us for this clusterfuck.
                         */
-                       std::string filename = ServerInstance->Config->Paths.PrependConfig(tag->getString("certfile", "cert.pem"));
+                       std::string filename = ServerInstance->Config->Paths.PrependConfig(tag->getString("certfile", "cert.pem", 1));
                        if ((!ctx.SetCerts(filename)) || (!clictx.SetCerts(filename)))
                        {
                                ERR_print_errors_cb(error_callback, this);
                                throw Exception("Can't read certificate file: " + lasterr);
                        }
 
-                       filename = ServerInstance->Config->Paths.PrependConfig(tag->getString("keyfile", "key.pem"));
+                       filename = ServerInstance->Config->Paths.PrependConfig(tag->getString("keyfile", "key.pem", 1));
                        if ((!ctx.SetPrivateKey(filename)) || (!clictx.SetPrivateKey(filename)))
                        {
                                ERR_print_errors_cb(error_callback, this);
@@ -437,7 +437,7 @@ namespace OpenSSL
                        }
 
                        // Load the CAs we trust
-                       filename = ServerInstance->Config->Paths.PrependConfig(tag->getString("cafile", "ca.pem"));
+                       filename = ServerInstance->Config->Paths.PrependConfig(tag->getString("cafile", "ca.pem", 1));
                        if ((!ctx.SetCA(filename)) || (!clictx.SetCA(filename)))
                        {
                                ERR_print_errors_cb(error_callback, this);
@@ -445,9 +445,9 @@ namespace OpenSSL
                        }
 
                        // Load the CRLs.
-                       std::string crlfile  = tag->getString("crlfile");
-                       std::string crlpath  = tag->getString("crlpath");
-                       std::string crlmode  = tag->getString("crlmode", "chain");
+                       const std::string crlfile = tag->getString("crlfile");
+                       const std::string crlpath = tag->getString("crlpath");
+                       const std::string crlmode = tag->getString("crlmode", "chain", 1);
                        ctx.SetCRL(crlfile, crlpath, crlmode);
 
                        clictx.SetVerifyCert();
index 83fa0ecaa984070751ed2442e7186cf02f2877eb..da023521e7408f62f320e36fffef913eb8982462 100644 (file)
@@ -190,7 +190,7 @@ class ModuleAntiCaps : public Module
                ConfigTag* tag = ServerInstance->Config->ConfValue("anticaps");
 
                uppercase.reset();
-               const std::string upper = tag->getString("uppercase", "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+               const std::string upper = tag->getString("uppercase", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1);
                for (std::string::const_iterator iter = upper.begin(); iter != upper.end(); ++iter)
                        uppercase.set(static_cast<unsigned char>(*iter));
 
index f66a6a76352ff7b51372c426d4becf7982ab0d9c..26c11e0825c9c1f17b1d6a94807e091f3e8b6f6a 100644 (file)
@@ -118,7 +118,7 @@ public:
                        lowercase.set(static_cast<unsigned char>(*iter));
 
                uppercase.reset();
-               const std::string upper = tag->getString("uppercase", tag->getString("capsmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
+               const std::string upper = tag->getString("uppercase", tag->getString("capsmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1));
                for (std::string::const_iterator iter = upper.begin(); iter != upper.end(); ++iter)
                        uppercase.set(static_cast<unsigned char>(*iter));
        }
index 1a73af209215f4fba2bb0365d8ed857f915ba009..d16733033de0fb6292da9b2e1400cb2e221ddc2e 100644 (file)
@@ -98,10 +98,11 @@ class ModuleChgHost : public Module
 
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
-               std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789");
+               ConfigTag* tag = ServerInstance->Config->ConfValue("hostname");
+               const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1);
 
                cmd.hostmap.reset();
-               for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++)
+               for (std::string::const_iterator n = hmap.begin(); n != hmap.end(); n++)
                        cmd.hostmap.set(static_cast<unsigned char>(*n));
        }
 
index 7cdd0bc4fd3f42543755fd3f5852aee6d10645f9..3bf7e7925d95361315e7c7765decf767615f0979 100644 (file)
@@ -143,7 +143,7 @@ class ModuleCustomTitle : public Module, public Whois::LineEventListener
                                        name.c_str(), tag->getTagLocation().c_str());
                        }
 
-                       std::string host = tag->getString("host", "*@*");
+                       std::string host = tag->getString("host", "*@*", 1);
                        std::string title = tag->getString("title");
                        std::string vhost = tag->getString("vhost");
                        CustomTitle config(name, pass, hash, host, title, vhost);
index 3e76525099132172adf8c65922a985a35cd1dc27..9325c243d89a5756bf274e0194a121cb942ded48 100644 (file)
@@ -624,7 +624,7 @@ void ModuleFilter::ReadConfig(ConfigStatus& status)
                ConfigTag* tag = i->second;
 
                // If "target" is not found, try the old "channel" key to keep compatibility with 2.0 configs
-               const std::string target = tag->getString("target", tag->getString("channel"));
+               const std::string target = tag->getString("target", tag->getString("channel"), 1);
                if (!target.empty())
                {
                        if (target[0] == '#')
index 82ea97a5bf5e49e8a7a2c638aa5713027ac56caf..c8fb71e83e19abff90be8541cca55ddfc76be435 100644 (file)
@@ -124,7 +124,10 @@ class ModuleFlashPD : public Module
                for (std::vector<ListenSocket*>::const_iterator i = ServerInstance->ports.begin(); i != ServerInstance->ports.end(); ++i)
                {
                                ListenSocket* ls = *i;
-                               if (!stdalgo::string::equalsci(ls->bind_tag->getString("type", "clients"), "clients") || !ls->bind_tag->getString("ssl").empty())
+                               if (!stdalgo::string::equalsci(ls->bind_tag->getString("type", "clients", 1), "clients"))
+                                       continue;
+
+                               if (!ls->bind_tag->getString("ssl").empty())
                                        continue;
 
                                to_ports.append(ConvToStr(ls->bind_sa.port())).push_back(',');
index 3529b6a4a90c55cc7b05c70753c478ac3fec41b4..78ef68759737f999c642fcc5accd17a8ba1ba7cb 100644 (file)
@@ -176,7 +176,9 @@ private:
                        }
                }
 
-               const std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789");
+               ConfigTag* tag = ServerInstance->Config->ConfValue("hostname");
+               const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1);
+
                hostmap.reset();
                for (std::string::const_iterator iter = hmap.begin(); iter != hmap.end(); ++iter)
                        hostmap.set(static_cast<unsigned char>(*iter));
index 9a875fca2295f3b76143af73a82652d11cea4d32..d86122c59e68499861fcc2df4de8cc252a5cf3a3 100644 (file)
@@ -274,7 +274,7 @@ class ModuleNationalChars : public Module
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("nationalchars");
                charset = tag->getString("file");
-               std::string casemapping = tag->getString("casemapping", FileSystem::GetFileName(charset));
+               std::string casemapping = tag->getString("casemapping", FileSystem::GetFileName(charset), 1);
                if (casemapping.find(' ') != std::string::npos)
                        throw ModuleException("<nationalchars:casemapping> must not contain any spaces!");
                ServerInstance->Config->CaseMapping = casemapping;
index 36998a4b39fa48605db2227fc1b183d97bd139d0..585b651b6c4bd3e2dc64264d938e43efedffaed4 100644 (file)
@@ -114,7 +114,7 @@ class ModuleOpermotd : public Module
 
                try
                {
-                       FileReader reader(conf->getString("file", "opermotd"));
+                       FileReader reader(conf->getString("file", "opermotd", 1));
                        cmd.opermotd = reader.GetVector();
                        InspIRCd::ProcessColors(cmd.opermotd);
                }
index 40d04de675fb3a44a25e9c411702f7ea292fd402..abbd9893d3f4dba0efe5210a3ebe862a4a25ef31 100644 (file)
@@ -41,7 +41,7 @@ class ModulePassForward : public Module
                ConfigTag* tag = ServerInstance->Config->ConfValue("passforward");
                nickrequired = tag->getString("nick", "NickServ");
                forwardmsg = tag->getString("forwardmsg", "NOTICE $nick :*** Forwarding PASS to $nickrequired");
-               forwardcmd = tag->getString("cmd", "SQUERY $nickrequired :IDENTIFY $pass");
+               forwardcmd = tag->getString("cmd", "SQUERY $nickrequired :IDENTIFY $pass", 1);
        }
 
        void FormatStr(std::string& result, const std::string& format, const LocalUser* user)
index fada120adcc8febb4ec3f0d0b66fc930f50668d8..184b06f8bce04d0a7d62c4dff8978e496a72794f 100644 (file)
@@ -37,7 +37,7 @@ class ModuleRandQuote : public Module
                ConfigTag* conf = ServerInstance->Config->ConfValue("randquote");
                prefix = conf->getString("prefix");
                suffix = conf->getString("suffix");
-               FileReader reader(conf->getString("file", "quotes"));
+               FileReader reader(conf->getString("file", "quotes", 1));
                quotes = reader.GetVector();
        }
 
index 2bacded6f460a850abad137e0956226c8fcd4030..022434ec95fb8bb755924b80a4c68354fc6491dd 100644 (file)
@@ -80,10 +80,11 @@ class ModuleSetHost : public Module
 
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
-               std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789");
+               ConfigTag* tag = ServerInstance->Config->ConfValue("hostname");
+               const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1);
 
                cmd.hostmap.reset();
-               for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++)
+               for (std::string::const_iterator n = hmap.begin(); n != hmap.end(); n++)
                        cmd.hostmap.set(static_cast<unsigned char>(*n));
        }
 
index df8f292c1a4319021d65f0356de26d00f43ba6e4..21590ede60657dc9d9edb881ede34f08fa36bdd5 100644 (file)
@@ -190,7 +190,7 @@ public:
                else
                        SQL.SetProvider("SQL/" + dbid);
 
-               query = tag->getString("query", "SELECT * FROM ircd_opers WHERE active=1;");
+               query = tag->getString("query", "SELECT * FROM ircd_opers WHERE active=1;", 1);
                // Update sqloper list from the database.
                GetOperBlocks();
        }
index 2b0b333d7d66dc92157bc42f3b9db780c9b11b2b..21c83549fc2cd41b32811e6314acbedc4af5f7c6 100644 (file)
@@ -53,7 +53,7 @@ class ModuleXLineDB
                 *              ...and so is discarding all current in-memory XLines for the ones in the database.
                 */
                ConfigTag* Conf = ServerInstance->Config->ConfValue("xlinedb");
-               xlinedbpath = ServerInstance->Config->Paths.PrependData(Conf->getString("filename", "xline.db"));
+               xlinedbpath = ServerInstance->Config->Paths.PrependData(Conf->getString("filename", "xline.db", 1));
                SetInterval(Conf->getDuration("saveperiod", 5));
 
                // Read xlines before attaching to events
index 0f1ee74660968c2abb73dae51619dc9eb3d34c4b..72a6c23af9e0bcd49a0e4a0530fb73b760a27ea7 100644 (file)
@@ -508,7 +508,7 @@ void LocalUser::CheckClass(bool clone_count)
        }
        else if (a->type == CC_DENY)
        {
-               ServerInstance->Users->QuitUser(this, a->config->getString("reason", "Unauthorised connection"));
+               ServerInstance->Users->QuitUser(this, a->config->getString("reason", "Unauthorised connection", 1));
                return;
        }
        else if (clone_count)