From: Sergey Kitov Date: Mon, 19 Mar 2018 09:14:22 +0000 (+0200) Subject: auth: Add global auth_event with category "auth". X-Git-Tag: 2.3.9~1770 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=105d8571483fad70d5223a3650fb1d9c32bfa7a4;p=thirdparty%2Fdovecot%2Fcore.git auth: Add global auth_event with category "auth". --- diff --git a/src/auth/auth-common.h b/src/auth/auth-common.h index 3cde62187f..5ebe8c489a 100644 --- a/src/auth/auth-common.h +++ b/src/auth/auth-common.h @@ -7,6 +7,8 @@ extern bool worker, worker_restart_request; extern time_t process_start_time; extern struct auth_penalty *auth_penalty; +extern struct event_category event_category_auth; +extern struct event *auth_event; void auth_refresh_proctitle(void); void auth_worker_refresh_proctitle(const char *state); diff --git a/src/auth/auth.c b/src/auth/auth.c index f894941806..1f9a4b0b97 100644 --- a/src/auth/auth.c +++ b/src/auth/auth.c @@ -11,6 +11,11 @@ #include "userdb-template.h" #include "auth.h" +struct event *auth_event; +struct event_category event_category_auth = { + .name = "auth", +}; + static const struct auth_userdb_settings userdb_dummy_set = { .name = "", .driver = "static", @@ -371,6 +376,10 @@ void auths_preinit(const struct auth_settings *set, pool_t pool, const char *not_service = NULL; bool check_default = TRUE; + auth_event = event_create(NULL); + if (set->debug) + event_set_forced_debug(auth_event, TRUE); + event_add_category(auth_event, &event_category_auth); i_array_init(&auths, 8); auth = auth_preinit(set, NULL, pool, reg); @@ -423,6 +432,7 @@ void auths_deinit(void) array_foreach(&auths, auth) auth_deinit(*auth); + event_unref(&auth_event); } void auths_free(void)