diff options
author | dz <dz@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-14 15:12:36 +0000 |
---|---|---|
committer | dz <dz@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-14 15:12:36 +0000 |
commit | 3c758944a930726fd269542d87e8de44ac1cdace (patch) | |
tree | 9f868fcfc4c37dc811d600b9758f8262ad8ee839 /src/commands/cmd_zline.cpp | |
parent | 976bf3c16569cd419ad79dcbfcc0f0e904761825 (diff) |
Strip a zline target of anything resembling an ident prior to sanity checking rather than after, fixes bug #766 reported by Taros
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11220 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands/cmd_zline.cpp')
-rw-r--r-- | src/commands/cmd_zline.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index b0df24a95..fa54590e2 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -41,27 +41,20 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User target = u->GetIPString(); } - if (ServerInstance->IPMatchesEveryone(target.c_str(),user)) - return CMD_FAILURE; - - long duration = ServerInstance->Duration(parameters[1].c_str()); - const char* ipaddr = target.c_str(); - User* find = ServerInstance->FindNick(target.c_str()); - if (find) - { - ipaddr = find->GetIPString(); - } - else + if (strchr(ipaddr,'@')) { - if (strchr(ipaddr,'@')) - { - while (*ipaddr != '@') - ipaddr++; + while (*ipaddr != '@') ipaddr++; - } + ipaddr++; } + + if (ServerInstance->IPMatchesEveryone(ipaddr,user)) + return CMD_FAILURE; + + long duration = ServerInstance->Duration(parameters[1].c_str()); + ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ipaddr); if (ServerInstance->XLines->AddLine(zl,user)) { |