mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
[master] truncate logged rdata if too long
3490. [bug] When logging RDATA during update, truncate if it's too long. [RT #32365] cherry picked from: commit 16ddb566e5a5b57bf925adef2b5543dddc1de49b commit cd97e0c23b09f38aac49aabab66ee13c68b7a3f3 commit d087fa982649c081d58c5bb16e63da3428e2b89d commit d0795bdffef57612dd7654ffd09c9f4216eee2c8
This commit is contained in:
5
CHANGES
5
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
3490. [bug] When logging RDATA during update, truncate if it's
|
||||||
|
too long. [RT #32365]
|
||||||
|
|
||||||
3489. [bug] --enable-developer now turns on ISC_LIST_CHECKINIT.
|
3489. [bug] --enable-developer now turns on ISC_LIST_CHECKINIT.
|
||||||
dns_dlzcreate() failed to properly initialize
|
dns_dlzcreate() failed to properly initialize
|
||||||
dlzdb.link. When cloning a rdataset do not copy
|
dlzdb.link. When cloning a rdataset do not copy
|
||||||
@@ -79,7 +82,7 @@
|
|||||||
3464. [maint] Updates to PKCS#11 openssl patches, supporting
|
3464. [maint] Updates to PKCS#11 openssl patches, supporting
|
||||||
versions 0.9.8x, 1.0.0j, 1.0.1c [RT #29749]
|
versions 0.9.8x, 1.0.0j, 1.0.1c [RT #29749]
|
||||||
|
|
||||||
3463. [doc] Clarify managed-keys syntax in ARM. [RT 32232]
|
3463. [doc] Clarify managed-keys syntax in ARM. [RT #32232]
|
||||||
|
|
||||||
3462. [doc] Clarify server selection behavior of dig when using
|
3462. [doc] Clarify server selection behavior of dig when using
|
||||||
-4 or -6 options. [RT #32181]
|
-4 or -6 options. [RT #32181]
|
||||||
|
@@ -2808,7 +2808,7 @@ void
|
|||||||
ns_client_logv(ns_client_t *client, isc_logcategory_t *category,
|
ns_client_logv(ns_client_t *client, isc_logcategory_t *category,
|
||||||
isc_logmodule_t *module, int level, const char *fmt, va_list ap)
|
isc_logmodule_t *module, int level, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
char msgbuf[2048];
|
char msgbuf[4096];
|
||||||
char peerbuf[ISC_SOCKADDR_FORMATSIZE];
|
char peerbuf[ISC_SOCKADDR_FORMATSIZE];
|
||||||
char signerbuf[DNS_NAME_FORMATSIZE], qnamebuf[DNS_NAME_FORMATSIZE];
|
char signerbuf[DNS_NAME_FORMATSIZE], qnamebuf[DNS_NAME_FORMATSIZE];
|
||||||
const char *viewname = "";
|
const char *viewname = "";
|
||||||
|
@@ -2859,22 +2859,30 @@ update_action(isc_task_t *task, isc_event_t *event) {
|
|||||||
if (isc_log_wouldlog(ns_g_lctx, LOGLEVEL_PROTOCOL)) {
|
if (isc_log_wouldlog(ns_g_lctx, LOGLEVEL_PROTOCOL)) {
|
||||||
char namestr[DNS_NAME_FORMATSIZE];
|
char namestr[DNS_NAME_FORMATSIZE];
|
||||||
char typestr[DNS_RDATATYPE_FORMATSIZE];
|
char typestr[DNS_RDATATYPE_FORMATSIZE];
|
||||||
char rdstr[4096];
|
char rdstr[2048];
|
||||||
isc_buffer_t buf;
|
isc_buffer_t buf;
|
||||||
isc_region_t r;
|
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
const char *truncated = "";
|
||||||
|
|
||||||
dns_name_format(name, namestr, sizeof(namestr));
|
dns_name_format(name, namestr, sizeof(namestr));
|
||||||
dns_rdatatype_format(rdata.type, typestr,
|
dns_rdatatype_format(rdata.type, typestr,
|
||||||
sizeof(typestr));
|
sizeof(typestr));
|
||||||
isc_buffer_init(&buf, rdstr, sizeof(rdstr));
|
isc_buffer_init(&buf, rdstr, sizeof(rdstr));
|
||||||
result = dns_rdata_totext(&rdata, NULL, &buf);
|
result = dns_rdata_totext(&rdata, NULL, &buf);
|
||||||
isc_buffer_usedregion(&buf, &r);
|
if (result == ISC_R_NOSPACE) {
|
||||||
if (result == ISC_R_SUCCESS)
|
len = (int)isc_buffer_usedlength(&buf);
|
||||||
len = r.length;
|
truncated = " [TRUNCATED]";
|
||||||
|
} else if (result != ISC_R_SUCCESS) {
|
||||||
|
snprintf(rdstr, sizeof(rdstr), "[dns_"
|
||||||
|
"rdata_totext failed: %s]",
|
||||||
|
dns_result_totext(result));
|
||||||
|
len = strlen(rdstr);
|
||||||
|
} else
|
||||||
|
len = (int)isc_buffer_usedlength(&buf);
|
||||||
update_log(client, zone, LOGLEVEL_PROTOCOL,
|
update_log(client, zone, LOGLEVEL_PROTOCOL,
|
||||||
"adding an RR at '%s' %s %.*s",
|
"adding an RR at '%s' %s %.*s%s",
|
||||||
namestr, typestr, len,
|
namestr, typestr, len, rdstr,
|
||||||
(char *) r.base);
|
truncated);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare the affected RRset for the addition. */
|
/* Prepare the affected RRset for the addition. */
|
||||||
|
@@ -104,7 +104,7 @@ extern int h_errno;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAXCMD (4 * 1024)
|
#define MAXCMD (128 * 1024)
|
||||||
#define MAXWIRE (64 * 1024)
|
#define MAXWIRE (64 * 1024)
|
||||||
#define PACKETSIZE ((64 * 1024) - 1)
|
#define PACKETSIZE ((64 * 1024) - 1)
|
||||||
#define INITTEXT (2 * 1024)
|
#define INITTEXT (2 * 1024)
|
||||||
|
@@ -552,5 +552,17 @@ if [ $ret -ne 0 ]; then
|
|||||||
status=1
|
status=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
n=`expr $n + 1`
|
||||||
|
ret=0
|
||||||
|
echo "I:add a record which is truncated when logged. ($n)"
|
||||||
|
$NSUPDATE verylarge || ret=1
|
||||||
|
$DIG +tcp @10.53.0.1 -p 5300 txt txt.update.nil > dig.out.ns1.test$n
|
||||||
|
grep "ANSWER: 1," dig.out.ns1.test$n > /dev/null || ret=1
|
||||||
|
grep "adding an RR at 'txt.update.nil' TXT .* \[TRUNCATED\]" ns1/named.run > /dev/null || ret=1
|
||||||
|
if [ $ret -ne 0 ]; then
|
||||||
|
echo "I:failed"
|
||||||
|
status=1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "I:exit status: $status"
|
echo "I:exit status: $status"
|
||||||
exit $status
|
exit $status
|
||||||
|
3
bin/tests/system/nsupdate/verylarge
Normal file
3
bin/tests/system/nsupdate/verylarge
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user