From ef7dc94f8891e1dba8ac3dcad5966d1025b6226a Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 17 Feb 2014 19:39:25 -0500 Subject: Move most of the implementation details out of os_forbid.h, fixes crashing if a module adding a forbid is unloaded without removing the forbid --- modules/database/db_old.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/database') diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index 8c322d02e..ddc488084 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -622,7 +622,7 @@ static void LoadNicks() if (!forbid) continue; - ForbidData *d = new ForbidData(); + ForbidData *d = forbid->CreateForbid(); d->mask = nc->display; d->creator = last_usermask; d->reason = last_realname; @@ -1031,7 +1031,7 @@ static void LoadChannels() if (!forbid) continue; - ForbidData *d = new ForbidData(); + ForbidData *d = forbid->CreateForbid(); d->mask = ci->name; d->creator = forbidby; d->reason = forbidreason; -- cgit From 928e2e1b7ccce8e05f7b15b2990490ee495e3c46 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 18 Feb 2014 12:57:31 -0500 Subject: Fix loading noexpire channels in db_old --- modules/database/db_old.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/database') diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index ddc488084..ebf29dea0 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -783,7 +783,7 @@ static void LoadChannels() if (tmpu32 & OLD_CI_SECURE) ci->Extend("CS_SECURE"); if (tmpu32 & OLD_CI_NO_EXPIRE) - ci->Extend("CI_NO_EXPIRE"); + ci->Extend("CS_NO_EXPIRE"); if (tmpu32 & OLD_CI_MEMO_HARDMAX) ci->Extend("MEMO_HARDMAX"); if (tmpu32 & OLD_CI_SECUREFOUNDER) -- cgit From 109d8f431f3d25d56570a6aaa1af957867bbb80e Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 18 Feb 2014 13:04:16 -0500 Subject: Do not import forbids with wildcards in their names, how 1.8 treats wildcaded forbids depends on the IRCd --- modules/database/db_old.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modules/database') diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index ebf29dea0..8fe57cfdd 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -620,7 +620,16 @@ static void LoadNicks() if (tmpu16 & OLD_NS_VERBOTEN) { if (!forbid) + { + delete nc; + continue; + } + + if (nc->display.find_first_of("?*") != Anope::string::npos) + { + delete nc; continue; + } ForbidData *d = forbid->CreateForbid(); d->mask = nc->display; @@ -1029,7 +1038,16 @@ static void LoadChannels() if (forbid_chan) { if (!forbid) + { + delete ci; + continue; + } + + if (ci->name.find_first_of("?*") != Anope::string::npos) + { + delete ci; continue; + } ForbidData *d = forbid->CreateForbid(); d->mask = ci->name; -- cgit