From 6b5767fdd2f372ef5648f438dc68942f39658698 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 Dec 2005 20:03:28 +0000 Subject: 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 --- src/modules/m_spanningtree.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3