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 | |
parent | 31ec715931c72a902aeabb828a5d9a7a2563a8cc (diff) |
m_spanningtree Disallow server passwords which contain a space char and those which begin with a colon
Update links.conf.example
-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 = "*"; |