aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-08-31 16:39:22 +0000
committerGravatar brain2006-08-31 16:39:22 +0000
commita070983da5409d67bdd1294fce0f320a56c6b4fc (patch)
treea0c3ad756487a7a228551936a91d1ccbafd15f99 /src/modules/m_spanningtree.cpp
parentFix for parameters which contain a colon (which is not the first item in the... (diff)
Fix for bug#133 reported by insurgent: If you configure a link block to have the same name as the local server name, and connect to it and authenticate using that link block, InspIRCd will segfault.
(yeah, REALLY.) git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@5089 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 7a9594d56..3d06ffd71 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -2881,34 +2881,41 @@ void ReadConfiguration(bool rebind)
L.HiddenFromStats = Conf->ReadFlag("link","hidden",j);
L.NextConnectTime = time(NULL) + L.AutoConnect;
/* Bugfix by brain, do not allow people to enter bad configurations */
- if ((L.IPAddr != "") && (L.RecvPass != "") && (L.SendPass != "") && (L.Name != "") && (L.Port))
+ if (L.Name != Config->ServerName)
{
- LinkBlocks.push_back(L);
- log(DEBUG,"m_spanningtree: Read server %s with host %s:%d",L.Name.c_str(),L.IPAddr.c_str(),L.Port);
- }
- else
- {
- if (L.IPAddr == "")
- {
- log(DEFAULT,"Invalid configuration for server '%s', IP address not defined!",L.Name.c_str());
- }
- else if (L.RecvPass == "")
- {
- log(DEFAULT,"Invalid configuration for server '%s', recvpass not defined!",L.Name.c_str());
- }
- else if (L.SendPass == "")
- {
- log(DEFAULT,"Invalid configuration for server '%s', sendpass not defined!",L.Name.c_str());
- }
- else if (L.Name == "")
+ if ((L.IPAddr != "") && (L.RecvPass != "") && (L.SendPass != "") && (L.Name != "") && (L.Port))
{
- log(DEFAULT,"Invalid configuration, link tag without a name!");
+ LinkBlocks.push_back(L);
+ log(DEBUG,"m_spanningtree: Read server %s with host %s:%d",L.Name.c_str(),L.IPAddr.c_str(),L.Port);
}
- else if (!L.Port)
+ else
{
- log(DEFAULT,"Invalid configuration for server '%s', no port specified!",L.Name.c_str());
+ if (L.IPAddr == "")
+ {
+ log(DEFAULT,"Invalid configuration for server '%s', IP address not defined!",L.Name.c_str());
+ }
+ else if (L.RecvPass == "")
+ {
+ log(DEFAULT,"Invalid configuration for server '%s', recvpass not defined!",L.Name.c_str());
+ }
+ else if (L.SendPass == "")
+ {
+ log(DEFAULT,"Invalid configuration for server '%s', sendpass not defined!",L.Name.c_str());
+ }
+ else if (L.Name == "")
+ {
+ log(DEFAULT,"Invalid configuration, link tag without a name!");
+ }
+ else if (!L.Port)
+ {
+ log(DEFAULT,"Invalid configuration for server '%s', no port specified!",L.Name.c_str());
+ }
}
}
+ else
+ {
+ log(DEFAULT,"Invalid configuration for server '%s', You cannot configure a link block to have the same name as the local server!",L.Name.c_str());
+ }
}
delete Conf;
}