mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
Merge branch 'update-log-fix' into 'master'
make update_log() work if zone is not set See merge request isc-projects/bind9!831
This commit is contained in:
@@ -269,24 +269,34 @@ update_log(ns_client_t *client, dns_zone_t *zone,
|
|||||||
char namebuf[DNS_NAME_FORMATSIZE];
|
char namebuf[DNS_NAME_FORMATSIZE];
|
||||||
char classbuf[DNS_RDATACLASS_FORMATSIZE];
|
char classbuf[DNS_RDATACLASS_FORMATSIZE];
|
||||||
|
|
||||||
if (client == NULL || zone == NULL)
|
if (client == NULL) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isc_log_wouldlog(ns_lctx, level) == false)
|
if (isc_log_wouldlog(ns_lctx, level) == false) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
dns_name_format(dns_zone_getorigin(zone), namebuf,
|
|
||||||
sizeof(namebuf));
|
|
||||||
dns_rdataclass_format(dns_zone_getclass(zone), classbuf,
|
|
||||||
sizeof(classbuf));
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(message, sizeof(message), fmt, ap);
|
vsnprintf(message, sizeof(message), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
ns_client_log(client, NS_LOGCATEGORY_UPDATE, NS_LOGMODULE_UPDATE,
|
if (zone != NULL) {
|
||||||
|
dns_name_format(dns_zone_getorigin(zone), namebuf,
|
||||||
|
sizeof(namebuf));
|
||||||
|
dns_rdataclass_format(dns_zone_getclass(zone), classbuf,
|
||||||
|
sizeof(classbuf));
|
||||||
|
|
||||||
|
ns_client_log(client, NS_LOGCATEGORY_UPDATE,
|
||||||
|
NS_LOGMODULE_UPDATE,
|
||||||
level, "updating zone '%s/%s': %s",
|
level, "updating zone '%s/%s': %s",
|
||||||
namebuf, classbuf, message);
|
namebuf, classbuf, message);
|
||||||
|
} else {
|
||||||
|
ns_client_log(client, NS_LOGCATEGORY_UPDATE,
|
||||||
|
NS_LOGMODULE_UPDATE,
|
||||||
|
level, "%s", message);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user