]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix logging long named command lines
authorMichał Kępień <michal@isc.org>
Fri, 29 Nov 2019 08:06:41 +0000 (09:06 +0100)
committerMichał Kępień <michal@isc.org>
Fri, 29 Nov 2019 08:06:41 +0000 (09:06 +0100)
commit009df30f3abc135c5699ddeb732c6e7a7c9744d1
treed87cc2bd8c9eea6a41f5e062e1439616f1c7876e
parentc6811ed0526e0604642b0ad2e769010f19d27458
Fix logging long named command lines

The saved_command_line buffer in bin/named/main.c is 8192 bytes long.
The size of libisc's internal logging buffer (defined by the value of
the LOG_BUFFER_SIZE constant in lib/isc/log.c) is also 8192 bytes.
Since the buffer containing the ellipsis is passed as the last argument
to isc_log_write() and the buffer containing the potentially trimmed
named command line (saved_command_line) is passed as the second argument
in the same isc_log_write() call, it may happen that saved_command_line
will exhaust all available space in libisc's internal logging buffer, in
which case the ellipsis will be elided from the output.

Make saved_command_line 4096 bytes long as that value is arguably also
large enough for any reasonable use case and at the same time it ensures
ellipsis will always be printed for excessively long named command
lines.
bin/named/main.c
bin/tests/system/runtime/tests.sh