summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-06-11 15:04:29 +0200
committerattilamolnar <attilamolnar@hush.com>2012-06-11 15:04:29 +0200
commit00b67a612e1c577e0e49c34b6c023e15be8dda3a (patch)
tree34a2aeca1cf48ede07b949430000f905f2a89c26 /src
parent31ec715931c72a902aeabb828a5d9a7a2563a8cc (diff)
m_spanningtree Disallow server passwords which contain a space char and those which begin with a colon
Update links.conf.example
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/utils.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index 5765b8752..75d4eaca3 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -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 = "*";