diff options
author | Daniel De Graaf <danieldg@inspircd.org> | 2010-04-02 10:39:15 -0500 |
---|---|---|
committer | Daniel De Graaf <danieldg@inspircd.org> | 2010-04-02 10:39:15 -0500 |
commit | 3cf993500544c2157992650da2487bfa89be405d (patch) | |
tree | 6c90eba384e2361114752a28a166ef4d1fe6d80b /src/commands/cmd_kick.cpp | |
parent | cd6b7a8cda83f54679634624e84e92b91cf80683 (diff) |
Use FindNickOnly in a few commands to prevent enumerating users via UID walking
Diffstat (limited to 'src/commands/cmd_kick.cpp')
-rw-r--r-- | src/commands/cmd_kick.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/commands/cmd_kick.cpp b/src/commands/cmd_kick.cpp index 39e2c4433..ab346d395 100644 --- a/src/commands/cmd_kick.cpp +++ b/src/commands/cmd_kick.cpp @@ -40,11 +40,16 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User { std::string reason; Channel* c = ServerInstance->FindChan(parameters[0]); - User* u = ServerInstance->FindNick(parameters[1]); + User* u; if (ServerInstance->Parser->LoopCall(user, this, parameters, 1)) return CMD_SUCCESS; + if (IS_LOCAL(user)) + u = ServerInstance->FindNickOnly(parameters[1]); + else + u = ServerInstance->FindNick(parameters[1]); + if (!u || !c) { user->WriteServ( "401 %s %s :No such nick/channel", user->nick.c_str(), u ? parameters[0].c_str() : parameters[1].c_str()); |