From: Timo Sirainen Date: Thu, 12 Aug 2010 14:43:08 +0000 (+0100) Subject: lib-master: Prefix log messages with username during auth/post-login lookups. X-Git-Tag: 2.0.rc6~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a7bbdb8faa0dd2c4e9bb094e06fe705856e39cbf;p=thirdparty%2Fdovecot%2Fcore.git lib-master: Prefix log messages with username during auth/post-login lookups. --- diff --git a/src/lib-master/master-login.c b/src/lib-master/master-login.c index e898d6ad25..c715948345 100644 --- a/src/lib-master/master-login.c +++ b/src/lib-master/master-login.c @@ -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);