3106. [func] When logging client requests, include the name of

the TSIG key if any. [RT #23619]
This commit is contained in:
Evan Hunt
2011-05-05 20:04:24 +00:00
parent e993d64530
commit 9eea4c5cbd
2 changed files with 20 additions and 6 deletions
+3
View File
@@ -1,3 +1,6 @@
3106. [func] When logging client requests, include the name of
the TSIG key if any. [RT #23619]
3105. [bug] GOST support can be suppressed by "configure
--without-gost" [RT #24367]
+17 -6
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: client.c,v 1.271 2011/01/11 23:47:12 tbox Exp $ */
/* $Id: client.c,v 1.272 2011/05/05 20:04:24 each Exp $ */
#include <config.h>
@@ -2682,19 +2682,30 @@ ns_client_logv(ns_client_t *client, isc_logcategory_t *category,
{
char msgbuf[2048];
char peerbuf[ISC_SOCKADDR_FORMATSIZE];
const char *name = "";
const char *sep = "";
char signerbuf[DNS_NAME_FORMATSIZE];
const char *viewname = "";
const char *sep1 = "", *sep2 = "";
const char *signer = "";
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
ns_client_name(client, peerbuf, sizeof(peerbuf));
if (client->signer != NULL) {
dns_name_format(client->signer, signerbuf, sizeof(signerbuf));
sep1 = "/key ";
signer = signerbuf;
}
if (client->view != NULL && strcmp(client->view->name, "_bind") != 0 &&
strcmp(client->view->name, "_default") != 0) {
name = client->view->name;
sep = ": view ";
sep2 = ": view ";
viewname = client->view->name;
}
isc_log_write(ns_g_lctx, category, module, level,
"client %s%s%s: %s", peerbuf, sep, name, msgbuf);
"client %s%s%s%s%s: %s",
peerbuf, sep1, signer, sep2, viewname, msgbuf);
}
void