]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Disallow server passwords which contain a space char and those which...
authorattilamolnar <attilamolnar@hush.com>
Mon, 11 Jun 2012 13:04:29 +0000 (15:04 +0200)
committerattilamolnar <attilamolnar@hush.com>
Mon, 11 Jun 2012 13:04:29 +0000 (15:04 +0200)
Update links.conf.example

docs/links.conf.example
src/modules/m_spanningtree/utils.cpp

index a573b66da99de1e649919280625a6b4f07576dfb..94340cd31d4e62a616bb6cc36b9367b862a492cc 100644 (file)
@@ -65,6 +65,8 @@
 
       # passwords: the passwords we send and receive.
       # The remote server will have these passwords reversed.
+      # Passwords that contain a space character or begin with
+      # a colon (:) are invalid and may not be used.
       sendpass="outgoing!password"
       recvpass="incoming!password">
 
index 5765b87524a2f5401356c1e59a4ac52e4ebf6af0..75d4eaca3a7fea125317997e2ba732bcea8ac8a7 100644 (file)
@@ -402,6 +402,12 @@ void SpanningTreeUtilities::ReadConfiguration()
                if (L->SendPass.empty())
                        throw ModuleException("Invalid configuration for server '"+assign(L->Name)+"', sendpass not defined");
 
+               if ((L->SendPass.find(' ') != std::string::npos) || (L->RecvPass.find(' ') != std::string::npos))
+                       throw ModuleException("Link block '" + assign(L->Name) + "' has a password set that contains a space character which is invalid");
+
+               if ((L->SendPass[0] == ':') || (L->RecvPass[0] == ':'))
+                       throw ModuleException("Link block '" + assign(L->Name) + "' has a password set that begins with a colon (:) which is invalid");
+
                if (L->IPAddr.empty())
                {
                        L->IPAddr = "*";