diff options
Diffstat (limited to 'src/config.cpp')
-rw-r--r-- | src/config.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/config.cpp b/src/config.cpp index 5d20caf82..03ee9feb6 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -157,7 +157,13 @@ Conf::Conf() : Block("") Block *serverinfo = this->GetBlock("serverinfo"), *options = this->GetBlock("options"), *mail = this->GetBlock("mail"), *networkinfo = this->GetBlock("networkinfo"); - ValidateNotEmpty("serverinfo", "name", serverinfo->Get<const Anope::string>("name")); + const Anope::string &servername = serverinfo->Get<Anope::string>("name"); + + ValidateNotEmpty("serverinfo", "name", servername); + + if (servername.find(' ') != Anope::string::npos || servername.find('.') == Anope::string::npos) + throw ConfigException("serverinfo:name is not a valid server name"); + ValidateNotEmpty("serverinfo", "description", serverinfo->Get<const Anope::string>("description")); ValidateNotEmpty("serverinfo", "pid", serverinfo->Get<const Anope::string>("pid")); ValidateNotEmpty("serverinfo", "motd", serverinfo->Get<const Anope::string>("motd")); @@ -205,6 +211,9 @@ Conf::Conf() : Block("") ValidateNotZero("uplink", "port", port); ValidateNotEmpty("uplink", "password", password); + if (password.find(' ') != Anope::string::npos || password[0] == ':') + throw ConfigException("uplink:password is not valid"); + this->Uplinks.push_back(Uplink(host, port, password, ipv6)); } |