]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login_log_format_elements: Added %{listener} variable to expand to the listener socke...
authorTimo Sirainen <tss@iki.fi>
Tue, 25 Aug 2015 20:12:51 +0000 (23:12 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 25 Aug 2015 20:12:51 +0000 (23:12 +0300)
src/login-common/client-common.c
src/login-common/client-common.h

index ed407ccaa13367309d45e83172a8174ca1d08fea..ed3a35a17a7abba0824c7076f34798009275dde2 100644 (file)
@@ -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;
 }
 
index 21c5cab54715f1be913486ab90bda1c3663da2e8..d19b10be812a373a350636203b0aceb2d144165a 100644 (file)
@@ -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;