Browse Source

* check calls to "jail * filter *" commands

master
Alex 'AdUser' Z 4 years ago
parent
commit
53c41f6253
  1. 8
      src/daemon.c

8
src/daemon.c

@ -147,11 +147,19 @@ f2b_csocket_cmd_process(const f2b_cmd_t *cmd, f2b_buf_t *res) {
f2b_source_cmd_stats(buf, sizeof(buf), jail->source); f2b_source_cmd_stats(buf, sizeof(buf), jail->source);
f2b_buf_append(res, buf, 0); f2b_buf_append(res, buf, 0);
} else if (cmd->type == CMD_JAIL_FILTER_STATS) { } else if (cmd->type == CMD_JAIL_FILTER_STATS) {
if (jail->flags & JAIL_HAS_FILTER) {
f2b_filter_cmd_stats(buf, sizeof(buf), jail->filter); f2b_filter_cmd_stats(buf, sizeof(buf), jail->filter);
f2b_buf_append(res, buf, 0); f2b_buf_append(res, buf, 0);
} else {
f2b_buf_append(res, "this jail has no filter\n", 0);
}
} else if (cmd->type == CMD_JAIL_FILTER_RELOAD) { } else if (cmd->type == CMD_JAIL_FILTER_RELOAD) {
if (jail->flags & JAIL_HAS_FILTER) {
f2b_filter_cmd_reload(buf, sizeof(buf), jail->filter); f2b_filter_cmd_reload(buf, sizeof(buf), jail->filter);
f2b_buf_append(res, buf, 0); f2b_buf_append(res, buf, 0);
} else {
f2b_buf_append(res, "this jail has no filter\n", 0);
}
} else { } else {
f2b_buf_append(res, "error: unknown command\n", 0); f2b_buf_append(res, "error: unknown command\n", 0);
} }

Loading…
Cancel
Save