diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-04-01 21:59:47 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-04-01 21:59:47 +0000 |
commit | ed961ced07f4505e94a03c26c50738c398f57167 (patch) | |
tree | 411482325d454dcb87fb87e5cd3eefab954f6744 /src/modules | |
parent | 8b01909f73123afafa451c17740df993902b7db4 (diff) |
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
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_jumpserver.cpp | 14 |
1 files 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 = "[<server> <port> <+/-a> :<reason>]"; + syntax = "[<server> <port> <+/-an> <reason>]"; 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 */ |