diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-10 22:36:20 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-10 22:36:20 +0000 |
commit | 20b26ef72a4b2ead2fe23931240098ed10f64a70 (patch) | |
tree | 6546d81f2b791c94fcb65b61029548719775f04b /src | |
parent | 5ec0078659c33a290829804b3147b3047bb42f28 (diff) |
Fix for bug #503 reported by Stealth (at last)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9453 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/configreader.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index df7721e82..2b6672ae9 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1149,6 +1149,43 @@ void ServerConfig::Read(bool bail, User* user) ServerInstance->Logs->CloseLogs(); ServerInstance->Logs->OpenFileLogs(); + ServerInstance->Threads->Mutex(true); + for (int i = 0; i < ConfValueEnum(this->config_data, "type"); ++i) + { + char item[MAXBUF], classn[MAXBUF], classes[MAXBUF]; + std::string classname; + ConfValue(this->config_data, "type", "classes", "", i, classes, MAXBUF, false); + irc::spacesepstream str(classes); + ConfValue(this->config_data, "type", "name", "", i, item, MAXBUF, false); + while (str.GetToken(classname)) + { + std::string lost; + bool foundclass = false; + for (int j = 0; j < ConfValueEnum(this->config_data, "class"); ++j) + { + ConfValue(this->config_data, "class", "name", "", j, classn, MAXBUF, false); + if (!strcmp(classn, classname.c_str())) + { + foundclass = true; + break; + } + } + if (!foundclass) + { + if (user) + user->WriteServ("NOTICE %s :*** Warning: Oper type '%s' has a missing class named '%s', this does nothing!", user->nick, item, classname.c_str()); + else + { + if (bail) + printf("Warning: Oper type '%s' has a missing class named '%s', this does nothing!\n", item, classname.c_str()); + else + ServerInstance->SNO->WriteToSnoMask('A', "Warning: Oper type '%s' has a missing class named '%s', this does nothing!", item, classname.c_str()); + } + } + } + } + ServerInstance->Threads->Mutex(false); + ServerInstance->Logs->Log("CONFIG", DEFAULT, "Done reading configuration file."); /* If we're rehashing, let's load any new modules, and unload old ones |