2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
5 * Copyright (C) 2007-2009 Robin Burchell <robin+git@viroteck.net>
6 * Copyright (C) 2006-2009 Dennis Friis <peavey@inspircd.org>
7 * Copyright (C) 2006-2008 Craig Edwards <craigedwards@brainbox.cc>
8 * Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
9 * Copyright (C) 2006 Oliver Lupton <oliverlupton@gmail.com>
11 * This file is part of InspIRCd. InspIRCd is free software: you can
12 * redistribute it and/or modify it under the terms of the GNU General Public
13 * License as published by the Free Software Foundation, version 2.
15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 #include "exitcodes.h"
29 #include "configparser.h"
32 ServerLimits::ServerLimits(ConfigTag* tag)
33 : NickMax(tag->getUInt("maxnick", 30))
34 , ChanMax(tag->getUInt("maxchan", 64))
35 , MaxModes(tag->getUInt("maxmodes", 20))
36 , IdentMax(tag->getUInt("maxident", 10))
37 , MaxQuit(tag->getUInt("maxquit", 255))
38 , MaxTopic(tag->getUInt("maxtopic", 307))
39 , MaxKick(tag->getUInt("maxkick", 255))
40 , MaxReal(tag->getUInt("maxreal", tag->getUInt("maxgecos", 128)))
41 , MaxAway(tag->getUInt("maxaway", 200))
42 , MaxLine(tag->getUInt("maxline", 512))
43 , MaxHost(tag->getUInt("maxhost", 64))
47 ServerConfig::ServerPaths::ServerPaths(ConfigTag* tag)
48 : Config(tag->getString("configdir", INSPIRCD_CONFIG_PATH))
49 , Data(tag->getString("datadir", INSPIRCD_DATA_PATH))
50 , Log(tag->getString("logdir", INSPIRCD_LOG_PATH))
51 , Module(tag->getString("moduledir", INSPIRCD_MODULE_PATH))
55 static ConfigTag* CreateEmptyTag()
58 return ConfigTag::create("empty", "<auto>", 0, items);
61 ServerConfig::ServerConfig()
62 : EmptyTag(CreateEmptyTag())
66 , NoSnoticeStack(false)
70 ServerConfig::~ServerConfig()
75 bool ServerConfig::ApplyDisabledCommands()
77 // Enable everything first.
78 const CommandParser::CommandMap& commands = ServerInstance->Parser.GetCommands();
79 for (CommandParser::CommandMap::const_iterator x = commands.begin(); x != commands.end(); ++x)
80 x->second->Disable(false);
82 // Now disable the commands specified in the config.
84 irc::spacesepstream commandlist(ConfValue("disabled")->getString("commands"));
85 while (commandlist.GetToken(command))
87 Command* handler = ServerInstance->Parser.GetHandler(command);
90 ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "Unable to disable the %s command as it does not exist!", command.c_str());
94 ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "The %s command has been disabled", command.c_str());
95 handler->Disable(true);
100 static void ReadXLine(ServerConfig* conf, const std::string& tag, const std::string& key, XLineFactory* make)
102 ConfigTagList tags = conf->ConfTags(tag);
103 for(ConfigIter i = tags.first; i != tags.second; ++i)
105 ConfigTag* ctag = i->second;
107 if (!ctag->readString(key, mask))
108 throw CoreException("<"+tag+":"+key+"> missing at " + ctag->getTagLocation());
109 std::string reason = ctag->getString("reason", "<Config>");
110 XLine* xl = make->Generate(ServerInstance->Time(), 0, "<Config>", reason, mask);
111 xl->from_config = true;
112 if (!ServerInstance->XLines->AddLine(xl, NULL))
117 typedef std::map<std::string, ConfigTag*> LocalIndex;
118 void ServerConfig::CrossCheckOperClassType()
120 LocalIndex operclass;
121 ConfigTagList tags = ConfTags("class");
122 for(ConfigIter i = tags.first; i != tags.second; ++i)
124 ConfigTag* tag = i->second;
125 std::string name = tag->getString("name");
127 throw CoreException("<class:name> missing from tag at " + tag->getTagLocation());
128 if (operclass.find(name) != operclass.end())
129 throw CoreException("Duplicate class block with name " + name + " at " + tag->getTagLocation());
130 operclass[name] = tag;
132 tags = ConfTags("type");
133 for(ConfigIter i = tags.first; i != tags.second; ++i)
135 ConfigTag* tag = i->second;
136 std::string name = tag->getString("name");
138 throw CoreException("<type:name> is missing from tag at " + tag->getTagLocation());
139 if (OperTypes.find(name) != OperTypes.end())
140 throw CoreException("Duplicate type block with name " + name + " at " + tag->getTagLocation());
142 OperInfo* ifo = new OperInfo(name);
143 OperTypes[name] = ifo;
144 ifo->type_block = tag;
146 std::string classname;
147 irc::spacesepstream str(tag->getString("classes"));
148 while (str.GetToken(classname))
150 LocalIndex::iterator cls = operclass.find(classname);
151 if (cls == operclass.end())
152 throw CoreException("Oper type " + name + " has missing class " + classname);
153 ifo->class_blocks.push_back(cls->second);
157 tags = ConfTags("oper");
158 for(ConfigIter i = tags.first; i != tags.second; ++i)
160 ConfigTag* tag = i->second;
162 std::string name = tag->getString("name");
164 throw CoreException("<oper:name> missing from tag at " + tag->getTagLocation());
166 std::string type = tag->getString("type");
167 OperIndex::iterator tblk = OperTypes.find(type);
168 if (tblk == OperTypes.end())
169 throw CoreException("Oper block " + name + " has missing type " + type);
170 if (oper_blocks.find(name) != oper_blocks.end())
171 throw CoreException("Duplicate oper block with name " + name + " at " + tag->getTagLocation());
173 OperInfo* ifo = new OperInfo(type);
174 ifo->oper_block = tag;
175 ifo->type_block = tblk->second->type_block;
176 ifo->class_blocks.assign(tblk->second->class_blocks.begin(), tblk->second->class_blocks.end());
177 oper_blocks[name] = ifo;
181 void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
183 typedef std::map<std::string, ConnectClass*> ClassMap;
184 ClassMap oldBlocksByMask;
187 for(ClassVector::iterator i = current->Classes.begin(); i != current->Classes.end(); ++i)
189 ConnectClass* c = *i;
190 if (c->name.compare(0, 8, "unnamed-", 8))
192 oldBlocksByMask["n" + c->name] = c;
194 else if (c->type == CC_ALLOW || c->type == CC_DENY)
196 std::string typeMask = (c->type == CC_ALLOW) ? "a" : "d";
198 oldBlocksByMask[typeMask] = c;
203 size_t blk_count = config_data.count("connect");
206 // No connect blocks found; make a trivial default block
208 ConfigTag* tag = ConfigTag::create("connect", "<auto>", 0, items);
209 (*items)["allow"] = "*";
210 config_data.insert(std::make_pair("connect", tag));
214 Classes.resize(blk_count);
215 std::map<std::string, size_t> names;
217 bool try_again = true;
218 for(size_t tries = 0; try_again; tries++)
221 ConfigTagList tags = ConfTags("connect");
223 for(ConfigIter it = tags.first; it != tags.second; ++it, ++i)
225 ConfigTag* tag = it->second;
229 ConnectClass* parent = NULL;
230 std::string parentName = tag->getString("parent");
231 if (!parentName.empty())
233 std::map<std::string, size_t>::const_iterator parentIter = names.find(parentName);
234 if (parentIter == names.end())
237 // couldn't find parent this time. If it's the last time, we'll never find it.
238 if (tries >= blk_count)
239 throw CoreException("Could not find parent connect class \"" + parentName + "\" for connect block at " + tag->getTagLocation());
242 parent = Classes[parentIter->second];
245 std::string name = tag->getString("name");
246 std::string mask, typeMask;
249 if (tag->readString("allow", mask, false))
252 typeMask = 'a' + mask;
254 else if (tag->readString("deny", mask, false))
257 typeMask = 'd' + mask;
259 else if (!name.empty())
263 typeMask = 'n' + mask;
267 throw CoreException("Connect class must have allow, deny, or name specified at " + tag->getTagLocation());
272 name = "unnamed-" + ConvToStr(i);
276 typeMask = 'n' + name;
279 if (names.find(name) != names.end())
280 throw CoreException("Two connect classes with name \"" + name + "\" defined!");
283 ConnectClass* me = parent ?
284 new ConnectClass(tag, type, mask, *parent) :
285 new ConnectClass(tag, type, mask);
289 me->registration_timeout = tag->getDuration("timeout", me->registration_timeout);
290 me->pingtime = tag->getDuration("pingfreq", me->pingtime);
292 if (tag->readString("sendq", sendq))
294 // attempt to guess a good hard/soft sendq from a single value
295 unsigned long value = strtoul(sendq.c_str(), NULL, 10);
297 me->softsendqmax = value / 16;
299 me->softsendqmax = value;
300 me->hardsendqmax = value * 8;
302 me->softsendqmax = tag->getUInt("softsendq", me->softsendqmax);
303 me->hardsendqmax = tag->getUInt("hardsendq", me->hardsendqmax);
304 me->recvqmax = tag->getUInt("recvq", me->recvqmax);
305 me->penaltythreshold = tag->getUInt("threshold", me->penaltythreshold);
306 me->commandrate = tag->getUInt("commandrate", me->commandrate);
307 me->fakelag = tag->getBool("fakelag", me->fakelag);
308 me->maxlocal = tag->getUInt("localmax", me->maxlocal);
309 me->maxglobal = tag->getUInt("globalmax", me->maxglobal);
310 me->maxchans = tag->getUInt("maxchans", me->maxchans);
311 me->maxconnwarn = tag->getBool("maxconnwarn", me->maxconnwarn);
312 me->limit = tag->getUInt("limit", me->limit);
313 me->resolvehostnames = tag->getBool("resolvehostnames", me->resolvehostnames);
315 std::string ports = tag->getString("port");
318 irc::portparser portrange(ports, false);
319 while (int port = portrange.GetToken())
320 me->ports.insert(port);
323 ClassMap::iterator oldMask = oldBlocksByMask.find(typeMask);
324 if (oldMask != oldBlocksByMask.end())
326 ConnectClass* old = oldMask->second;
327 oldBlocksByMask.erase(oldMask);
337 void ServerConfig::Fill()
339 ConfigTag* options = ConfValue("options");
340 ConfigTag* security = ConfValue("security");
341 ConfigTag* server = ConfValue("server");
344 ServerName = server->getString("name", "irc.example.com", InspIRCd::IsHost);
346 sid = server->getString("id");
347 if (!sid.empty() && !InspIRCd::IsSID(sid))
348 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.");
350 CaseMapping = options->getString("casemapping", "rfc1459");
351 if (CaseMapping == "ascii")
352 national_case_insensitive_map = ascii_case_insensitive_map;
353 else if (CaseMapping == "rfc1459")
354 national_case_insensitive_map = rfc_case_insensitive_map;
356 throw CoreException("<options:casemapping> must be set to 'ascii', or 'rfc1459'");
360 std::string name = server->getString("name");
361 if (!name.empty() && name != ServerName)
362 throw CoreException("You must restart to change the server name");
364 std::string nsid = server->getString("id");
365 if (!nsid.empty() && nsid != sid)
366 throw CoreException("You must restart to change the server id");
368 std::string casemapping = options->getString("casemapping");
369 if (!casemapping.empty() && casemapping != CaseMapping)
370 throw CoreException("You must restart to change the server casemapping");
373 SoftLimit = ConfValue("performance")->getUInt("softlimit", (SocketEngine::GetMaxFds() > 0 ? SocketEngine::GetMaxFds() : LONG_MAX), 10);
374 CCOnConnect = ConfValue("performance")->getBool("clonesonconnect", true);
375 MaxConn = ConfValue("performance")->getUInt("somaxconn", SOMAXCONN);
376 XLineMessage = options->getString("xlinemessage", options->getString("moronbanner", "You're banned!"));
377 ServerDesc = server->getString("description", "Configure Me");
378 Network = server->getString("network", "Network");
379 NetBufferSize = ConfValue("performance")->getInt("netbuffersize", 10240, 1024, 65534);
380 DisabledDontExist = ConfValue("disabled")->getBool("fakenonexistant");
381 CustomVersion = security->getString("customversion");
382 HideBans = security->getBool("hidebans");
383 HideServer = security->getString("hideserver", security->getString("hidewhois"));
384 SyntaxHints = options->getBool("syntaxhints");
385 FullHostInTopic = options->getBool("hostintopic");
386 MaxTargets = security->getUInt("maxtargets", 20, 1, 31);
387 DefaultModes = options->getString("defaultmodes", "not");
388 PID = ConfValue("pid")->getString("file");
389 MaxChans = ConfValue("channels")->getUInt("users", 20);
390 OperMaxChans = ConfValue("channels")->getUInt("opers", 0);
391 c_ipv4_range = ConfValue("cidr")->getUInt("ipv4clone", 32, 1, 32);
392 c_ipv6_range = ConfValue("cidr")->getUInt("ipv6clone", 128, 1, 128);
393 Limits = ServerLimits(ConfValue("limits"));
394 Paths = ServerPaths(ConfValue("path"));
395 NoSnoticeStack = options->getBool("nosnoticestack", false);
397 std::string defbind = options->getString("defaultbind");
398 if (stdalgo::string::equalsci(defbind, "ipv4"))
400 WildcardIPv6 = false;
402 else if (stdalgo::string::equalsci(defbind, "ipv6"))
409 int socktest = socket(AF_INET6, SOCK_STREAM, 0);
411 WildcardIPv6 = false;
413 SocketEngine::Close(socktest);
416 ServerInstance->XLines->ClearConfigLines();
417 ReadXLine(this, "badip", "ipmask", ServerInstance->XLines->GetFactory("Z"));
418 ReadXLine(this, "badnick", "nick", ServerInstance->XLines->GetFactory("Q"));
419 ReadXLine(this, "badhost", "host", ServerInstance->XLines->GetFactory("K"));
420 ReadXLine(this, "exception", "host", ServerInstance->XLines->GetFactory("E"));
422 const std::string restrictbannedusers = options->getString("restrictbannedusers", "yes");
423 if (stdalgo::string::equalsci(restrictbannedusers, "no"))
424 RestrictBannedUsers = ServerConfig::BUT_NORMAL;
425 else if (stdalgo::string::equalsci(restrictbannedusers, "silent"))
426 RestrictBannedUsers = ServerConfig::BUT_RESTRICT_SILENT;
427 else if (stdalgo::string::equalsci(restrictbannedusers, "yes"))
428 RestrictBannedUsers = ServerConfig::BUT_RESTRICT_NOTIFY;
430 throw CoreException(restrictbannedusers + " is an invalid <options:restrictbannedusers> value, at " + options->getTagLocation());
432 DisabledUModes.reset();
433 std::string modes = ConfValue("disabled")->getString("usermodes");
434 for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p)
436 // Complain when the character is not a valid mode character.
437 if (!ModeParser::IsModeChar(*p))
438 throw CoreException("Invalid usermode " + std::string(1, *p) + " was found.");
439 DisabledUModes.set(*p - 'A');
442 DisabledCModes.reset();
443 modes = ConfValue("disabled")->getString("chanmodes");
444 for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p)
446 if (!ModeParser::IsModeChar(*p))
447 throw CoreException("Invalid chanmode " + std::string(1, *p) + " was found.");
448 DisabledCModes.set(*p - 'A');
452 // WARNING: it is not safe to use most of the codebase in this function, as it
453 // will run in the config reader thread
454 void ServerConfig::Read()
456 /* Load and parse the config file, if there are any errors then explode */
458 ParseStack stack(this);
461 valid = stack.ParseFile(ServerInstance->ConfigFileName, 0);
463 catch (CoreException& err)
466 errstr << err.GetReason() << std::endl;
470 void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
476 * These values can only be set on boot. Keep their old values. Do it before we send messages so we actually have a servername.
478 this->CaseMapping = old->CaseMapping;
479 this->ServerName = old->ServerName;
480 this->sid = old->sid;
481 this->cmdline = old->cmdline;
484 /* The stuff in here may throw CoreException, be sure we're in a position to catch it. */
487 // Ensure the user has actually edited ther config.
488 ConfigTagList dietags = ConfTags("die");
489 if (dietags.first != dietags.second)
491 errstr << "Your configuration has not been edited correctly!" << std::endl;
492 for (ConfigIter iter = dietags.first; iter != dietags.second; ++iter)
494 ConfigTag* tag = iter->second;
495 const std::string reason = tag->getString("reason", "You left a <die> tag in your config", 1);
496 errstr << reason << " (at " << tag->getTagLocation() << ")" << std::endl;
502 // Handle special items
503 CrossCheckOperClassType();
504 CrossCheckConnectBlocks(old);
506 catch (CoreException &ce)
508 errstr << ce.GetReason() << std::endl;
511 // Check errors before dealing with failed binds, since continuing on failed bind is wanted in some circumstances.
512 valid = errstr.str().empty();
514 // write once here, to try it out and make sure its ok
516 ServerInstance->WritePID(this->PID, !old);
518 ConfigTagList binds = ConfTags("bind");
519 if (binds.first == binds.second)
520 errstr << "Possible configuration error: you have not defined any <bind> blocks." << std::endl
521 << "You will need to do this if you want clients to be able to connect!" << std::endl;
525 // On first run, ports are bound later on
527 ServerInstance->BindPorts(pl);
530 errstr << "Not all your client ports could be bound." << std::endl
531 << "The following port(s) failed to bind:" << std::endl;
534 for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++)
536 errstr << j << ".\tAddress: " << i->first.str() << "\tReason: " << strerror(i->second) << std::endl;
541 User* user = useruid.empty() ? NULL : ServerInstance->FindNick(useruid);
545 ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "There were errors in your configuration file:");
549 while (errstr.good())
552 getline(errstr, line, '\n');
555 // On startup, print out to console (still attached at this point)
557 std::cout << line << std::endl;
558 // If a user is rehashing, tell them directly
560 user->WriteRemoteNotice(InspIRCd::Format("*** %s", line.c_str()));
562 ServerInstance->SNO->WriteGlobalSno('a', line);
566 errstr.str(std::string());
568 // Re-parse our MOTD and RULES files for colors -- Justasic
569 for (ClassVector::const_iterator it = this->Classes.begin(), it_end = this->Classes.end(); it != it_end; ++it)
571 ConfigTag *tag = (*it)->config;
573 ConfigFileCache::iterator file = this->Files.find(tag->getString("motd", "motd"));
574 if (file != this->Files.end())
575 InspIRCd::ProcessColors(file->second);
578 /* No old configuration -> initial boot, nothing more to do here */
583 ServerInstance->Exit(EXIT_STATUS_CONFIG);
590 // If there were errors processing configuration, don't touch modules.
597 user->WriteRemoteNotice("*** Successfully rehashed server.");
598 ServerInstance->SNO->WriteGlobalSno('a', "*** Successfully rehashed server.");
601 void ServerConfig::ApplyModules(User* user)
603 std::vector<std::string> added_modules;
604 ModuleManager::ModuleMap removed_modules = ServerInstance->Modules->GetModules();
606 ConfigTagList tags = ConfTags("module");
607 for(ConfigIter i = tags.first; i != tags.second; ++i)
609 ConfigTag* tag = i->second;
611 if (tag->readString("name", name))
613 name = ModuleManager::ExpandModName(name);
614 // if this module is already loaded, the erase will succeed, so we need do nothing
615 // otherwise, we need to add the module (which will be done later)
616 if (removed_modules.erase(name) == 0)
617 added_modules.push_back(name);
621 for (ModuleManager::ModuleMap::iterator i = removed_modules.begin(); i != removed_modules.end(); ++i)
623 const std::string& modname = i->first;
624 // Don't remove core_*.so, just remove m_*.so
625 if (InspIRCd::Match(modname, "core_*.so", ascii_case_insensitive_map))
627 if (ServerInstance->Modules->Unload(i->second))
629 ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH UNLOADED MODULE: %s", modname.c_str());
632 user->WriteNumeric(RPL_UNLOADEDMODULE, modname, InspIRCd::Format("Module %s successfully unloaded.", modname.c_str()));
634 ServerInstance->SNO->WriteGlobalSno('a', "Module %s successfully unloaded.", modname.c_str());
639 user->WriteNumeric(ERR_CANTUNLOADMODULE, modname, InspIRCd::Format("Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str()));
641 ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str());
645 for (std::vector<std::string>::iterator adding = added_modules.begin(); adding != added_modules.end(); adding++)
647 // Skip modules which are already loaded.
648 if (ServerInstance->Modules->Find(*adding))
651 if (ServerInstance->Modules->Load(*adding))
653 ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH LOADED MODULE: %s",adding->c_str());
655 user->WriteNumeric(RPL_LOADEDMODULE, *adding, InspIRCd::Format("Module %s successfully loaded.", adding->c_str()));
657 ServerInstance->SNO->WriteGlobalSno('a', "Module %s successfully loaded.", adding->c_str());
662 user->WriteNumeric(ERR_CANTLOADMODULE, *adding, InspIRCd::Format("Failed to load module %s: %s", adding->c_str(), ServerInstance->Modules->LastError().c_str()));
664 ServerInstance->SNO->WriteGlobalSno('a', "Failed to load module %s: %s", adding->c_str(), ServerInstance->Modules->LastError().c_str());
669 ConfigTag* ServerConfig::ConfValue(const std::string &tag)
671 ConfigTagList found = config_data.equal_range(tag);
672 if (found.first == found.second)
674 ConfigTag* rv = found.first->second;
676 if (found.first != found.second)
677 ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Multiple <" + tag + "> tags found; only first will be used "
678 "(first at " + rv->getTagLocation() + "; second at " + found.first->second->getTagLocation() + ")");
682 ConfigTagList ServerConfig::ConfTags(const std::string& tag)
684 return config_data.equal_range(tag);
687 std::string ServerConfig::Escape(const std::string& str, bool xml)
690 for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
695 escaped += xml ? """ : "\"";
698 escaped += xml ? "&" : "&";
701 escaped += xml ? "\\" : "\\\\";
711 void ConfigReaderThread::Run()
717 void ConfigReaderThread::Finish()
719 ServerConfig* old = ServerInstance->Config;
720 ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "Switching to new configuration...");
721 ServerInstance->Config = this->Config;
722 Config->Apply(old, TheUserUID);
727 * Apply the changed configuration from the rehash.
729 * XXX: The order of these is IMPORTANT, do not reorder them without testing
732 ServerInstance->Users.RehashCloneCounts();
733 ServerInstance->XLines->CheckELines();
734 ServerInstance->XLines->ApplyLines();
735 Config->ApplyDisabledCommands();
736 User* user = ServerInstance->FindNick(TheUserUID);
738 ConfigStatus status(user);
739 const ModuleManager::ModuleMap& mods = ServerInstance->Modules->GetModules();
740 for (ModuleManager::ModuleMap::const_iterator i = mods.begin(); i != mods.end(); ++i)
744 ServerInstance->Logs->Log("MODULE", LOG_DEBUG, "Rehashing " + i->first);
745 i->second->ReadConfig(status);
747 catch (CoreException& modex)
749 ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "Exception caught: " + modex.GetReason());
751 user->WriteNotice(i->first + ": " + modex.GetReason());
755 // The description of this server may have changed - update it for WHOIS etc.
756 ServerInstance->FakeClient->server->description = Config->ServerDesc;
758 ServerInstance->ISupport.Build();
760 ServerInstance->Logs->CloseLogs();
761 ServerInstance->Logs->OpenFileLogs();
763 if (Config->RawLog && !old->RawLog)
764 ServerInstance->Users->ServerNoticeAll("*** Raw I/O logging is enabled on this server. All messages, passwords, and commands are being recorded.");
771 ServerInstance->Config = old;