Browse Source

* add 'state' jail option

master
Alex 'AdUser' Z 8 years ago
parent
commit
91b170a889
  1. 1
      configs/f2b.conf.in
  2. 8
      src/jail.c
  3. 1
      src/jail.h

1
configs/f2b.conf.in

@ -10,6 +10,7 @@ group = root
daemon = yes daemon = yes
[defaults] [defaults]
state = no
enabled = no enabled = no
bantime = 3600 bantime = 3600
findtime = 300 findtime = 300

8
src/jail.c

@ -113,6 +113,14 @@ f2b_jail_apply_config(f2b_jail_t *jail, f2b_config_section_t *section) {
f2b_jail_parse_compound_value(param->value, jail->backend_name, jail->backend_init); f2b_jail_parse_compound_value(param->value, jail->backend_name, jail->backend_init);
continue; continue;
} }
if (strcmp(param->name, "state") == 0) {
if (strcmp(param->value, "yes") == 0) {
jail->flags |= JAIL_HAS_STATE;
} else {
jail->flags &= ~JAIL_HAS_STATE;
}
continue;
}
if (f2b_jail_set_param(jail, param->name, param->value)) if (f2b_jail_set_param(jail, param->name, param->value))
continue; continue;
f2b_log_msg(log_warn, "jail '%s': unrecognized parameter: %s", jail->name, param->name); f2b_log_msg(log_warn, "jail '%s': unrecognized parameter: %s", jail->name, param->name);

1
src/jail.h

@ -21,6 +21,7 @@
/* jail flags */ /* jail flags */
#define JAIL_ENABLED 0x01 #define JAIL_ENABLED 0x01
#define JAIL_HAS_STATE 0x02
/** jail metadata struct */ /** jail metadata struct */
typedef struct f2b_jail_t { typedef struct f2b_jail_t {

Loading…
Cancel
Save