Browse Source

* initiate statefile save on manual ban also

master
Alex 'AdUser' Z 8 years ago
parent
commit
10a50a288a
  1. 3
      src/jail.c

3
src/jail.c

@ -149,6 +149,7 @@ f2b_jail_ban(f2b_jail_t *jail, f2b_ipaddr_t *addr) {
addr->matches.used = 0; addr->matches.used = 0;
addr->banned = true; addr->banned = true;
addr->banned_at = addr->lastseen; addr->banned_at = addr->lastseen;
if (jail->incr_bantime > 0) { if (jail->incr_bantime > 0) {
bantime = jail->bantime + (int) (addr->bancount * (jail->bantime * jail->incr_bantime)); bantime = jail->bantime + (int) (addr->bancount * (jail->bantime * jail->incr_bantime));
} else { } else {
@ -550,6 +551,8 @@ f2b_jail_cmd_ip_xxx(char *res, size_t ressize, f2b_jail_t *jail, int op, const c
addr->lastseen = now; addr->lastseen = now;
f2b_matches_append(&addr->matches, now); f2b_matches_append(&addr->matches, now);
jail->ipaddrs = f2b_addrlist_append(jail->ipaddrs, addr); jail->ipaddrs = f2b_addrlist_append(jail->ipaddrs, addr);
if (jail->flags & JAIL_HAS_STATE)
jail->sfile->need_save = true;
} else { } else {
/* unban & status */ /* unban & status */
snprintf(res, ressize, "can't find ip '%s' in jail '%s'", ip, jail->name); snprintf(res, ressize, "can't find ip '%s' in jail '%s'", ip, jail->name);

Loading…
Cancel
Save