From b4a39a0cf7f27c62cb4a262bafde405e917e2d02 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 5 Oct 2009 20:03:28 +0000 Subject: Deny TR_NICK mode changes with an invalid nick parameter git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11800 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/mode.cpp b/src/mode.cpp index 845473c95..069f2ea48 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -339,6 +339,12 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool return MODEACTION_DENY; } + if (mh->GetTranslateType() == TR_NICK && !ServerInstance->FindNick(parameter)) + { + user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameter.c_str()); + return MODEACTION_DENY; + } + /* Call the handler for the mode */ ModeAction ma = mh->OnModeChange(user, targetuser, chan, parameter, adding); -- cgit v1.2.3