Browse Source

* add deprecation warning for some jail opts

master
Alex 'AdUser' Z 4 years ago
parent
commit
3f46a685f0
  1. 19
      src/jail.c

19
src/jail.c

@ -31,6 +31,15 @@ static f2b_jail_t defaults = {
.maxretry = DEFAULT_MAXRETRY, .maxretry = DEFAULT_MAXRETRY,
}; };
static struct opt_remap {
const char *old;
const char *new;
} deprecated[] = {
{ .old = "incr_bantime", .new = "bantime_extend" },
{ .old = "incr_findtime", .new = "findtime_extend" },
{ .old = NULL } /* end of list */
};
void void
f2b_jail_parse_compound_value(const char *value, char *name, char *init) { f2b_jail_parse_compound_value(const char *value, char *name, char *init) {
size_t len = 0; size_t len = 0;
@ -108,6 +117,16 @@ f2b_jail_set_param(f2b_jail_t *jail, const char *param, const char *value) {
jail->findtime_extend = atof(value); jail->findtime_extend = atof(value);
return true; return true;
} }
if (strcmp(param, "expiretime_extend") == 0) {
jail->expiretime_extend = atof(value);
return true;
}
for (struct opt_remap *opt = deprecated; opt->old != NULL; opt++) {
if (strcmp(opt->old, param) != 0)
continue;
f2b_log_msg(log_warn, "jail '%s': param '%s' deprecated, use '%s' instead", jail->name, opt->old, opt->new);
return true;
}
return false; return false;
} }

Loading…
Cancel
Save