summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-18 20:03:28 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-18 20:03:28 +0000
commit6b5767fdd2f372ef5648f438dc68942f39658698 (patch)
treedc9965111f3ad96880748c47b35a241ee1eb2bd0 /src/modules/m_spanningtree.cpp
parentc88ed3a9f97fc4872842f4ad44ca9410c8f6b83c (diff)
Fixed spanningtree to not allow malformed conf tags (missing/empty values)
Added m_spanningtree, m_swhois and some clarifications to example conf git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2563 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 334310b8c..0f10b2de0 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -2139,8 +2139,16 @@ void ReadConfiguration(bool rebind)
L.RecvPass = Conf->ReadValue("link","recvpass",j);
L.AutoConnect = Conf->ReadInteger("link","autoconnect",j,true);
L.NextConnectTime = time(NULL) + L.AutoConnect;
- 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);
+ /* Bugfix by brain, do not allow people to enter bad configurations */
+ if ((recvpass != "") && (sendpass != "") && (Name != "") && (Port))
+ {
+ 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
+ {
+ log(DEFAULT,"m_spanningtree: Invalid configuration for server '%s', ignored!",L.Name.c_str());
+ }
}
delete Conf;
}