Skip to content

Commit

Permalink
login-common: Add global event_auth with "auth" category.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey-Kitov authored and cmouse committed Aug 7, 2018
1 parent c99dc72 commit c903a54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/login-common/login-common.h
Expand Up @@ -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);
Expand Down
11 changes: 11 additions & 0 deletions src/login-common/main.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c903a54

Please sign in to comment.