From 69a0f3bec2cfed1436385a41fe73b2a95f5bf64a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 12 Oct 2023 19:09:44 +0100 Subject: Fix removing entries by an alias in chanserv/access and chanserv/xop. --- modules/commands/cs_access.cpp | 7 ++++++- modules/commands/cs_xop.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'modules/commands') diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 1a6c93514..cab343057 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -229,7 +229,12 @@ class CommandCSAccess : public Command { Anope::string mask = params[2]; - if (!isdigit(mask[0]) && mask.find_first_of("#!*@") == Anope::string::npos && !NickAlias::Find(mask)) + const NickAlias *na = NickAlias::Find(mask); + if (na && na->nc) + { + mask = na->nc->display; + } + else if (!isdigit(mask[0]) && mask.find_first_of("#!*@") == Anope::string::npos) { User *targ = User::Find(mask, true); if (targ != NULL) diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 33b2f564e..e2a1994e8 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -246,7 +246,12 @@ class CommandCSXOP : public Command const ChanAccess *highest = access.Highest(); bool override = false; - if (!isdigit(mask[0]) && mask.find_first_of("#!*@") == Anope::string::npos && !NickAlias::Find(mask)) + const NickAlias *na = NickAlias::Find(mask); + if (na && na->nc) + { + mask = na->nc->display; + } + else if (!isdigit(mask[0]) && mask.find_first_of("#!*@") == Anope::string::npos) { User *targ = User::Find(mask, true); if (targ != NULL) -- cgit From 02940e4ea810f2fa634f5a783f5ed966b936d6f4 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 20 Oct 2023 18:08:49 +0100 Subject: Fix a misleading temporary variable in ns_register. --- modules/commands/ns_register.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/commands') diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index bd188637c..d38b07bc6 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -25,13 +25,12 @@ class CommandNSConfirm : public Command void Execute(CommandSource &source, const std::vector ¶ms) anope_override { - const Anope::string &passcode = params[0]; - if (source.nc && (!source.nc->HasExt("UNCONFIRMED") || source.IsOper()) && source.HasPriv("nickserv/confirm")) { - NickAlias *na = NickAlias::Find(passcode); + const Anope::string &nick = params[0]; + NickAlias *na = NickAlias::Find(nick); if (na == NULL) - source.Reply(NICK_X_NOT_REGISTERED, passcode.c_str()); + source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); else if (na->nc->HasExt("UNCONFIRMED") == false) source.Reply(_("Nick \002%s\002 is already confirmed."), na->nick.c_str()); else @@ -58,6 +57,7 @@ class CommandNSConfirm : public Command } else if (source.nc) { + const Anope::string &passcode = params[0]; Anope::string *code = source.nc->GetExt("passcode"); if (code != NULL && *code == passcode) { -- cgit From 97fa6d84bcb70b3b87d3fd7cc14f3b2567ca4e11 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 20 Oct 2023 18:32:57 +0100 Subject: Fix confirming an unconfirmed operator's account. --- modules/commands/ns_register.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/commands') diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index d38b07bc6..db606cb5b 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -25,7 +25,10 @@ class CommandNSConfirm : public Command void Execute(CommandSource &source, const std::vector ¶ms) anope_override { - if (source.nc && (!source.nc->HasExt("UNCONFIRMED") || source.IsOper()) && source.HasPriv("nickserv/confirm")) + Anope::string *code = source.nc ? source.nc->GetExt("passcode") : NULL; + bool confirming_other = !code || *code != params[0]; + + if (source.nc && (!source.nc->HasExt("UNCONFIRMED") || (source.IsOper() && confirming_other)) && source.HasPriv("nickserv/confirm")) { const Anope::string &nick = params[0]; NickAlias *na = NickAlias::Find(nick); @@ -58,7 +61,6 @@ class CommandNSConfirm : public Command else if (source.nc) { const Anope::string &passcode = params[0]; - Anope::string *code = source.nc->GetExt("passcode"); if (code != NULL && *code == passcode) { NickCore *nc = source.nc; -- cgit