diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-20 16:37:20 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-20 16:37:20 +0000 |
commit | 4a957fc28b7481a88e8276a2658dd39fc73ad41d (patch) | |
tree | dfc9f0aa437dc7c4a5a4d3430393f9d018cca44c | |
parent | 36f4ce90504494b12b03e389978b7363b9ebc245 (diff) |
Prevent user from squitting server from itself using squit * (!)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2588 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_spanningtree.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 5df518ab1..2bb4456ce 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -294,17 +294,17 @@ class TreeServer std::string GetName() { - return this->ServerName; + return ServerName; } std::string GetDesc() { - return this->ServerDesc; + return ServerDesc; } std::string GetVersion() { - return this->VersionString; + return VersionString; } void SetNextPingTime(time_t t) @@ -315,7 +315,7 @@ class TreeServer time_t NextPingTime() { - return this->NextPing; + return NextPing; } bool AnsweredLastPing() @@ -330,22 +330,22 @@ class TreeServer int GetUserCount() { - return this->UserCount; + return UserCount; } int GetOperCount() { - return this->OperCount; + return OperCount; } TreeSocket* GetSocket() { - return this->Socket; + return Socket; } TreeServer* GetParent() { - return this->Parent; + return Parent; } void SetVersion(std::string Version) @@ -2419,9 +2419,15 @@ class ModuleSpanningTree : public Module TreeServer* s = FindServerMask(parameters[0]); if (s) { + if (s == TreeRoot) + { + WriteServ(user->fd,"NOTICE %s :*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)",user->nick,parameters[0]); + return 1; + } TreeSocket* sock = s->GetSocket(); if (sock) { + log(DEBUG,"Splitting server %s",s->GetName().c_str()); WriteOpers("*** SQUIT: Server \002%s\002 removed from network by %s",parameters[0],user->nick); sock->Squit(s,"Server quit by "+std::string(user->nick)+"!"+std::string(user->ident)+"@"+std::string(user->host)); sock->Close(); |