From: Evan Hunt Date: Thu, 5 May 2011 20:04:24 +0000 (+0000) Subject: 3106. [func] When logging client requests, include the name of X-Git-Tag: v9.9.0a1~293 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=9eea4c5cbd864e0bc400dc665b35c3dbd00f9222;p=thirdparty%2Fbind9.git 3106. [func] When logging client requests, include the name of the TSIG key if any. [RT #23619] --- diff --git a/CHANGES b/CHANGES index 32adc012028..392b4ec6543 100644 --- a/CHANGES +++ b/CHANGES @@ -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] diff --git a/bin/named/client.c b/bin/named/client.c index 29ebeeec595..e4f5e0d73e7 100644 --- a/bin/named/client.c +++ b/bin/named/client.c @@ -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 @@ -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