diff --git a/src/jail.c b/src/jail.c index 833f420..125b39f 100644 --- a/src/jail.c +++ b/src/jail.c @@ -189,6 +189,17 @@ f2b_jail_create(f2b_config_section_t *section) { return jail; } +f2b_jail_t * +f2b_jail_find(f2b_jail_t *list, const char *name) { + assert(name != NULL); + + for (; list != NULL; list = list->next) + if (strcmp(list->name, name) == 0) + return list; + + return NULL; +} + size_t f2b_jail_process(f2b_jail_t *jail) { f2b_logfile_t *file = NULL; diff --git a/src/jail.h b/src/jail.h index a07aff2..f54936f 100644 --- a/src/jail.h +++ b/src/jail.h @@ -43,6 +43,7 @@ typedef struct f2b_jail_t { void f2b_jail_parse_compound_value(const char *value, char *name, char *init); f2b_jail_t *f2b_jail_create (f2b_config_section_t *section); +f2b_jail_t *f2b_jail_find (f2b_jail_t *list, const char *name); void f2b_jail_set_defaults(f2b_config_section_t *section); bool f2b_jail_init (f2b_jail_t *jail, f2b_config_t *config);