From: Timo Sirainen Date: Tue, 25 Aug 2015 20:12:51 +0000 (+0300) Subject: login_log_format_elements: Added %{listener} variable to expand to the listener socke... X-Git-Tag: 2.2.19.rc1~184 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c12d96f12cac9af464ab2e59046bd59b0c06b4ea;p=thirdparty%2Fdovecot%2Fcore.git login_log_format_elements: Added %{listener} variable to expand to the listener socket name. --- diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c index ed407ccaa1..ed3a35a17a 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -136,7 +136,8 @@ client_create(int fd, bool ssl, pool_t pool, client->real_local_ip = conn->real_local_ip; client->real_local_port = conn->real_local_port; client->real_remote_ip = conn->real_remote_ip; - client->real_remote_port = conn->real_remote_port; + client->real_remote_port = conn->real_remote_port; + client->listener_name = p_strdup(client->pool, conn->name); client->trusted = client_is_trusted(client); client->secured = ssl || client->trusted || @@ -492,6 +493,7 @@ static struct var_expand_table login_var_expand_empty_tab[] = { { '\0', NULL, "auth_user" }, { '\0', NULL, "auth_username" }, { '\0', NULL, "auth_domain" }, + { '\0', NULL, "listener" }, { '\0', NULL, NULL } }; @@ -565,6 +567,7 @@ get_var_expand_table(struct client *client) tab[23].value = tab[20].value; tab[24].value = tab[21].value; } + tab[25].value = client->listener_name; return tab; } diff --git a/src/login-common/client-common.h b/src/login-common/client-common.h index 21c5cab547..d19b10be81 100644 --- a/src/login-common/client-common.h +++ b/src/login-common/client-common.h @@ -113,7 +113,7 @@ struct client { struct ssl_proxy *ssl_proxy; const struct login_settings *set; const struct master_service_ssl_settings *ssl_set; - const char *session_id; + const char *session_id, *listener_name; int fd; struct istream *input;