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

index 7ffd241a4c9bae1d6d8e8086c4c4dc8bf582daa1..7974a79b37fe011170091768bedeb4ae3f8f0dee 100644 (file)
@@ -61,6 +61,8 @@ extern void **global_other_settings;
 
 extern const struct ip_addr *login_source_ips;
 extern unsigned int login_source_ips_idx, login_source_ips_count;
+extern struct event *event_auth;
+
 
 void login_refresh_proctitle(void);
 void login_client_destroyed(void);
index de0b2b099232990b0999faebdd5e9dd13386aa6f..2112e2052cd376b917ccccfc5e833129ae827f7e 100644 (file)
@@ -34,6 +34,11 @@ struct login_access_lookup {
        struct access_lookup *access;
 };
 
+struct event *event_auth;
+static struct event_category event_category_auth = {
+       .name = "auth",
+};
+
 const struct login_binary *login_binary;
 struct auth_client *auth_client;
 struct master_auth *master_auth;
@@ -451,6 +456,11 @@ static void main_init(const char *login_socket)
        /* make sure we can't fork() */
        restrict_process_count(1);
 
+       event_auth = event_create(NULL);
+       if (global_login_settings->auth_debug)
+               event_set_forced_debug(event_auth, TRUE);
+       event_add_category(event_auth, &event_category_auth);
+
        i_array_init(&global_alt_usernames, 4);
        master_service_set_avail_overflow_callback(master_service,
                                                   client_destroy_oldest);
@@ -488,6 +498,7 @@ static void main_deinit(void)
        client_common_deinit();
        dsasl_clients_deinit();
        login_settings_deinit();
+       event_unref(&event_auth);
 }
 
 int login_binary_run(const struct login_binary *binary,