From: attilamolnar Date: Mon, 11 Jun 2012 13:04:29 +0000 (+0200) Subject: m_spanningtree Disallow server passwords which contain a space char and those which... X-Git-Tag: v2.0.23~715 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=00b67a612e1c577e0e49c34b6c023e15be8dda3a;p=user%2Fhenk%2Fcode%2Finspircd.git m_spanningtree Disallow server passwords which contain a space char and those which begin with a colon Update links.conf.example --- 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 = "*";