From ed961ced07f4505e94a03c26c50738c398f57167 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 1 Apr 2009 21:59:47 +0000 Subject: Add validation of parameters as a fix for bug #917, and add maxpara so that we don't need the : before the reason git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11278 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_jumpserver.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp index ad516328a..2fb509af1 100644 --- a/src/modules/m_jumpserver.cpp +++ b/src/modules/m_jumpserver.cpp @@ -27,10 +27,10 @@ class CommandJumpserver : public Command std::string reason; int port; - CommandJumpserver (InspIRCd* Instance) : Command(Instance, "JUMPSERVER", "o", 0) + CommandJumpserver (InspIRCd* Instance) : Command(Instance, "JUMPSERVER", "o", 0, 4) { this->source = "m_jumpserver.so"; - syntax = "[ <+/-a> :]"; + syntax = "[ <+/-an> ]"; redirect_to.clear(); reason.clear(); port = 0; @@ -80,9 +80,19 @@ class CommandJumpserver : public Command case 'n': redirect_new_users = direction; break; + default: + user->WriteServ("NOTICE %s :*** Invalid JUMPSERVER flag: %c", user->nick.c_str(), *n); + return CMD_FAILURE; + break; } } + if (!atoi(parameters[1].c_str())) + { + user->WriteServ("NOTICE %s :*** Invalid port number", user->nick.c_str()); + return CMD_FAILURE; + } + if (redirect_all_immediately) { /* Redirect everyone but the oper sending the command */ -- cgit v1.2.3