diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-06-11 15:04:29 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-06-11 15:04:29 +0200 |
commit | 00b67a612e1c577e0e49c34b6c023e15be8dda3a (patch) | |
tree | 34a2aeca1cf48ede07b949430000f905f2a89c26 /src | |
parent | 31ec715931c72a902aeabb828a5d9a7a2563a8cc (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.cpp | 6 |
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 = "*"; |