diff options
-rw-r--r-- | modules/commands/cs_access.cpp | 6 | ||||
-rw-r--r-- | modules/commands/cs_flags.cpp | 5 | ||||
-rw-r--r-- | modules/commands/cs_xop.cpp | 5 |
3 files changed, 10 insertions, 6 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")) diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 1d861b883..8d66ec5a3 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -88,6 +88,7 @@ class CommandCSFlags : public Command AccessGroup u_access = source.AccessFor(ci); const ChanAccess *highest = u_access.Highest(); + const NickAlias *na = NULL; if (IRCD->IsChannelValid(mask)) { @@ -113,7 +114,7 @@ class CommandCSFlags : 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.")); @@ -142,7 +143,7 @@ class CommandCSFlags : public Command for (current_idx = ci->GetAccessCount(); current_idx > 0; --current_idx) { ChanAccess *access = ci->GetAccess(current_idx - 1); - if (mask.equals_ci(access->Mask())) + if ((na && na->nc == access->GetAccount()) || mask.equals_ci(access->Mask())) { // Flags allows removing others that have the same access as you, // but no other access system does. diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 9524446ea..0839804bf 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -120,6 +120,7 @@ class CommandCSXOP : public Command AccessGroup access = source.AccessFor(ci); const ChanAccess *highest = access.Highest(); bool override = false; + const NickAlias *na = NULL; std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.command.upper()), access_it = highest ? std::find(order.begin(), order.end(), XOPChanAccess::DetermineLevel(highest)) : order.end(); @@ -159,7 +160,7 @@ class CommandCSXOP : 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.")); @@ -185,7 +186,7 @@ class CommandCSXOP : public Command { const ChanAccess *a = ci->GetAccess(i); - if (a->Mask().equals_ci(mask)) + if ((na && na->nc == a->GetAccount()) || mask.equals_ci(a->Mask())) { if ((!highest || *a >= *highest) && !access.founder && !source.HasPriv("chanserv/access/modify")) { |