From 00b67a612e1c577e0e49c34b6c023e15be8dda3a Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 11 Jun 2012 15:04:29 +0200 Subject: m_spanningtree Disallow server passwords which contain a space char and those which begin with a colon Update links.conf.example --- src/modules/m_spanningtree/utils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/modules') 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 = "*"; -- cgit v1.2.3