diff options
-rw-r--r-- | docs/links.conf.example | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/links.conf.example b/docs/links.conf.example index a573b66da..94340cd31 100644 --- a/docs/links.conf.example +++ b/docs/links.conf.example @@ -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"> 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 = "*"; |