1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 11:46:37 +02:00

Fix various commands to properly report a given expiry time is invalid

This commit is contained in:
Adam
2013-09-21 11:21:38 -04:00
parent 45702992ac
commit df3c0b7b52
7 changed files with 47 additions and 6 deletions
+15 -1
View File
@@ -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;