X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=1905b36d083412fb62e67c06550fe10f0c24a51e;hb=ac83d3b0d607f2bdc373365bc2f08f0cde023bf3;hp=183e78a12f9137995c8424b8fa5581b5aea4e8cc;hpb=0ca1aa58d74ee743423602467cedda686e311bc1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index 183e78a12..1905b36d0 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -11,20 +11,6 @@ * --------------------------------------------------- */ -/* $Core */ -/* $CopyInstall: conf/inspircd.quotes.example $(CONPATH) */ -/* $CopyInstall: conf/inspircd.rules.example $(CONPATH) */ -/* $CopyInstall: conf/inspircd.motd.example $(CONPATH) */ -/* $CopyInstall: conf/inspircd.helpop-full.example $(CONPATH) */ -/* $CopyInstall: conf/inspircd.helpop.example $(CONPATH) */ -/* $CopyInstall: conf/inspircd.censor.example $(CONPATH) */ -/* $CopyInstall: conf/inspircd.filter.example $(CONPATH) */ -/* $CopyInstall: conf/inspircd.conf.example $(CONPATH) */ -/* $CopyInstall: conf/modules.conf.example $(CONPATH) */ -/* $CopyInstall: conf/opers.conf.example $(CONPATH) */ -/* $CopyInstall: conf/links.conf.example $(CONPATH) */ -/* $CopyInstall: tools/gdbargs $(BASE)/.gdbargs */ - #include "inspircd.h" #include #include "xline.h" @@ -36,7 +22,7 @@ ServerConfig::ServerConfig() { WhoWasGroupSize = WhoWasMaxGroups = WhoWasMaxKeep = 0; NoUserDns = OperSpyWhois = HideBans = HideSplits = UndernetMsgPrefix = false; - CycleHosts = InvBypassModes = true; + WildcardIPv6 = CycleHosts = InvBypassModes = true; dns_timeout = 5; MaxTargets = 20; NetBufferSize = 10240; @@ -361,8 +347,6 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) me->name = name; - tag->readString("password", me->pass); - tag->readString("hash", me->hash); me->registration_timeout = tag->getInt("timeout", me->registration_timeout); me->pingtime = tag->getInt("pingfreq", me->pingtime); std::string sendq; @@ -384,7 +368,6 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) me->fakelag = tag->getBool("fakelag", me->fakelag); me->maxlocal = tag->getInt("localmax", me->maxlocal); me->maxglobal = tag->getInt("globalmax", me->maxglobal); - me->port = tag->getInt("port", me->port); me->maxchans = tag->getInt("maxchans", me->maxchans); me->limit = tag->getInt("limit", me->limit); @@ -468,7 +451,7 @@ void ServerConfig::Fill() DisabledCommands = ConfValue("disabled")->getString("commands", ""); DisabledDontExist = ConfValue("disabled")->getBool("fakenonexistant"); UserStats = security->getString("userstats"); - CustomVersion = security->getString("customversion"); + CustomVersion = security->getString("customversion", Network + " IRCd"); HideSplits = security->getBool("hidesplits"); HideBans = security->getBool("hidebans"); HideWhoisServer = security->getString("hidewhois"); @@ -487,7 +470,6 @@ void ServerConfig::Fill() WhoWasGroupSize = ConfValue("whowas")->getInt("groupsize"); WhoWasMaxGroups = ConfValue("whowas")->getInt("maxgroups"); WhoWasMaxKeep = ServerInstance->Duration(ConfValue("whowas")->getString("maxkeep")); - DieValue = ConfValue("die")->getString("value"); MaxChans = ConfValue("channels")->getInt("users", 20); OperMaxChans = ConfValue("channels")->getInt("opers", 60); c_ipv4_range = ConfValue("cidr")->getInt("ipv4clone", 32); @@ -516,6 +498,24 @@ void ServerConfig::Fill() if (!sid.empty() && !ServerInstance->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."); + std::string defbind = options->getString("defaultbind"); + if (assign(defbind) == "ipv4") + { + WildcardIPv6 = false; + } + else if (assign(defbind) == "ipv6") + { + WildcardIPv6 = true; + } + else + { + WildcardIPv6 = true; + int socktest = socket(AF_INET6, SOCK_STREAM, 0); + if (socktest < 0) + WildcardIPv6 = false; + else + close(socktest); + } ConfigTagList tags = ConfTags("uline"); for(ConfigIter i = tags.first; i != tags.second; ++i) { @@ -591,8 +591,6 @@ void ServerConfig::Read() } if (valid) { - ReadFile(MOTD, ConfValue("files")->getString("motd")); - ReadFile(RULES, ConfValue("files")->getString("rules")); DNSServer = ConfValue("dns")->getString("server"); FindDNS(DNSServer); } @@ -795,34 +793,6 @@ ConfigTagList ServerConfig::ConfTags(const std::string& tag) return config_data.equal_range(tag); } -/** Read the contents of a file located by `fname' into a file_cache pointed at by `F'. - */ -bool ServerConfig::ReadFile(file_cache &F, const std::string& fname) -{ - if (fname.empty()) - return false; - - char linebuf[MAXBUF]; - - F.clear(); - - FileWrapper file(fopen(fname.c_str(), "r")); - - if (!file) - return false; - while (!feof(file)) - { - if (fgets(linebuf, sizeof(linebuf), file)) - linebuf[strlen(linebuf)-1] = 0; - else - *linebuf = 0; - - F.push_back(*linebuf ? linebuf : " "); - } - - return true; -} - bool ServerConfig::FileExists(const char* file) { struct stat sb;