2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions>
5 * Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com>
6 * Copyright (C) 2013-2014, 2016-2021 Sadie Powell <sadie@witchery.services>
7 * Copyright (C) 2013 Daniel Vassdal <shutter@canternet.org>
8 * Copyright (C) 2012 Robby <robby@chatbelgie.be>
9 * Copyright (C) 2012 Justin Crawford <Justasic@Gmail.com>
10 * Copyright (C) 2012 DjSlash <djslash@djslash.org>
11 * Copyright (C) 2012 ChrisTX <xpipe@hotmail.de>
12 * Copyright (C) 2009-2011 Daniel De Graaf <danieldg@inspircd.org>
13 * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
14 * Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
15 * Copyright (C) 2007-2010 Robin Burchell <robin+git@viroteck.net>
16 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
17 * Copyright (C) 2006-2008 Craig Edwards <brain@inspircd.org>
18 * Copyright (C) 2006 Oliver Lupton <om@inspircd.org>
20 * This file is part of InspIRCd. InspIRCd is free software: you can
21 * redistribute it and/or modify it under the terms of the GNU General Public
22 * License as published by the Free Software Foundation, version 2.
24 * This program is distributed in the hope that it will be useful, but WITHOUT
25 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
29 * You should have received a copy of the GNU General Public License
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
37 #include "exitcodes.h"
38 #include "configparser.h"
41 ServerLimits::ServerLimits(ConfigTag* tag)
42 : MaxLine(tag->getUInt("maxline", 512, 512))
43 , NickMax(tag->getUInt("maxnick", 30, 1, MaxLine))
44 , ChanMax(tag->getUInt("maxchan", 64, 1, MaxLine))
45 , MaxModes(tag->getUInt("maxmodes", 20, 1))
46 , IdentMax(tag->getUInt("maxident", 10, 1))
47 , MaxQuit(tag->getUInt("maxquit", 255, 0, MaxLine))
48 , MaxTopic(tag->getUInt("maxtopic", 307, 1, MaxLine))
49 , MaxKick(tag->getUInt("maxkick", 255, 1, MaxLine))
50 , MaxReal(tag->getUInt("maxreal", tag->getUInt("maxgecos", 128), 1, MaxLine))
51 , MaxAway(tag->getUInt("maxaway", 200, 1, MaxLine))
52 , MaxHost(tag->getUInt("maxhost", 64, 1, MaxLine))
56 ServerConfig::ServerPaths::ServerPaths(ConfigTag* tag)
57 : Config(tag->getString("configdir", INSPIRCD_CONFIG_PATH, 1))
58 , Data(tag->getString("datadir", INSPIRCD_DATA_PATH, 1))
59 , Log(tag->getString("logdir", INSPIRCD_LOG_PATH, 1))
60 , Module(tag->getString("moduledir", INSPIRCD_MODULE_PATH, 1))
61 , Runtime(tag->getString("runtimedir", INSPIRCD_RUNTIME_PATH, 1))
65 static ConfigTag* CreateEmptyTag()
68 return ConfigTag::create("empty", "<auto>", 0, items);
71 ServerConfig::ServerConfig()
72 : EmptyTag(CreateEmptyTag())
76 , NoSnoticeStack(false)
80 ServerConfig::~ServerConfig()
85 static void ReadXLine(ServerConfig* conf, const std::string& tag, const std::string& key, XLineFactory* make)
87 insp::flat_set<std::string> configlines;
89 ConfigTagList tags = conf->ConfTags(tag);
90 for(ConfigIter i = tags.first; i != tags.second; ++i)
92 ConfigTag* ctag = i->second;
94 const std::string mask = ctag->getString(key);
96 throw CoreException("<" + tag + ":" + key + "> missing at " + ctag->getTagLocation());
98 const std::string reason = ctag->getString("reason");
100 throw CoreException("<" + tag + ":reason> missing at " + ctag->getTagLocation());
102 XLine* xl = make->Generate(ServerInstance->Time(), 0, ServerInstance->Config->ServerName, reason, mask);
103 xl->from_config = true;
104 configlines.insert(xl->Displayable());
105 if (!ServerInstance->XLines->AddLine(xl, NULL))
109 ServerInstance->XLines->ExpireRemovedConfigLines(make->GetType(), configlines);
112 typedef std::map<std::string, ConfigTag*> LocalIndex;
113 void ServerConfig::CrossCheckOperClassType()
115 LocalIndex operclass;
116 ConfigTagList tags = ConfTags("class");
117 for(ConfigIter i = tags.first; i != tags.second; ++i)
119 ConfigTag* tag = i->second;
120 std::string name = tag->getString("name");
122 throw CoreException("<class:name> missing from tag at " + tag->getTagLocation());
123 if (operclass.find(name) != operclass.end())
124 throw CoreException("Duplicate class block with name " + name + " at " + tag->getTagLocation());
125 operclass[name] = tag;
127 tags = ConfTags("type");
128 for(ConfigIter i = tags.first; i != tags.second; ++i)
130 ConfigTag* tag = i->second;
131 std::string name = tag->getString("name");
133 throw CoreException("<type:name> is missing from tag at " + tag->getTagLocation());
134 if (OperTypes.find(name) != OperTypes.end())
135 throw CoreException("Duplicate type block with name " + name + " at " + tag->getTagLocation());
137 OperInfo* ifo = new OperInfo(name);
138 OperTypes[name] = ifo;
139 ifo->type_block = tag;
141 std::string classname;
142 irc::spacesepstream str(tag->getString("classes"));
143 while (str.GetToken(classname))
145 LocalIndex::iterator cls = operclass.find(classname);
146 if (cls == operclass.end())
147 throw CoreException("Oper type " + name + " has missing class " + classname);
148 ifo->class_blocks.push_back(cls->second);
152 tags = ConfTags("oper");
153 for(ConfigIter i = tags.first; i != tags.second; ++i)
155 ConfigTag* tag = i->second;
157 std::string name = tag->getString("name");
159 throw CoreException("<oper:name> missing from tag at " + tag->getTagLocation());
161 std::string type = tag->getString("type");
162 OperIndex::iterator tblk = OperTypes.find(type);
163 if (tblk == OperTypes.end())
164 throw CoreException("Oper block " + name + " has missing type " + type);
165 if (oper_blocks.find(name) != oper_blocks.end())
166 throw CoreException("Duplicate oper block with name " + name + " at " + tag->getTagLocation());
168 OperInfo* ifo = new OperInfo(type);
169 ifo->oper_block = tag;
170 ifo->type_block = tblk->second->type_block;
171 ifo->class_blocks.assign(tblk->second->class_blocks.begin(), tblk->second->class_blocks.end());
172 oper_blocks[name] = ifo;
176 void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
178 typedef std::map<std::pair<std::string, char>, ConnectClass*> ClassMap;
179 ClassMap oldBlocksByMask;
182 for(ClassVector::iterator i = current->Classes.begin(); i != current->Classes.end(); ++i)
184 ConnectClass* c = *i;
189 oldBlocksByMask[std::make_pair(c->host, c->type)] = c;
193 oldBlocksByMask[std::make_pair(c->name, c->type)] = c;
199 size_t blk_count = config_data.count("connect");
202 // No connect blocks found; make a trivial default block
204 ConfigTag* tag = ConfigTag::create("connect", "<auto>", 0, items);
205 (*items)["allow"] = "*";
206 config_data.insert(std::make_pair("connect", tag));
210 Classes.resize(blk_count);
211 std::map<std::string, size_t> names;
213 bool try_again = true;
214 for(size_t tries = 0; try_again; tries++)
217 ConfigTagList tags = ConfTags("connect");
219 for(ConfigIter it = tags.first; it != tags.second; ++it, ++i)
221 ConfigTag* tag = it->second;
225 ConnectClass* parent = NULL;
226 std::string parentName = tag->getString("parent");
227 if (!parentName.empty())
229 std::map<std::string, size_t>::const_iterator parentIter = names.find(parentName);
230 if (parentIter == names.end())
233 // couldn't find parent this time. If it's the last time, we'll never find it.
234 if (tries >= blk_count)
235 throw CoreException("Could not find parent connect class \"" + parentName + "\" for connect block at " + tag->getTagLocation());
238 parent = Classes[parentIter->second];
241 std::string name = tag->getString("name");
245 if (tag->readString("allow", mask, false) && !mask.empty())
247 else if (tag->readString("deny", mask, false) && !mask.empty())
249 else if (!name.empty())
256 throw CoreException("Connect class must have allow, deny, or name specified at " + tag->getTagLocation());
260 name = "unnamed-" + ConvToStr(i);
262 if (names.find(name) != names.end())
263 throw CoreException("Two connect classes with name \"" + name + "\" defined!");
266 ConnectClass* me = parent ?
267 new ConnectClass(tag, type, mask, *parent) :
268 new ConnectClass(tag, type, mask);
272 me->registration_timeout = tag->getDuration("timeout", me->registration_timeout);
273 me->pingtime = tag->getDuration("pingfreq", me->pingtime);
275 if (tag->readString("sendq", sendq))
277 // attempt to guess a good hard/soft sendq from a single value
278 unsigned long value = strtoul(sendq.c_str(), NULL, 10);
280 me->softsendqmax = value / 16;
282 me->softsendqmax = value;
283 me->hardsendqmax = value * 8;
285 me->softsendqmax = tag->getUInt("softsendq", me->softsendqmax);
286 me->hardsendqmax = tag->getUInt("hardsendq", me->hardsendqmax);
287 me->recvqmax = tag->getUInt("recvq", me->recvqmax);
288 me->penaltythreshold = tag->getUInt("threshold", me->penaltythreshold);
289 me->commandrate = tag->getUInt("commandrate", me->commandrate);
290 me->fakelag = tag->getBool("fakelag", me->fakelag);
291 me->maxlocal = tag->getUInt("localmax", me->maxlocal);
292 me->maxglobal = tag->getUInt("globalmax", me->maxglobal);
293 me->maxchans = tag->getUInt("maxchans", me->maxchans);
294 me->maxconnwarn = tag->getBool("maxconnwarn", me->maxconnwarn);
295 me->limit = tag->getUInt("limit", me->limit);
296 me->resolvehostnames = tag->getBool("resolvehostnames", me->resolvehostnames);
297 me->password = tag->getString("password", me->password);
299 me->passwordhash = tag->getString("hash", me->passwordhash);
300 if (!me->password.empty() && (me->passwordhash.empty() || stdalgo::string::equalsci(me->passwordhash, "plaintext")))
302 ServerInstance->Logs->Log("CONNECTCLASS", LOG_DEFAULT, "<connect> tag '%s' at %s contains an plain text password, this is insecure!",
303 name.c_str(), tag->getTagLocation().c_str());
306 std::string ports = tag->getString("port");
309 irc::portparser portrange(ports, false);
310 while (int port = portrange.GetToken())
311 me->ports.insert(port);
314 ClassMap::iterator oldMask = oldBlocksByMask.find(std::make_pair(me->name, me->type));
315 if (oldMask != oldBlocksByMask.end())
317 ConnectClass* old = oldMask->second;
318 oldBlocksByMask.erase(oldMask);
328 static std::string GetServerHost()
332 if (gethostname(hostname, sizeof(hostname)) == 0)
334 std::string name(hostname);
335 if (name.find('.') == std::string::npos)
338 if (name.length() <= ServerInstance->Config->Limits.MaxHost && InspIRCd::IsHost(name))
342 return "irc.example.com";
345 void ServerConfig::Fill()
347 ConfigTag* options = ConfValue("options");
348 ConfigTag* security = ConfValue("security");
349 ConfigTag* server = ConfValue("server");
352 ServerName = server->getString("name", GetServerHost(), InspIRCd::IsHost);
354 sid = server->getString("id");
355 if (!sid.empty() && !InspIRCd::IsSID(sid))
356 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.");
358 CaseMapping = options->getString("casemapping", "rfc1459", 1);
359 if (CaseMapping == "ascii")
360 national_case_insensitive_map = ascii_case_insensitive_map;
361 else if (CaseMapping == "rfc1459")
362 national_case_insensitive_map = rfc_case_insensitive_map;
364 throw CoreException("<options:casemapping> must be set to 'ascii', or 'rfc1459'");
368 std::string name = server->getString("name");
369 if (!name.empty() && name != ServerName)
370 throw CoreException("You must restart to change the server name");
372 std::string nsid = server->getString("id");
373 if (!nsid.empty() && nsid != sid)
374 throw CoreException("You must restart to change the server id");
376 std::string casemapping = options->getString("casemapping");
377 // Ignore this value if CaseMapping is set to something the core doesn't provide (i.e., m_nationalchars).
378 if (!casemapping.empty() && casemapping != CaseMapping && (CaseMapping == "ascii" || CaseMapping == "rfc1459"))
379 throw CoreException("You must restart to change the server casemapping");
382 SoftLimit = ConfValue("performance")->getUInt("softlimit", (SocketEngine::GetMaxFds() > 0 ? SocketEngine::GetMaxFds() : LONG_MAX), 10);
383 CCOnConnect = ConfValue("performance")->getBool("clonesonconnect", true);
384 MaxConn = ConfValue("performance")->getUInt("somaxconn", SOMAXCONN);
385 TimeSkipWarn = ConfValue("performance")->getDuration("timeskipwarn", 2, 0, 30);
386 XLineMessage = options->getString("xlinemessage", options->getString("moronbanner", "You're banned!"));
387 ServerDesc = server->getString("description", "Configure Me", 1);
388 Network = server->getString("network", "Network", 1);
389 NetBufferSize = ConfValue("performance")->getInt("netbuffersize", 10240, 1024, 65534);
390 CustomVersion = security->getString("customversion");
391 HideBans = security->getBool("hidebans");
392 HideServer = security->getString("hideserver", security->getString("hidewhois"));
393 SyntaxHints = options->getBool("syntaxhints");
394 FullHostInTopic = options->getBool("hostintopic");
395 MaxTargets = security->getUInt("maxtargets", 20, 1, 31);
396 DefaultModes = options->getString("defaultmodes", "not");
397 PID = ConfValue("pid")->getString("file");
398 MaxChans = ConfValue("channels")->getUInt("users", 20);
399 OperMaxChans = ConfValue("channels")->getUInt("opers", 0);
400 c_ipv4_range = ConfValue("cidr")->getUInt("ipv4clone", 32, 1, 32);
401 c_ipv6_range = ConfValue("cidr")->getUInt("ipv6clone", 128, 1, 128);
402 Limits = ServerLimits(ConfValue("limits"));
403 Paths = ServerPaths(ConfValue("path"));
404 NoSnoticeStack = options->getBool("nosnoticestack", false);
406 std::string defbind = options->getString("defaultbind");
407 if (stdalgo::string::equalsci(defbind, "ipv4"))
409 WildcardIPv6 = false;
411 else if (stdalgo::string::equalsci(defbind, "ipv6"))
418 int socktest = socket(AF_INET6, SOCK_STREAM, 0);
420 WildcardIPv6 = false;
422 SocketEngine::Close(socktest);
425 ReadXLine(this, "badip", "ipmask", ServerInstance->XLines->GetFactory("Z"));
426 ReadXLine(this, "badnick", "nick", ServerInstance->XLines->GetFactory("Q"));
427 ReadXLine(this, "badhost", "host", ServerInstance->XLines->GetFactory("K"));
428 ReadXLine(this, "exception", "host", ServerInstance->XLines->GetFactory("E"));
430 const std::string restrictbannedusers = options->getString("restrictbannedusers", "yes", 1);
431 if (stdalgo::string::equalsci(restrictbannedusers, "no"))
432 RestrictBannedUsers = ServerConfig::BUT_NORMAL;
433 else if (stdalgo::string::equalsci(restrictbannedusers, "silent"))
434 RestrictBannedUsers = ServerConfig::BUT_RESTRICT_SILENT;
435 else if (stdalgo::string::equalsci(restrictbannedusers, "yes"))
436 RestrictBannedUsers = ServerConfig::BUT_RESTRICT_NOTIFY;
438 throw CoreException(restrictbannedusers + " is an invalid <options:restrictbannedusers> value, at " + options->getTagLocation());
441 // WARNING: it is not safe to use most of the codebase in this function, as it
442 // will run in the config reader thread
443 void ServerConfig::Read()
445 /* Load and parse the config file, if there are any errors then explode */
447 ParseStack stack(this);
450 valid = stack.ParseFile(ServerInstance->ConfigFileName, 0);
452 catch (CoreException& err)
455 errstr << err.GetReason() << std::endl;
459 void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
465 * These values can only be set on boot. Keep their old values. Do it before we send messages so we actually have a servername.
467 this->CaseMapping = old->CaseMapping;
468 this->ServerName = old->ServerName;
469 this->sid = old->sid;
470 this->cmdline = old->cmdline;
473 /* The stuff in here may throw CoreException, be sure we're in a position to catch it. */
476 // Ensure the user has actually edited ther config.
477 ConfigTagList dietags = ConfTags("die");
478 if (dietags.first != dietags.second)
480 errstr << "Your configuration has not been edited correctly!" << std::endl;
481 for (ConfigIter iter = dietags.first; iter != dietags.second; ++iter)
483 ConfigTag* tag = iter->second;
484 const std::string reason = tag->getString("reason", "You left a <die> tag in your config", 1);
485 errstr << reason << " (at " << tag->getTagLocation() << ")" << std::endl;
491 // Handle special items
492 CrossCheckOperClassType();
493 CrossCheckConnectBlocks(old);
495 catch (CoreException &ce)
497 errstr << ce.GetReason() << std::endl;
500 // Check errors before dealing with failed binds, since continuing on failed bind is wanted in some circumstances.
501 valid = errstr.str().empty();
503 // write once here, to try it out and make sure its ok
505 ServerInstance->WritePID(this->PID, !old);
507 ConfigTagList binds = ConfTags("bind");
508 if (binds.first == binds.second)
509 errstr << "Possible configuration error: you have not defined any <bind> blocks." << std::endl
510 << "You will need to do this if you want clients to be able to connect!" << std::endl;
514 // On first run, ports are bound later on
516 ServerInstance->BindPorts(pl);
519 errstr << "Warning! Some of your listener" << (pl.size() == 1 ? "s" : "") << " failed to bind:" << std::endl;
520 for (FailedPortList::const_iterator iter = pl.begin(); iter != pl.end(); ++iter)
522 const FailedPort& fp = *iter;
523 errstr << " " << fp.sa.str() << ": " << strerror(fp.error) << std::endl
524 << " " << "Created from <bind> tag at " << fp.tag->getTagLocation() << std::endl;
529 User* user = useruid.empty() ? NULL : ServerInstance->FindUUID(useruid);
533 ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "There were errors in your configuration file:");
537 while (errstr.good())
540 getline(errstr, line, '\n');
543 // On startup, print out to console (still attached at this point)
545 std::cout << line << std::endl;
546 // If a user is rehashing, tell them directly
548 user->WriteRemoteNotice(InspIRCd::Format("*** %s", line.c_str()));
550 ServerInstance->SNO->WriteGlobalSno('a', line);
554 errstr.str(std::string());
556 /* No old configuration -> initial boot, nothing more to do here */
561 ServerInstance->Exit(EXIT_STATUS_CONFIG);
568 // If there were errors processing configuration, don't touch modules.
575 user->WriteRemoteNotice("*** Successfully rehashed server.");
576 ServerInstance->SNO->WriteGlobalSno('a', "*** Successfully rehashed server.");
579 void ServerConfig::ApplyModules(User* user)
581 std::vector<std::string> added_modules;
582 ModuleManager::ModuleMap removed_modules = ServerInstance->Modules->GetModules();
584 ConfigTagList tags = ConfTags("module");
585 for(ConfigIter i = tags.first; i != tags.second; ++i)
587 ConfigTag* tag = i->second;
589 if (tag->readString("name", name))
591 name = ModuleManager::ExpandModName(name);
592 // if this module is already loaded, the erase will succeed, so we need do nothing
593 // otherwise, we need to add the module (which will be done later)
594 if (removed_modules.erase(name) == 0)
595 added_modules.push_back(name);
599 for (ModuleManager::ModuleMap::iterator i = removed_modules.begin(); i != removed_modules.end(); ++i)
601 const std::string& modname = i->first;
602 // Don't remove core_*.so, just remove m_*.so
603 if (InspIRCd::Match(modname, "core_*.so", ascii_case_insensitive_map))
605 if (ServerInstance->Modules->Unload(i->second))
607 ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH UNLOADED MODULE: %s", modname.c_str());
610 user->WriteNumeric(RPL_UNLOADEDMODULE, modname, InspIRCd::Format("Module %s successfully unloaded.", modname.c_str()));
612 ServerInstance->SNO->WriteGlobalSno('a', "Module %s successfully unloaded.", modname.c_str());
617 user->WriteNumeric(ERR_CANTUNLOADMODULE, modname, InspIRCd::Format("Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str()));
619 ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str());
623 for (std::vector<std::string>::iterator adding = added_modules.begin(); adding != added_modules.end(); adding++)
625 // Skip modules which are already loaded.
626 if (ServerInstance->Modules->Find(*adding))
629 if (ServerInstance->Modules->Load(*adding))
631 ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH LOADED MODULE: %s",adding->c_str());
633 user->WriteNumeric(RPL_LOADEDMODULE, *adding, InspIRCd::Format("Module %s successfully loaded.", adding->c_str()));
635 ServerInstance->SNO->WriteGlobalSno('a', "Module %s successfully loaded.", adding->c_str());
640 user->WriteNumeric(ERR_CANTLOADMODULE, *adding, InspIRCd::Format("Failed to load module %s: %s", adding->c_str(), ServerInstance->Modules->LastError().c_str()));
642 ServerInstance->SNO->WriteGlobalSno('a', "Failed to load module %s: %s", adding->c_str(), ServerInstance->Modules->LastError().c_str());
647 ConfigTag* ServerConfig::ConfValue(const std::string &tag)
649 ConfigTagList found = config_data.equal_range(tag);
650 if (found.first == found.second)
652 ConfigTag* rv = found.first->second;
654 if (found.first != found.second)
655 ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Multiple <" + tag + "> tags found; only first will be used "
656 "(first at " + rv->getTagLocation() + "; second at " + found.first->second->getTagLocation() + ")");
660 ConfigTagList ServerConfig::ConfTags(const std::string& tag)
662 return config_data.equal_range(tag);
665 std::string ServerConfig::Escape(const std::string& str, bool xml)
668 for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
673 escaped += xml ? """ : "\"";
676 escaped += xml ? "&" : "&";
679 escaped += xml ? "\\" : "\\\\";
689 void ConfigReaderThread::Run()
695 void ConfigReaderThread::Finish()
697 ServerConfig* old = ServerInstance->Config;
698 ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "Switching to new configuration...");
699 ServerInstance->Config = this->Config;
700 Config->Apply(old, TheUserUID);
705 * Apply the changed configuration from the rehash.
707 * XXX: The order of these is IMPORTANT, do not reorder them without testing
710 ServerInstance->Users.RehashCloneCounts();
711 ServerInstance->XLines->CheckELines();
712 ServerInstance->XLines->ApplyLines();
713 User* user = ServerInstance->FindUUID(TheUserUID);
715 ConfigStatus status(user);
716 const ModuleManager::ModuleMap& mods = ServerInstance->Modules->GetModules();
717 for (ModuleManager::ModuleMap::const_iterator i = mods.begin(); i != mods.end(); ++i)
721 ServerInstance->Logs->Log("MODULE", LOG_DEBUG, "Rehashing " + i->first);
722 i->second->ReadConfig(status);
724 catch (CoreException& modex)
726 ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "Exception caught: " + modex.GetReason());
728 user->WriteNotice(i->first + ": " + modex.GetReason());
732 // The description of this server may have changed - update it for WHOIS etc.
733 ServerInstance->FakeClient->server->description = Config->ServerDesc;
735 ServerInstance->ISupport.Build();
737 ServerInstance->Logs->CloseLogs();
738 ServerInstance->Logs->OpenFileLogs();
740 if (Config->RawLog && !old->RawLog)
741 ServerInstance->Users->ServerNoticeAll("*** Raw I/O logging is enabled on this server. All messages, passwords, and commands are being recorded.");
748 ServerInstance->Config = old;