summaryrefslogtreecommitdiff
path: root/modules/commands/cs_access.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-11-15 02:13:10 -0500
committerAdam <Adam@anope.org>2014-11-15 02:13:10 -0500
commitc9008cdafa37a76d2579a09d360b2fe008748a66 (patch)
tree84955c3ec9c0ed4d0c1c9ab62a2e05b36e85946a /modules/commands/cs_access.cpp
parent8a7793da0cc8331022775c381cd8e33be07fc2c9 (diff)
Fix access dup check to account for accounts
Diffstat (limited to 'modules/commands/cs_access.cpp')
-rw-r--r--modules/commands/cs_access.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp
index 7f7032bbe..7fef5bfc5 100644
--- a/modules/commands/cs_access.cpp
+++ b/modules/commands/cs_access.cpp
@@ -122,6 +122,7 @@ class CommandCSAccess : public Command
tmp_access.level = level;
bool override = false;
+ const NickAlias *na = NULL;
if ((!highest || *highest <= tmp_access) && !u_access.founder)
{
@@ -158,7 +159,8 @@ class CommandCSAccess : public Command
}
else
{
- const NickAlias *na = NickAlias::Find(mask);
+ na = NickAlias::Find(mask);
+
if (!na && Config->GetModule("chanserv")->Get<bool>("disallow_hostmask_access"))
{
source.Reply(_("Masks and unregistered users may not be on access lists."));
@@ -183,7 +185,7 @@ class CommandCSAccess : public Command
for (unsigned i = ci->GetAccessCount(); i > 0; --i)
{
const ChanAccess *access = ci->GetAccess(i - 1);
- if (mask.equals_ci(access->Mask()))
+ if ((na && na->nc == access->GetAccount()) || mask.equals_ci(access->Mask()))
{
/* Don't allow lowering from a level >= u_level */
if ((!highest || *access >= *highest) && !u_access.founder && !source.HasPriv("chanserv/access/modify"))