2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

2213. [bug] SIG0 diagnostic failure messages were looking at the

wrong status code. [RT #17101]
This commit is contained in:
Mark Andrews 2007-08-22 00:42:42 +00:00
parent 69eb0e5d05
commit c0720b90ed
2 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,6 @@
2213. [bug] SIG0 diagnostic failure messages were looking at the
wrong status code. [RT #17101]
2212. [func] 'host -m' now causes memory statistics and active
memory to be printed at exit. [RT 17028]

View File

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: client.c,v 1.248 2007/06/26 02:52:15 marka Exp $ */
/* $Id: client.c,v 1.249 2007/08/22 00:42:42 marka Exp $ */
#include <config.h>
@ -1674,16 +1674,19 @@ client_request(isc_task_t *task, isc_event_t *event) {
char tsigrcode[64];
isc_buffer_t b;
dns_name_t *name = NULL;
dns_rcode_t status;
isc_result_t tresult;
isc_buffer_init(&b, tsigrcode, sizeof(tsigrcode) - 1);
RUNTIME_CHECK(dns_tsigrcode_totext(client->message->tsigstatus,
&b) == ISC_R_SUCCESS);
tsigrcode[isc_buffer_usedlength(&b)] = '\0';
/* There is a signature, but it is bad. */
if (dns_message_gettsig(client->message, &name) != NULL) {
char namebuf[DNS_NAME_FORMATSIZE];
char cnamebuf[DNS_NAME_FORMATSIZE];
dns_name_format(name, namebuf, sizeof(namebuf));
status = client->message->tsigstatus;
isc_buffer_init(&b, tsigrcode, sizeof(tsigrcode) - 1);
tresult = dns_tsigrcode_totext(status, &b);
INSIST(tresult == ISC_R_SUCCESS);
tsigrcode[isc_buffer_usedlength(&b)] = '\0';
if (client->message->tsigkey->generated) {
dns_name_format(client->message->tsigkey->creator,
cnamebuf, sizeof(cnamebuf));
@ -1705,6 +1708,11 @@ client_request(isc_task_t *task, isc_event_t *event) {
tsigrcode);
}
} else {
status = client->message->sig0status;
isc_buffer_init(&b, tsigrcode, sizeof(tsigrcode) - 1);
tresult = dns_tsigrcode_totext(status, &b);
INSIST(tresult == ISC_R_SUCCESS);
tsigrcode[isc_buffer_usedlength(&b)] = '\0';
ns_client_log(client, DNS_LOGCATEGORY_SECURITY,
NS_LOGMODULE_CLIENT, ISC_LOG_ERROR,
"request has invalid signature: %s (%s)",