X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=2320a44b1f570ef4597cdedb7c838bee419f2f43;hb=d379dcab405bd4b0542e3c645a2de3c1a27832b8;hp=656bc338af6f3419d3fe7fab3f7e72d001201529;hpb=d349f981fbe70fb11e3db4c486f59749ffe74c2b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index 656bc338a..2320a44b1 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -444,19 +444,6 @@ void ServerConfig::Fill() else ServerInstance->SE->Close(socktest); } - ConfigTagList tags = ConfTags("uline"); - for(ConfigIter i = tags.first; i != tags.second; ++i) - { - ConfigTag* tag = i->second; - std::string server; - if (!tag->readString("server", server)) - throw CoreException(" tag missing server at " + tag->getTagLocation()); - - if (ServerName == server) - throw CoreException("Servers should not uline themselves (at " + tag->getTagLocation() + ")"); - - ulines[assign(server)] = tag->getBool("silent"); - } ReadXLine(this, "badip", "ipmask", ServerInstance->XLines->GetFactory("Z")); ReadXLine(this, "badnick", "nick", ServerInstance->XLines->GetFactory("Q")); @@ -521,7 +508,7 @@ void ServerConfig::Read() catch (CoreException& err) { valid = false; - errstr << err.GetReason(); + errstr << err.GetReason() << std::endl; } } @@ -641,10 +628,6 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) ConfigFileCache::iterator file = this->Files.find(tag->getString("motd", "motd")); if (file != this->Files.end()) InspIRCd::ProcessColors(file->second); - - file = this->Files.find(tag->getString("rules", "rules")); - if (file != this->Files.end()) - InspIRCd::ProcessColors(file->second); } /* No old configuration -> initial boot, nothing more to do here */ @@ -701,14 +684,14 @@ void ServerConfig::ApplyModules(User* user) ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH UNLOADED MODULE: %s", modname.c_str()); if (user) - user->WriteNumeric(RPL_UNLOADEDMODULE, "%s %s :Module %s successfully unloaded.",user->nick.c_str(), modname.c_str(), modname.c_str()); + user->WriteNumeric(RPL_UNLOADEDMODULE, "%s :Module %s successfully unloaded.", modname.c_str(), modname.c_str()); else ServerInstance->SNO->WriteGlobalSno('a', "Module %s successfully unloaded.", modname.c_str()); } else { if (user) - user->WriteNumeric(ERR_CANTUNLOADMODULE, "%s %s :Failed to unload module %s: %s",user->nick.c_str(), modname.c_str(), modname.c_str(), ServerInstance->Modules->LastError().c_str()); + user->WriteNumeric(ERR_CANTUNLOADMODULE, "%s :Failed to unload module %s: %s", modname.c_str(), modname.c_str(), ServerInstance->Modules->LastError().c_str()); else ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str()); } @@ -720,25 +703,20 @@ void ServerConfig::ApplyModules(User* user) { ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH LOADED MODULE: %s",adding->c_str()); if (user) - user->WriteNumeric(RPL_LOADEDMODULE, "%s %s :Module %s successfully loaded.",user->nick.c_str(), adding->c_str(), adding->c_str()); + user->WriteNumeric(RPL_LOADEDMODULE, "%s :Module %s successfully loaded.", adding->c_str(), adding->c_str()); else ServerInstance->SNO->WriteGlobalSno('a', "Module %s successfully loaded.", adding->c_str()); } else { if (user) - user->WriteNumeric(ERR_CANTLOADMODULE, "%s %s :Failed to load module %s: %s",user->nick.c_str(), adding->c_str(), adding->c_str(), ServerInstance->Modules->LastError().c_str()); + user->WriteNumeric(ERR_CANTLOADMODULE, "%s :Failed to load module %s: %s", adding->c_str(), adding->c_str(), ServerInstance->Modules->LastError().c_str()); else ServerInstance->SNO->WriteGlobalSno('a', "Failed to load module %s: %s", adding->c_str(), ServerInstance->Modules->LastError().c_str()); } } } -bool ServerConfig::StartsWithWindowsDriveLetter(const std::string &path) -{ - return (path.length() > 2 && isalpha(path[0]) && path[1] == ':'); -} - ConfigTag* ServerConfig::ConfValue(const std::string &tag) { ConfigTagList found = config_data.equal_range(tag); @@ -757,18 +735,6 @@ ConfigTagList ServerConfig::ConfTags(const std::string& tag) return config_data.equal_range(tag); } -bool ServerConfig::FileExists(const char* file) -{ - struct stat sb; - if (stat(file, &sb) == -1) - return false; - - if ((sb.st_mode & S_IFDIR) > 0) - return false; - - return !access(file, F_OK); -} - std::string ServerConfig::Escape(const std::string& str, bool xml) { std::string escaped; @@ -793,22 +759,6 @@ std::string ServerConfig::Escape(const std::string& str, bool xml) return escaped; } -std::string ServerConfig::ExpandPath(const std::string& base, const std::string& fragment) -{ - // The fragment is an absolute path, don't modify it. - if (fragment[0] == '/' || ServerConfig::StartsWithWindowsDriveLetter(fragment)) - return fragment; - - return base + '/' + fragment; -} - -const char* ServerConfig::CleanFilename(const char* name) -{ - const char* p = name + strlen(name); - while ((p != name) && (*p != '/') && (*p != '\\')) p--; - return (p != name ? ++p : p); -} - void ConfigReaderThread::Run() { Config->Read();