diff options
author | Adam <Adam@anope.org> | 2013-09-21 11:21:38 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-09-27 19:11:02 -0400 |
commit | df3c0b7b52066698a97b34edf5352cf344e991ac (patch) | |
tree | fb3f2384e8863e9fcb86581ed56516b4c2233b48 /modules/commands/bs_set.cpp | |
parent | 45702992ac8c0d36bd0a7eba1580d9cf8a364d74 (diff) |
Fix various commands to properly report a given expiry time is invalid
Diffstat (limited to 'modules/commands/bs_set.cpp')
-rw-r--r-- | modules/commands/bs_set.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 49ebfa360..1e320be40 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -104,7 +104,21 @@ class CommandBSSetBanExpire : public Command return; } - ci->banexpire = Anope::DoTime(arg); + time_t t = Anope::DoTime(arg); + if (t == -1) + { + source.Reply(BAD_EXPIRY_TIME); + return; + } + + /* cap at 1 day */ + if (t > 86400) + { + source.Reply(_("Ban expiry may not be longer than 1 day.")); + return; + } + + ci->banexpire = t; bool override = !access.HasPriv("SET"); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to change banexpire to " << ci->banexpire; |