View Issue Details

IDProjectCategoryView StatusLast Update
0001741Anope Stable (2.0.x series)Generalpublic2020-11-05 12:44
Reporterivp Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0001741: Disable DROP command for regular users when external authentication is used
DescriptionWhen using external authentication such as m_sql_authentication, regular users shouldn't be allowed to use /msg NickServ DROP command.

Quick patch is attached. Should be extended to check if external authentication is used, or some setting should be added for module ns_drop to control this behavior:
https://wiki.anope.org/index.php/2.0/Modules/ns_drop
TagsNo tags attached.

Activities

ivp

2020-11-05 12:44

reporter  

ns_drop_patch.txt (1,651 bytes)   
--- old/modules/commands/ns_drop.cpp	2019-03-31 04:13:04.000000000 +0200
+++ new/modules/commands/ns_drop.cpp	2020-11-05 11:40:21.916326875 +0100
@@ -43,7 +43,7 @@
 			source.Reply(ACCESS_DENIED);
 		else if (Config->GetModule("nickserv")->Get<bool>("secureadmins", "yes") && !is_mine && na->nc->IsServicesOper())
 			source.Reply(_("You may not drop other Services Operators' nicknames."));
-		else
+		else if (source.IsServicesOper())
 		{
 			FOREACH_MOD(OnNickDrop, (source, na));

@@ -51,22 +51,25 @@
 			delete na;

 			source.Reply(_("Nickname \002%s\002 has been dropped."), nick.c_str());
-		}
+		} else { source.Reply(ACCESS_DENIED); }
 	}

 	bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
 	{
-		this->SendSyntax(source);
-		source.Reply(" ");
-		source.Reply(_("Drops the given nick from the database. Once your nickname\n"
+		if (source.IsServicesOper()) {
+			this->SendSyntax(source);
+			source.Reply(" ");
+			source.Reply(_("Drops the given nick from the database. Once your nickname\n"
 				"is dropped you may lose all of your access and channels that\n"
 				"you may own. Any other user will be able to gain control of\n"
 				"this nick."));
-		if (!source.HasPriv("nickserv/drop"))
-			source.Reply(_("You may drop any nick within your group."));
-		else
-			source.Reply(_("As a Services Operator, you may drop any nick."));
-
+			if (!source.HasPriv("nickserv/drop"))
+				source.Reply(_("You may drop any nick within your group."));
+			else
+				source.Reply(_("As a Services Operator, you may drop any nick."));
+		} else {
+			source.Reply(ACCESS_DENIED);
+		}
 		return true;
 	}
 };
ns_drop_patch.txt (1,651 bytes)   

Issue History

Date Modified Username Field Change
2020-11-05 12:44 ivp New Issue
2020-11-05 12:44 ivp File Added: ns_drop_patch.txt