summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-22 01:11:23 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-22 01:11:23 +0000
commit243d8c2907ed4767ad5aa770cee6771be0d9939f (patch)
tree65fc6de4d18ae7a7c9a047fecfd83f18b1926421 /src
parentf24230582ebed93c2e93f266e2407d30a628378d (diff)
Fix for bug #605 reported by MacGuyver, if a line is expired when we are adding another with the same hostmask, replace the existing line with the new one
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10589 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/addline.cpp2
-rw-r--r--src/xline.cpp11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/addline.cpp b/src/modules/m_spanningtree/addline.cpp
index 08f885797..e2f4002ce 100644
--- a/src/modules/m_spanningtree/addline.cpp
+++ b/src/modules/m_spanningtree/addline.cpp
@@ -58,7 +58,7 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque<std::string> &par
return true;
}
xl->SetCreateTime(atoi(params[3].c_str()));
- if (ServerInstance->XLines->AddLine(xl,NULL))
+ if (ServerInstance->XLines->AddLine(xl, NULL))
{
if (xl->duration)
{
diff --git a/src/xline.cpp b/src/xline.cpp
index 0c6965fe3..bc1cf9183 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -170,7 +170,16 @@ bool XLineManager::AddLine(XLine* line, User* user)
ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here?
if (DelLine(line->Displayable(), line->type, user, true))
- return false;
+ {
+ /* Line exists, check if its an expired line */
+ ContainerIter x = lookup_lines.find(line->type);
+ LookupIter i = x->second.find(line->Displayable());
+
+ if (i->second->duration && ServerInstance->Time() > i->second->expiry)
+ ExpireLine(x, i);
+ else
+ return false;
+ }
/*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/
XLineFactory* xlf = GetFactory(line->type);