]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Prefix log messages with username during auth/post-login lookups.
authorTimo Sirainen <tss@iki.fi>
Thu, 12 Aug 2010 14:43:08 +0000 (15:43 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 12 Aug 2010 14:43:08 +0000 (15:43 +0100)
src/lib-master/master-login.c

index e898d6ad2587fa2613855d32008e99d855db0479..c7159483455adf3f7ad95936debb69b0bc5a0ae1 100644 (file)
@@ -178,6 +178,10 @@ static void master_login_client_free(struct master_login_client **_client)
        if (client->fd != -1) {
                if (close(client->fd) < 0)
                        i_error("close(fd_read client) failed: %m");
+               /* this client failed (login callback wasn't called).
+                  reset prefix to default. */
+               i_set_failure_prefix(t_strdup_printf("%s: ",
+                       client->conn->login->service->name));
        }
 
        /* FIXME: currently we create a separate connection for each request,
@@ -363,6 +367,8 @@ master_login_auth_callback(const char *const *auth_args, const char *errormsg,
                master_login_client_free(&client);
                return;
        }
+       i_set_failure_prefix(t_strdup_printf("%s(%s): ",
+               client->conn->login->service->name, auth_args[0]));
 
        if (conn->login->postlogin_socket_path == NULL)
                master_login_auth_finish(client, auth_args);