]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Add global auth_event with category "auth".
authorSergey Kitov <sergey.kitov@open-xchange.com>
Mon, 19 Mar 2018 09:14:22 +0000 (11:14 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 7 Aug 2018 11:10:07 +0000 (14:10 +0300)
src/auth/auth-common.h
src/auth/auth.c

index 3cde62187f2082f6ecc3910e959316118dcb1238..5ebe8c489aa8037e631d82bb761854572d642feb 100644 (file)
@@ -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);
index f89494180657052cbb3b1d19d610ed2fd079bc2b..1f9a4b0b979bd89802510af022e56d305a5d41c7 100644 (file)
 #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)