Compare commits

..
Author SHA1 Message Date
Ondřej Surý 79c3099e46 lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries as we do with dns_adb_beginudpfetch() 2019-10-13 16:33:22 +02:00
Ondřej Surý 61145ba48b Use integer fast type for mutexatomic shim type 2019-10-13 15:23:50 +02:00
Witold KręcickiandOndřej Surý 7557be3f93 lib/dns/adb.c:
- TSAN can't handle more than 64 locks in one thread,
   lock ADB bucket-by-bucket in TSAN mode. This means
   that the dump won't be consistent but it's good enough
   for testing
 - Use proper order when unlocking adb->namelocks
   and adb->entrylocks when dumping ADB.
2019-10-13 15:23:43 +02:00
Witold KręcickiandOndřej Surý c10c4b8261 lib/dns/adb.c: Use atomics for adb quota values
- TSAN can't handle more than 64 locks in one thread,
   lock ADB bucket-by-bucket in TSAN mode. This means
   that the dump won't be consistent but it's good enough
   for testing
 - Use proper order when unlocking adb->namelocks
   and adb->entrylocks when dumping ADB.
2019-10-13 15:23:17 +02:00
109 changed files with 387 additions and 1254 deletions
+3 -36
View File
@@ -28,7 +28,7 @@ stages:
### Runner Tag Templates
# Note: BSD runners extract the operating system version to use from job name
# Note: FreeBSD runners extract the FreeBSD version to use from job name
.freebsd-amd64: &freebsd_amd64
tags:
@@ -45,11 +45,6 @@ stages:
- linux
- i386
.openbsd-amd64: &openbsd_amd64
tags:
- openbsd
- amd64
### Docker Image Templates
# Alpine Linux
@@ -146,11 +141,7 @@ stages:
script:
- autoreconf -fi
artifacts:
paths:
- aclocal.m4
- configure
- ltmain.sh
- m4/libtool.m4
untracked: true
expire_in: "1 week"
.configure: &configure |
@@ -202,7 +193,7 @@ stages:
- *setup_interfaces
- *setup_softhsm
script:
- ( cd bin/tests/system && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 )
- ( cd bin/tests && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 )
- test -s bin/tests/system/systests.output
artifacts:
untracked: true
@@ -256,9 +247,6 @@ stages:
.cppcheck: &cppcheck_job
<<: *default_triggering_rules
stage: postcheck
before_script:
- export GCC_VERSION=$(gcc --version | sed -n 's/.*\([0-9]\+\)\.[0-9]\+\.[0-9]\+.*/\1/p')
- sed -i "/gcc\",/a\"-DCPPCHECK\", \"-D__STDC__\", \"-D__GNUC__=${GCC_VERSION}\"," compile_commands.json
script:
- *run_cppcheck
after_script:
@@ -775,24 +763,6 @@ unit:clang:freebsd12.0:amd64:
- clang:freebsd12.0:amd64
needs: ["clang:freebsd12.0:amd64"]
# Jobs for Clang builds on OpenBSD 6.5 (amd64)
clang:openbsd6.5:amd64:
variables:
CC: clang
<<: *openbsd_amd64
<<: *build_job
system:clang:openbsd6.5:amd64:
<<: *openbsd_amd64
<<: *system_test_job
dependencies:
- clang:openbsd6.5:amd64
needs: ["clang:openbsd6.5:amd64"]
only:
- tags
- web
# Jobs with libtool disabled
nolibtool:sid:amd64:
@@ -844,9 +814,6 @@ msvc:windows:amd64:
x64'
- 'Set-Item -path "Env:CL" -value "/MP$([Math]::Truncate($BUILD_PARALLEL_JOBS/2))"'
- '& msbuild.exe /maxCpuCount:2 /t:Build /p:Configuration=$VSCONF bind9.sln'
dependencies: []
needs:
- autoreconf:sid:amd64
artifacts:
untracked: true
expire_in: "1 week"
+5 -17
View File
@@ -1,23 +1,11 @@
5302. [bug] Fix checking that "dnstap-output" is defined when
"dnstap" is specified" in a view. [GL #1281]
5301. [bug] Detect partial prefixes / incomplete IPv4 address in
acls. [GL #1143]
5300. [bug] dig/mdig/delv: Add a colon after EDNS option names,
even when the option is empty, to improve
readability and allow correct parsing of YAML
output. [GL #1226]
--- 9.15.5 released ---
5299. [placeholder]
5299. [security] A flaw in DNSSEC verification when transferring
mirror zones could allow data to be incorrectly
marked valid. (CVE-2019-6475) [GL #1252]
5298. [security] Named could assert if a forwarder returned a
referral, rather than resolving the query, when QNAME
minimization was enabled. (CVE-2019-6476) [GL #1051]
5298. [placeholder]
5297. [bug] Check whether a previous QNAME minimization fetch
is still running before starting a new one; return
@@ -48,7 +36,7 @@
5289. [bug] Address NULL pointer dereference in rpz.c:rpz_detach.
[GL #1210]
5288. [bug] dnssec-must-be-secure was not always honored.
5288. [bug] dnssec-must-be-secure was not always honoured.
[GL #1209]
5287. [placeholder]
@@ -125,7 +113,7 @@
5268. [placeholder]
5267. [func] Allow statistics groups display to be toggle-able.
5267. [func] Allow statistics groups display to be toggleable.
[GL #1030]
5266. [bug] named-checkconf failed to report dnstap-output
@@ -233,7 +221,7 @@
code in a high-load cold-cache resolver scenario.
[GL #943]
5242. [bug] In relaxed qname minimization mode, fall back to
5242. [bug] In relaxed qname minimizatiom mode, fall back to
normal resolution when encountering a lame
delegation, and use _.domain/A queries rather
than domain/NS. [GL #1055]
@@ -1,3 +0,0 @@
acl myacl {
127.1; /* Incomplete dotted IPv4 address / prefix */
};
@@ -1,3 +0,0 @@
acl myacl {
127.1/8; /* No-zero bits */
};
@@ -1,3 +0,0 @@
acl myacl {
127; /* Non-dotted quad IPv4 address (0.0.0.127) / prefix without length. */
};
@@ -1,3 +0,0 @@
view "view" {
dnstap { client; auth; };
};
@@ -1,5 +0,0 @@
options {
dnstap-output unix "/var/run/named/dnstap.sock";
dnstap-identity hostname;
dnstap { client response; };
};
@@ -1,8 +0,0 @@
options {
dnstap-output unix "/var/run/named/dnstap.sock";
dnstap-identity hostname;
};
view "view" {
dnstap { client response; };
};
@@ -51,11 +51,6 @@ zone "example5." {
file "example.db";
};
zone "sld.tld" {
type master;
file "sld.tld.db";
};
/* A forward zone without forwarders. */
zone "example6" {
type forward;
-11
View File
@@ -1,11 +0,0 @@
$TTL 300 ; 5 minutes
@ IN SOA ns root (
2000082401 ; serial
1800 ; refresh (30 minutes)
1800 ; retry (30 minutes)
1814400 ; expire (3 weeks)
3600 ; minimum (1 hour)
)
NS ns
ns A 10.53.0.1
xxx TXT "foo"
@@ -60,8 +60,3 @@ zone "1.0.10.in-addr.arpa." {
type master;
file "example.db";
};
zone "tld" {
type master;
file "tld.db";
};
-12
View File
@@ -1,12 +0,0 @@
$TTL 300 ; 5 minutes
@ IN SOA ns root (
2000082401 ; serial
1800 ; refresh (30 minutes)
1800 ; retry (30 minutes)
1814400 ; expire (3 weeks)
3600 ; minimum (1 hour)
)
NS ns
ns A 10.53.0.2
sld NS ns.sld
ns.sld A 10.53.0.1
@@ -1,28 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
options {
query-source address 10.53.0.8;
notify-source 10.53.0.8;
transfer-source 10.53.0.8;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.8; };
listen-on-v6 { none; };
forwarders { 10.53.0.2; }; // returns referrals
forward first;
dnssec-validation yes;
};
zone "." {
type hint;
file "root.db";
};
-11
View File
@@ -1,11 +0,0 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
. NS a.root-servers.nil.
a.root-servers.nil. A 10.53.0.1
-1
View File
@@ -19,4 +19,3 @@ copy_setports ns3/named.conf.in ns3/named.conf
copy_setports ns4/named.conf.in ns4/named.conf
copy_setports ns5/named.conf.in ns5/named.conf
copy_setports ns7/named.conf.in ns7/named.conf
copy_setports ns8/named.conf.in ns8/named.conf
-7
View File
@@ -159,12 +159,5 @@ sent=`grep "10.53.0.7#.* (.): query '\./NS/IN' approved" ns1/named.run | wc -l`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking recovery from forwarding to a non-recursive server"
ret=0
$DIG $DIGOPTS xxx.sld.tld txt @10.53.0.8 > dig.out.f8
grep "status: NOERROR" dig.out.f8 > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
@@ -1,2 +0,0 @@
/ns2/named.conf
/ns2/controls.conf
@@ -1,21 +0,0 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Clean up after allow query tests.
#
rm -f dig.out.*
rm -f ns*/named.conf
rm -f */named.memstats
rm -f ns*/named.lock
rm -f ns*/named.run ns*/named.run.prev
rm -f ns*/managed-keys.bind* ns*/*.mkeys*
@@ -1,13 +0,0 @@
$TTL 86400
@ IN SOA dns1.mars.com. hostmaster.mars.com. (
2001062501 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day
IN NS dns1.mars.com.
IN A 10.53.0.1
dns1 IN A 10.53.0.1
@@ -1,6 +0,0 @@
zone "mars.com" {
type master;
file "mars.com.db";
};
@@ -1,26 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
options {
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion no;
notify no;
};
# Should include all files matching pattern.
include "zone*.conf";
# Shouldn't break standard file pattern.
include "mars.conf";
@@ -1,13 +0,0 @@
$TTL 86400
@ IN SOA dns1.zone1.com. hostmaster.zone1.com. (
2001062501 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day
IN NS dns1.zone1.com.
IN A 10.53.0.1
dns1 IN A 10.53.0.1
@@ -1,6 +0,0 @@
zone "zone1.com" {
type master;
file "zone1.com.db";
};
@@ -1,13 +0,0 @@
$TTL 86400
@ IN SOA dns1.zone2.com. hostmaster.zone2.com. (
2001062501 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day
IN NS dns1.zone2.com.
IN A 10.53.0.1
dns1 IN A 10.53.0.1
@@ -1,6 +0,0 @@
zone "zone2.com" {
type master;
file "zone2.com.db";
};
@@ -1,17 +0,0 @@
#!/bin/sh -e
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
$SHELL clean.sh
copy_setports ns2/named.conf.in ns2/named.conf
@@ -1,54 +0,0 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# Test of include statement with glob expression.
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
DIGOPTS="+tcp +nosea +nostat +nocmd +norec +noques +noadd +nostats -p ${PORT}"
status=0
n=0
# Test 1 - check if zone1 was loaded.
n=`expr $n + 1`
echo_i "checking glob include of zone1 config ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 zone1.com. a > dig.out.ns2.$n || ret=1
grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
grep '^zone1.com.' dig.out.ns2.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
# Test 2 - check if zone2 was loaded.
n=`expr $n + 1`
echo_i "checking glob include of zone2 config ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 zone2.com. a > dig.out.ns2.$n || ret=1
grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
grep '^zone2.com.' dig.out.ns2.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
# Test 3 - check if standard file path (no magic chars) works.
n=`expr $n + 1`
echo_i "checking include of standard file path config ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 mars.com. a > dig.out.ns2.$n || ret=1
grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
grep '^mars.com.' dig.out.ns2.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
Vendored
+3
View File
@@ -25647,6 +25647,9 @@ report() {
echo " Allow 'dnstap' packet logging (--enable-dnstap)"
test -z "$MAXMINDDB_LIBS" || echo " GeoIP2 access control (--enable-geoip)"
test "no" = "$use_gssapi" || echo " GSS-API (--with-gssapi)"
if test "yes" = "$enable_full_report" -o "aes" != "$with_cc_alg"; then
echo " Algorithm: $with_cc_alg"
fi
# these lines are only printed if run with --enable-full-report
if test "yes" = "$enable_full_report"; then
+3 -2
View File
@@ -2566,8 +2566,6 @@ AC_SUBST(DLZ_DRIVER_MYSQL_INCLUDES)
AC_SUBST(DLZ_DRIVER_MYSQL_LIBS)
AC_SUBST_FILE(DLZ_DRIVER_RULES)
AC_CHECK_HEADERS([glob.h])
if test "yes" = "$cross_compiling"; then
if test -z "$BUILD_CC"; then
AC_MSG_ERROR([BUILD_CC not set])
@@ -2885,6 +2883,9 @@ report() {
echo " Allow 'dnstap' packet logging (--enable-dnstap)"
test -z "$MAXMINDDB_LIBS" || echo " GeoIP2 access control (--enable-geoip)"
test "no" = "$use_gssapi" || echo " GSS-API (--with-gssapi)"
if test "yes" = "$enable_full_report" -o "aes" != "$with_cc_alg"; then
echo " Algorithm: $with_cc_alg"
fi
# these lines are only printed if run with --enable-full-report
if test "yes" = "$enable_full_report"; then
+1 -2
View File
@@ -3491,8 +3491,7 @@ $ORIGIN 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
<para>
The <command>include</command> statement inserts the
specified file (or files if a valid glob expression is detected)
at the point where the <command>include</command>
specified file at the point where the <command>include</command>
statement is encountered. The <command>include</command>
statement facilitates the administration of configuration
files
+1 -1
View File
@@ -614,6 +614,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -146,6 +146,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -856,6 +856,6 @@ controls {
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -2840,6 +2840,6 @@ $ORIGIN 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -14897,6 +14897,6 @@ HOST-127.EXAMPLE. MX 0 .
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -360,6 +360,6 @@ allow-query { !{ !10/8; any; }; key example; };
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -191,6 +191,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+3 -18
View File
@@ -36,7 +36,7 @@
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="section"><a href="Bv9ARM.ch08.html#id-1.9.2">Release Notes for BIND Version 9.15.5</a></span></dt>
<dt><span class="section"><a href="Bv9ARM.ch08.html#id-1.9.2">Release Notes for BIND Version 9.15.4</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="Bv9ARM.ch08.html#relnotes_intro">Introduction</a></span></dt>
<dt><span class="section"><a href="Bv9ARM.ch08.html#relnotes_versions">Note on Version Numbering</a></span></dt>
@@ -55,7 +55,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id-1.9.2"></a>Release Notes for BIND Version 9.15.5</h2></div></div></div>
<a name="id-1.9.2"></a>Release Notes for BIND Version 9.15.4</h2></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
@@ -152,21 +152,6 @@
This flaw is disclosed in CVE-2019-6471. [GL #942]
</p>
</li>
<li class="listitem">
<p>
<span class="command"><strong>named</strong></span> could crash with an assertion failure
if a forwarder returned a referral, rather than resolving the
query, when QNAME minimization was enabled. This flaw is
disclosed in CVE-2019-6476. [GL #1051]
</p>
</li>
<li class="listitem">
<p>
A flaw in DNSSEC verification when transferring mirror zones
could allow data to be incorrectly marked valid. This flaw
is disclosed in CVE-2019-6475. [GL #1252]
</p>
</li>
</ul></div>
</div>
<div class="section">
@@ -545,6 +530,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -148,6 +148,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -914,6 +914,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -537,6 +537,6 @@ $ <strong class="userinput"><code>sample-update -a sample-update -k Kxxx.+nnn+mm
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -210,6 +210,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+3 -3
View File
@@ -32,7 +32,7 @@
<div>
<div><h1 class="title">
<a name="id-1"></a>BIND 9 Administrator Reference Manual</h1></div>
<div><p class="releaseinfo">BIND Version 9.15.5</p></div>
<div><p class="releaseinfo">BIND Version 9.15.4</p></div>
<div><p class="copyright">Copyright © 2000-2019 Internet Systems Consortium, Inc. ("ISC")</p></div>
</div>
<hr>
@@ -245,7 +245,7 @@
</dl></dd>
<dt><span class="appendix"><a href="Bv9ARM.ch08.html">A. Release Notes</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="Bv9ARM.ch08.html#id-1.9.2">Release Notes for BIND Version 9.15.5</a></span></dt>
<dt><span class="section"><a href="Bv9ARM.ch08.html#id-1.9.2">Release Notes for BIND Version 9.15.4</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="Bv9ARM.ch08.html#relnotes_intro">Introduction</a></span></dt>
<dt><span class="section"><a href="Bv9ARM.ch08.html#relnotes_versions">Note on Version Numbering</a></span></dt>
@@ -443,6 +443,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
Binary file not shown.
+1 -1
View File
@@ -90,6 +90,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -220,6 +220,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -621,6 +621,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -1188,6 +1188,6 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -376,6 +376,6 @@ nsupdate -l
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -156,6 +156,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -270,6 +270,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -341,6 +341,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -250,6 +250,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -498,6 +498,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -555,6 +555,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -405,6 +405,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -171,6 +171,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -349,6 +349,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -707,6 +707,6 @@ db.example.com.signed
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -214,6 +214,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -143,6 +143,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -168,6 +168,6 @@ plugin query "/usr/local/lib/filter-aaaa.so" {
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -366,6 +366,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -610,6 +610,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -214,6 +214,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -463,6 +463,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -117,6 +117,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -119,6 +119,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -121,6 +121,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -1069,6 +1069,6 @@ zone
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -492,6 +492,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -155,6 +155,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -437,6 +437,6 @@ nslookup -query=hinfo -timeout=10
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -818,6 +818,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -162,6 +162,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -200,6 +200,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -158,6 +158,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -123,6 +123,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -260,6 +260,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -268,6 +268,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
+1 -1
View File
@@ -1017,6 +1017,6 @@
</tr>
</table>
</div>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.5 (Development Release)</p>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.15.4 (Development Release)</p>
</body>
</html>
-15
View File
@@ -34,20 +34,5 @@
This flaw is disclosed in CVE-2019-6471. [GL #942]
</para>
</listitem>
<listitem>
<para>
<command>named</command> could crash with an assertion failure
if a forwarder returned a referral, rather than resolving the
query, when QNAME minimization was enabled. This flaw is
disclosed in CVE-2019-6476. [GL #1051]
</para>
</listitem>
<listitem>
<para>
A flaw in DNSSEC verification when transferring mirror zones
could allow data to be incorrectly marked valid. This flaw
is disclosed in CVE-2019-6475. [GL #1252]
</para>
</listitem>
</itemizedlist>
</section>
+1 -16
View File
@@ -15,7 +15,7 @@
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id-1.2"></a>Release Notes for BIND Version 9.15.5</h2></div></div></div>
<a name="id-1.2"></a>Release Notes for BIND Version 9.15.4</h2></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
@@ -112,21 +112,6 @@
This flaw is disclosed in CVE-2019-6471. [GL #942]
</p>
</li>
<li class="listitem">
<p>
<span class="command"><strong>named</strong></span> could crash with an assertion failure
if a forwarder returned a referral, rather than resolving the
query, when QNAME minimization was enabled. This flaw is
disclosed in CVE-2019-6476. [GL #1051]
</p>
</li>
<li class="listitem">
<p>
A flaw in DNSSEC verification when transferring mirror zones
could allow data to be incorrectly marked valid. This flaw
is disclosed in CVE-2019-6475. [GL #1252]
</p>
</li>
</ul></div>
</div>
<div class="section">
BIN
View File
Binary file not shown.
+1 -9
View File
@@ -1,4 +1,4 @@
Release Notes for BIND Version 9.15.5
Release Notes for BIND Version 9.15.4
Introduction
@@ -63,14 +63,6 @@ Security Fixes
number of incoming packets were being rejected. This flaw is disclosed
in CVE-2019-6471. [GL #942]
* named could crash with an assertion failure if a forwarder returned a
referral, rather than resolving the query, when QNAME minimization was
enabled. This flaw is disclosed in CVE-2019-6476. [GL #1051]
* A flaw in DNSSEC verification when transferring mirror zones could
allow data to be incorrectly marked valid. This flaw is disclosed in
CVE-2019-6475. [GL #1252]
New Features
* Added a new command line option to dig: +[no]unexpected. By default,
+160 -272
View File
@@ -1,3 +1,13 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
## BIND 9 Coding Style
BIND 9 is principally written in [C](#cstyle), with some additional code
@@ -9,50 +19,50 @@ below.
#### Compiler
A C11 compiler, library with C11 extensions and POSIX:2001 are assumed. Feel
free to use any C11 feature, but make sure to provide compatibility shims for
all supported platforms, e.g. Windows MSVC that doesn't support all of the C11
features.
An ANSI standard C compiler and library are assumed. Feel free to use any
ANSI C feature.
#### Warnings
Given a reasonable set of things to warn about (e.g. -W -Wall for gcc), the goal
is to compile with no warnings.
Given a reasonable set of things to warn about (e.g. -W -Wall for gcc), the
goal is to compile with no warnings.
#### Copyright Notices
Source files with significant content should have a copyright. The copyright
year(s) should be kept current.
All source files should have a copyright. The copyright year(s) should be
kept current. The files and the copyright year(s) should be listed in
util/copyrights. When an existing file is updated in the source
repository, its copyright notice and dates are updated automatically.
#### Indentation
#### Line Formatting
Use tabs for indentation. Spaces before statements are only allowed when
needed to line up a continued expression. In the following example, spaces
used for indentation are indicated with `"_"`:
if (i == 0) {
printf("this is going to be %s very long %s statement\\n",
_______"a", "printf");
}
if (i == 0) {
printf("this is going to be %s very long %s statement\\n",
_______"a", "printf");
}
Text editors should be configured with tab-stop set to 8 characters, and
Text editors should be configured with tabstop set to 8 characters, and
tabs should not be expanded to into spaces. The following `vim` settings
conform well to BIND 9 C style:
set showmatch
set showmode
set autoindent
set expandtab
filetype plugin on
let c_syntax_for_h = 1
autocmd FileType c,cc,cpp set cindent
autocmd FileType c,cc,cpp set cino=(0:0l1
autocmd FileType c,cc,cpp set fo=rotcq
autocmd FileType c,cc,cpp set noexpandtab ts=8
autocmd FileType python set ts=4 sw=4
filetype indent on
set showmatch
set showmode
set autoindent
set expandtab
filetype plugin on
let c_syntax_for_h = 1
autocmd FileType c,cc,cpp set cindent
autocmd FileType c,cc,cpp set cino=(0:0l1
autocmd FileType c,cc,cpp set fo=rotcq
autocmd FileType c,cc,cpp set noexpandtab ts=8
autocmd FileType python set ts=4 sw=4
filetype indent on
#### Vertical Whitespace
@@ -63,20 +73,15 @@ to one another.
#### Line Length
Lines should be no longer than 80 characters, even if it requires violating
indentation rules to make them fit. Since C11 is assumed, the best way to
deal with strings that extend past column 80 is to break them into two or
Lines should be no longer than 79 characters, even if it requires violating
indentation rules to make them fit. Since ANSI C is assumed, the best way to
deal with strings that extend past column 79 is to break them into two or
more sections separated from each other by a newline and indentation:
puts("This string got very far to the "
"right and wrapped. ANSI "
"catenation rules will turn this "
"into one long string.");
The rule for string formatting can be violated in cases where breaking
the string prevents ability to lookup the string using grep. Also please
bear in mind that if you are too deeply nested, the code needs refactoring
and not more line breaks.
puts("This string got very far to the "
"right and wrapped. ANSI catenation "
"rules will turn this into one "
"long string.");
#### Comments
@@ -85,12 +90,12 @@ comprehensibility of the code. Comments describing public functions are
usually in the header file below the function prototype; comments
describing static functions are above the function declaration.
Comments may be single-line or multi-line. A single-line comment should be
Comments may be single-line or multiline. A single-line comment should be
at the end of the line if there is other text on the line, and should start
in the same column as other nearby end-of-line comments. The comment
should be at the same indentation level as the code it is referring to.
Multi-line comments should start with `"/*"` on a line by itself.
Multiline comments should start with `"/*"` on a line by itself.
Subsequent lines should have `" *"` lined-up with the `"*"` above. The end of
the comment should be `" */"` on a line by itself, again with the `"*"`
lined-up with the one above. Comments should start with a capital letter
@@ -98,13 +103,13 @@ and end with a period.
Good:
/*
* Private variables.
*/
static int a /* Description of 'a'. */
static int b /* Description of 'b'. */
static char * c /* Description of 'c'. */
/*
* Private variables.
*/
static int a /* Description of 'a'. */
static int b /* Description of 'b'. */
static char * c /* Description of 'c'. */
The following lint and lint-like comments should be used where appropriate:
@@ -146,63 +151,65 @@ include the file. `<isc/lang.h>` SHOULD be included for private header files
or for public files that do not declare any functions.
/*
* Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#pragma once
/*****
***** Module Info
*****/
/*****
***** Module Info
*****/
/*
* (Module name here.)
*
* (One line description here.)
*
* (Extended description and notes here.)
*
* MP:
* (Information about multiprocessing considerations
* here, e.g. locking requirements.)
*
* Reliability:
* (Any reliability concerns should be mentioned here.)
*
* Resources:
* (A rough guide to how resources are used by this module.)
*
* Security:
* (Any security issues are discussed here.)
*
* Standards:
* (Any standards relevant to the module are listed here.)
*/
/*
* (Module name here.)
*
* (One line description here.)
*
* (Extended description and notes here.)
*
* MP:
* (Information about multiprocessing considerations
* here, e.g. locking requirements.)
*
* Reliability:
* (Any reliability concerns should be mentioned here.)
*
* Resources:
* (A rough guide to how resources are used by this module.)
*
* Security:
* (Any security issues are discussed here.)
*
* Standards:
* (Any standards relevant to the module are listed here.)
*/
/***
*** Imports
***/
/***
*** Imports
***/
/* #includes here. */
#include <isc/lang.h>
/* #includes here. */
#include <isc/lang.h>
/***
*** Types
***/
/***
*** Types
***/
/* (Type definitions here.) */
/* (Type definitions here.) */
/***
*** Functions
***/
ISC_LANG_BEGINDECLS
/* (Function declarations here, with full prototypes.) */
ISC_LANG_ENDDECLS
/***
*** Functions
***/
ISC_LANG_BEGINDECLS
/* (Function declarations here, with full prototypes.) */
ISC_LANG_ENDDECLS
#endif /* ISC_WHATEVER_H */
#### Including Interfaces (.h files)
@@ -279,28 +286,28 @@ this.
Good:
static void
f(int i) {
if (i > 0) {
printf("yes\\n");
i = 0;
} else {
printf("no\\n");
}
static void
f(int i) {
if (i > 0) {
printf("yes\\n");
i = 0;
} else {
printf("no\\n");
}
}
Bad:
void f(int i)
{
if(i<0){i=0;printf("was negative\\n");}
if (i == 0)
printf("no\\n");
if (i > 0)
{
printf("yes\\n");
i = 0;
}}
void f(int i)
{
if(i<0){i=0;printf("was negative\\n");}
if (i == 0)
printf("no\\n");
if (i > 0)
{
printf("yes\\n");
i = 0;
}}
#### Spaces
@@ -362,18 +369,16 @@ Not so good:
#### Integral Types
Careful thought should be given to whether an integral type should be signed or
unsigned, and to whether a specific size is required. The basic rule of thumb
is to use `size_t` for sizes, cardinalities or ordinal numbers (e.g. iteration
counters, array subscripts). Use unsigned type for small quantities that cant
be negative, use signed types for small quantities that bear a sign, and finally
use ptrdiff_t for large differences that bear a sign. Assignments and
comparisons between signed and unsigned integers should be avoided; suppressing
the warnings with casts is not desirable.
Careful thought should be given to whether an integral type should be
signed or unsigned, and to whether a specific size is required. `int`
should be used for generic variables (e.g. iteration counters, array
subscripts). Other than for generic variables, if a negative value isn't
meaningful, the variable should be unsigned. Assignments and comparisons
between signed and unsigned integers should be avoided; suppressing the
warnings with casts is not desireable.
C99 standard integer types are generally preferred, and must be used when
`unsigned long` or `short` could be ambiguous, and `size_t` is preferred to
`unsigned int` variables.
C99 standard integer types must be used when `unsigned long` or
`short` could be ambiguous.
#### Clear Success or Failure
@@ -426,7 +431,7 @@ Bad:
Explicit testing against zero is required for numeric, non-boolean
variables.
Good:
Good:
int i = 10;
@@ -535,133 +540,16 @@ Good:
isc_mem_free(mctx, text);
text = NULL;
#### Variable Scopes
Always use minimal scopes for the variables, e.g. use block scope instead of
local scope whenever possible.
Bad:
void
foo() {
size_t i;
[...];
for (i = 0; i < 10; i++);
[...]
}
Good:
void
foo() {
[...];
for (size_t i = 0; i < 10; i++);
[...]
}
Bad:
void
foo() {
size_t j = 0;
[...] /* j not used here */
if (true) {
while (j < 10) ++j;
}
[...] /* j not used here */
return (0);
}
Good:
void
foo() {
[...]
if (true) {
size_t j = 0;
while (j < 10) ++j;
}
[...]
}
Integrating cppcheck with editor of your choice (f.e. flycheck with emacs) could
be a great help in identifying places where variable scopes can be reduced.
#### Initializing variables
Static initializers should be used instead of memset.
Good:
char array[10] = { 0 };
Bad:
char array[10];
memset(array, 0, sizeof(array));
Designated initializers should be used to initialize structures.
Good:
struct example {
int foo;
int bar;
int baz;
};
struct example x = { .foo = -1 };
Bad:
struct example {
int foo;
int bar;
int baz;
};
struct example x;
x.foo = -1;
x.bar = 0;
x.baz = 0;
Good:
struct example {
int foo;
int bar;
int baz;
};
struct example *x = isc_mem_get(mctx, sizeof(*x));
*x = (struct example){ .foo = -1 };
Bad:
struct example {
int foo;
int bar;
int baz;
};
struct example *x = isc_mem_get(mctx, sizeof(*x));
x->foo = -1;
x->bar = 0;
x->baz = 0;
#### Const
Declare variables as constant if they are not to be modified.
#### Variable-Length Arrays
Use VLAs where it is more appropriate to allocate the memory on the stack rather
than allocate it using `isc_mem_get()` from the heap. Usually, a short lived
arrays local to that particular functions would be good fit for using VLAs.
#### <a name="public_namespace"></a>Public Interface Namespace
All public interfaces to functions, macros, typedefs, and variables
provided by the library, should use names of the form
`{library}_{module}_{what}`, such as:
isc_buffer_t /* typedef */
dns_name_setbuffer(name, buffer) /* function */
ISC_LIST_HEAD(list) /* macro */
isc_commandline_argument /* variable */
isc_buffer_t /* typedef */
dns_name_setbuffer(name, buffer) /* function */
ISC_LIST_HEAD(list) /* macro */
isc_commandline_argument /* variable */
Structures which are `typedef`'d generally have the name of the typedef
sans the final `_t`:
@@ -706,17 +594,17 @@ parameter, it was changed to `dns_zone_setfile2()`; the original function
name became a wrapper for the new function, calling it with the default
value of the format parameter:
isc_result_t
dns_zone_setfile(dns_zone_t *zone, const char *file) {
return (dns_zone_setfile2(zone, file, dns_masterformat_text);
}
isc_result_t
dns_zone_setfile2(dns_zone_t *zone, const char *file,
dns_masterformat_t format)
{
...
}
isc_result_t
dns_zone_setfile(dns_zone_t *zone, const char *file) {
return (dns_zone_setfile2(zone, file, dns_masterformat_text);
}
isc_result_t
dns_zone_setfile2(dns_zone_t *zone, const char *file,
dns_masterformat_t format)
{
...
}
#### <a name="private_namespace"></a>Shared Private Interfaces
@@ -762,12 +650,12 @@ support it. Is it in the POSIX standard? If so, how long has it been
there? (BIND is still run on some operating systems released in the
1990s.) Is its behavior the same on all platforms? Is its signature
the same? Are integer parameters the same size and signedness? Does it
always return the same values on success, and set the same `errno` codes
alwasy return the same values on success, and set the same `errno` codes
on failure?
If there is a chance the library call may not be completely portable,
edit `configure.in` to check for it on the local system and only call
it from within a suitable `#ifdef`. If the function is nonoptional,
it from within a suitable `#ifdef`. If the function is nonoptional,
it may be necessary to add your own implentation of it (or copy one
from a source with a BSD-compatible license).
@@ -823,14 +711,14 @@ For Python coding, we abide by the Python style guidelines described [here](http
* The `__init__()` method should always be the first one declared in a
class definition, like so:
class Foo:
# constructor definition here
def __init__(self):
...
# other functions may follow
def bar(self):
...
Close all file and socket objects
class Foo:
# constructor definition here
def __init__(self):
...
# other functions may follow
def bar(self):
...
Close all file and socket objects
* All Python standard library objects that have an underlying file
descriptor (fd) should be closed explicitly using the `.close()` method.
@@ -838,8 +726,8 @@ For Python coding, we abide by the Python style guidelines described [here](http
* In cases where a file is opened and closed in a single block, it
is often preferable to use the `with` statement:
with open('filename') as f:
do_something_with(f)
with open('filename') as f:
do_something_with(f)
### <a name="plstyle"></a>Perl
+10 -43
View File
@@ -1356,6 +1356,16 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
result = ISC_R_FAILURE;
}
}
} else {
(void) cfg_map_get(options, "dnstap", &obj);
if (obj != NULL) {
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
"'dnstap-output' must be set if 'dnstap' "
"is set");
if (result == ISC_R_SUCCESS) {
result = ISC_R_FAILURE;
}
}
}
#endif
@@ -3477,44 +3487,6 @@ check_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
}
#endif
static isc_result_t
check_dnstap(const cfg_obj_t *voptions, const cfg_obj_t *config,
isc_log_t *logctx)
{
#ifdef HAVE_DNSTAP
const cfg_obj_t *options = NULL;
const cfg_obj_t *obj = NULL;
if (config != NULL) {
(void) cfg_map_get(config, "options", &options);
}
if (options != NULL) {
(void) cfg_map_get(options, "dnstap-output", &obj);
}
if (obj == NULL) {
if (voptions != NULL) {
(void) cfg_map_get(voptions, "dnstap", &obj);
}
if (options != NULL && obj == NULL) {
(void) cfg_map_get(options, "dnstap", &obj);
}
if (obj != NULL) {
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
"'dnstap-output' must be set if 'dnstap' "
"is set");
return (ISC_R_FAILURE);
}
}
return (ISC_R_SUCCESS);
#else
UNUSED(voptions);
UNUSED(config);
UNUSED(logctx);
return (ISC_R_SUCCESS);
#endif
}
static isc_result_t
check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
const char *viewname, dns_rdataclass_t vclass,
@@ -3862,11 +3834,6 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
result = tresult;
}
tresult = check_dnstap(voptions, config, logctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
tresult = check_viewacls(actx, voptions, config, logctx, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
+77 -54
View File
@@ -252,8 +252,8 @@ struct dns_adbentry {
unsigned char to4096; /* Our max. */
uint8_t mode;
uint32_t quota;
uint32_t active;
atomic_uint_fast32_t quota;
atomic_uint_fast32_t active;
double atr;
/*
@@ -1832,9 +1832,9 @@ new_adbentry(dns_adb_t *adb) {
e->srtt = (isc_random_uniform(0x1f)) + 1;
e->lastage = 0;
e->expires = 0;
e->active = 0;
atomic_init(&e->active, 0);
e->mode = 0;
e->quota = adb->quota;
atomic_init(&e->quota, adb->quota);
e->atr = 0.0;
ISC_LIST_INIT(e->lameinfo);
ISC_LINK_INIT(e, plink);
@@ -2161,8 +2161,10 @@ log_quota(dns_adbentry_t *entry, const char *fmt, ...) {
isc_netaddr_format(&netaddr, addrbuf, sizeof(addrbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ADB,
ISC_LOG_INFO, "adb: quota %s (%u/%u): %s",
addrbuf, entry->active, entry->quota, msgbuf);
ISC_LOG_INFO,
"adb: quota %s (%" PRIuFAST32 "/%" PRIuFAST32 "): %s",
addrbuf, atomic_load_relaxed(&entry->active),
atomic_load_relaxed(&entry->quota), msgbuf);
}
static void
@@ -2185,9 +2187,7 @@ copy_namehook_lists(dns_adb_t *adb, dns_adbfind_t *find,
INSIST(bucket != DNS_ADB_INVALIDBUCKET);
LOCK(&adb->entrylocks[bucket]);
if (entry->quota != 0 &&
entry->active >= entry->quota)
{
if (dns_adbentry_overquota(entry)) {
find->options |=
(DNS_ADBFIND_LAMEPRUNED|
DNS_ADBFIND_OVERQUOTA);
@@ -2225,9 +2225,7 @@ copy_namehook_lists(dns_adb_t *adb, dns_adbfind_t *find,
INSIST(bucket != DNS_ADB_INVALIDBUCKET);
LOCK(&adb->entrylocks[bucket]);
if (entry->quota != 0 &&
entry->active >= entry->quota)
{
if (dns_adbentry_overquota(entry)) {
find->options |=
(DNS_ADBFIND_LAMEPRUNED|
DNS_ADBFIND_OVERQUOTA);
@@ -3388,7 +3386,6 @@ dump_ttl(FILE *f, const char *legend, isc_stdtime_t value, isc_stdtime_t now) {
static void
dump_adb(dns_adb_t *adb, FILE *f, bool debug, isc_stdtime_t now) {
unsigned int i;
dns_adbname_t *name;
dns_adbentry_t *entry;
@@ -3401,28 +3398,46 @@ dump_adb(dns_adb_t *adb, FILE *f, bool debug, isc_stdtime_t now) {
adb, adb->erefcnt, adb->irefcnt,
isc_mempool_getallocated(adb->nhmp));
for (i = 0; i < adb->nnames; i++)
/*
* In TSAN mode we need to lock the locks individually, as TSAN
* can't handle more than 64 locks locked by one thread.
* In regular mode we want a consistent dump so we need to
* lock everything.
*/
#ifndef __SANITIZE_THREAD__
for (size_t i = 0; i < adb->nnames; i++) {
LOCK(&adb->namelocks[i]);
for (i = 0; i < adb->nentries; i++)
}
for (size_t i = 0; i < adb->nentries; i++) {
LOCK(&adb->entrylocks[i]);
}
#endif
/*
* Dump the names
*/
for (i = 0; i < adb->nnames; i++) {
for (size_t i = 0; i < adb->nnames; i++) {
#ifdef __SANITIZE_THREAD__
LOCK(&adb->namelocks[i]);
#endif
name = ISC_LIST_HEAD(adb->names[i]);
if (name == NULL)
if (name == NULL) {
#ifdef __SANITIZE_THREAD__
UNLOCK(&adb->namelocks[i]);
#endif
continue;
if (debug)
fprintf(f, "; bucket %u\n", i);
}
if (debug) {
fprintf(f, "; bucket %zu\n", i);
}
for (;
name != NULL;
name = ISC_LIST_NEXT(name, plink))
{
if (debug)
if (debug) {
fprintf(f, "; name %p (flags %08x)\n",
name, name->flags);
}
fprintf(f, "; ");
print_dns_name(f, &name->name);
if (dns_name_countlabels(&name->target) > 0) {
@@ -3450,26 +3465,39 @@ dump_adb(dns_adb_t *adb, FILE *f, bool debug, isc_stdtime_t now) {
print_find_list(f, name);
}
}
#ifdef __SANITIZE_THREAD__
UNLOCK(&adb->namelocks[i]);
#endif
}
fprintf(f, ";\n; Unassociated entries\n;\n");
for (i = 0; i < adb->nentries; i++) {
for (size_t i = 0; i < adb->nentries; i++) {
#ifdef __SANITIZE_THREAD__
LOCK(&adb->entrylocks[i]);
#endif
entry = ISC_LIST_HEAD(adb->entries[i]);
while (entry != NULL) {
if (entry->nh == 0)
dump_entry(f, adb, entry, debug, now);
entry = ISC_LIST_NEXT(entry, plink);
}
#ifdef __SANITIZE_THREAD__
UNLOCK(&adb->entrylocks[i]);
#endif
}
#ifndef __SANITIZE_THREAD__
/*
* Unlock everything
*/
for (i = 0; i < adb->nentries; i++)
for (ssize_t i = adb->nentries-1; i >= 0; i--) {
UNLOCK(&adb->entrylocks[i]);
for (i = 0; i < adb->nnames; i++)
}
for (ssize_t i = adb->nnames-1; i >= 0; i--) {
UNLOCK(&adb->namelocks[i]);
}
#endif
}
static void
@@ -3504,8 +3532,8 @@ dump_entry(FILE *f, dns_adb_t *adb, dns_adbentry_t *entry,
fprintf(f, " [ttl %d]", (int)(entry->expires - now));
if (adb != NULL && adb->quota != 0 && adb->atr_freq != 0) {
fprintf(f, " [atr %0.2f] [quota %u]",
entry->atr, entry->quota);
fprintf(f, " [atr %0.2f] [quota %" PRIuFAST32 "]",
entry->atr, atomic_load_relaxed(&entry->quota));
}
fprintf(f, "\n");
@@ -4225,21 +4253,25 @@ maybe_adjust_quota(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
addr->entry->atr = ISC_CLAMP(addr->entry->atr, 0.0, 1.0);
if (addr->entry->atr < adb->atr_low && addr->entry->mode > 0) {
addr->entry->quota = adb->quota *
quota_adj[--addr->entry->mode] / 10000;
log_quota(addr->entry, "atr %0.2f, quota increased to %u",
addr->entry->atr, addr->entry->quota);
uint_fast32_t new_quota =
adb->quota * quota_adj[--addr->entry->mode] / 10000;
atomic_store_release(&addr->entry->quota,
ISC_MIN(1, new_quota));
log_quota(addr->entry, "atr %0.2f, quota increased to %"
PRIuFAST32,
addr->entry->atr,
new_quota);
} else if (addr->entry->atr > adb->atr_high &&
addr->entry->mode < (QUOTA_ADJ_SIZE - 1)) {
addr->entry->quota = adb->quota *
quota_adj[++addr->entry->mode] / 10000;
log_quota(addr->entry, "atr %0.2f, quota decreased to %u",
addr->entry->atr, addr->entry->quota);
uint_fast32_t new_quota =
adb->quota * quota_adj[++addr->entry->mode] / 10000;
atomic_store_release(&addr->entry->quota,
ISC_MIN(1, new_quota));
log_quota(addr->entry, "atr %0.2f, quota decreased to %"
PRIuFAST32,
addr->entry->atr,
new_quota);
}
/* Ensure we don't drop to zero */
if (addr->entry->quota == 0)
addr->entry->quota = 1;
}
#define EDNSTOS 3U
@@ -4741,34 +4773,25 @@ dns_adb_setquota(dns_adb_t *adb, uint32_t quota, uint32_t freq,
bool
dns_adbentry_overquota(dns_adbentry_t *entry) {
REQUIRE(DNS_ADBENTRY_VALID(entry));
return (entry->quota != 0 && entry->active >= entry->quota);
uint_fast32_t quota = atomic_load_relaxed(&entry->quota);
uint_fast32_t active = atomic_load_acquire(&entry->active);
return (quota != 0 && active >= quota);
}
void
dns_adb_beginudpfetch(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
int bucket;
REQUIRE(DNS_ADB_VALID(adb));
REQUIRE(DNS_ADBADDRINFO_VALID(addr));
bucket = addr->entry->lock_bucket;
LOCK(&adb->entrylocks[bucket]);
addr->entry->active++;
UNLOCK(&adb->entrylocks[bucket]);
INSIST(atomic_fetch_add_relaxed(&addr->entry->active, 1) != UINT32_MAX);
}
void
dns_adb_endudpfetch(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
int bucket;
REQUIRE(DNS_ADB_VALID(adb));
REQUIRE(DNS_ADBADDRINFO_VALID(addr));
bucket = addr->entry->lock_bucket;
LOCK(&adb->entrylocks[bucket]);
if (addr->entry->active > 0)
addr->entry->active--;
UNLOCK(&adb->entrylocks[bucket]);
INSIST(atomic_fetch_sub_release(&addr->entry->active, 1) != 0);
}
+2 -2
View File
@@ -10,6 +10,6 @@
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
LIBINTERFACE = 1504
LIBINTERFACE = 1503
LIBREVISION = 0
LIBAGE = 1
LIBAGE = 0
+5 -19
View File
@@ -1263,7 +1263,10 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp,
dns_adb_adjustsrtt(fctx->adb, query->addrinfo, rtt, factor);
}
dns_adb_endudpfetch(fctx->adb, query->addrinfo);
if ((query->options & DNS_FETCHOPT_TCP) == 0) {
/* Inform the ADB that we're ending an UDP fetch */
dns_adb_endudpfetch(fctx->adb, query->addrinfo);
}
/*
* Age RTTs of servers not tried.
@@ -2121,7 +2124,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
if (dns_adbentry_overquota(addrinfo->entry))
goto cleanup_dispatch;
/* Inform the ADB that we're starting a fetch */
/* Inform the ADB that we're starting an UDP fetch */
dns_adb_beginudpfetch(fctx->adb, addrinfo);
result = resquery_send(query);
@@ -9184,23 +9187,6 @@ rctx_referral(respctx_t *rctx) {
return (ISC_R_COMPLETE);
}
if ((fctx->options & DNS_FETCHOPT_QMINIMIZE) != 0) {
dns_name_free(&fctx->qmindcname, fctx->mctx);
dns_name_init(&fctx->qmindcname, NULL);
result = dns_name_dup(rctx->ns_name, fctx->mctx,
&fctx->qmindcname);
if (result != ISC_R_SUCCESS) {
rctx->result = result;
return (ISC_R_COMPLETE);
}
result= fctx_minimize_qname(fctx);
if (result != ISC_R_SUCCESS) {
rctx->result = result;
return (ISC_R_COMPLETE);
}
}
result = fcount_incr(fctx, true);
if (result != ISC_R_SUCCESS) {
rctx->result = result;
-1
View File
@@ -695,7 +695,6 @@ decode_NegTokenResp(const unsigned char *p, size_t len, NegTokenResp * data, siz
size_t l;
int e;
/* cppcheck-suppress uninitvar */
memset(data, 0, sizeof(*data));
reallen = 0;
e = der_match_tag_and_length(p, len, ASN1_C_UNIV, CONS, UT_Sequence, &reallen, &l);
+31 -37
View File
@@ -1503,9 +1503,9 @@ static isc_result_t
check_dnskey_sigs(vctx_t *vctx, const dns_rdata_dnskey_t *dnskey,
dns_rdata_t *rdata, bool is_ksk)
{
unsigned char *active_keys = NULL, *standby_keys = NULL;
unsigned char *active_keys, *standby_keys;
dns_keynode_t *keynode = NULL;
bool *goodkey = NULL;
bool *goodkey;
dst_key_t *key = NULL;
isc_result_t result;
@@ -1551,48 +1551,42 @@ check_dnskey_sigs(vctx_t *vctx, const dns_rdata_dnskey_t *dnskey,
if (result != ISC_R_SUCCESS) {
return (result);
}
result = dns_keytable_findkeynode(vctx->secroots, vctx->origin,
dst_key_alg(key), dst_key_id(key),
&keynode);
switch (result) {
case ISC_R_SUCCESS:
/*
* The supplied key is a trust anchor.
*/
dns_keytable_detachkeynode(vctx->secroots, &keynode);
dns_rdataset_settrust(&vctx->keyset, dns_trust_secure);
dns_rdataset_settrust(&vctx->keysigs, dns_trust_secure);
*goodkey = true;
break;
case DNS_R_PARTIALMATCH:
case ISC_R_NOTFOUND:
/*
* The supplied key is not present in the trust anchor table,
* but other keys signing the DNSKEY RRset may be, so this is
* not an error, we just do not set 'vctx->good[kz]sk'.
*/
result = ISC_R_SUCCESS;
break;
default:
/*
* An error occurred while searching the trust anchor table,
* return it to the caller.
*/
break;
}
/*
* No such trust anchor.
* Clean up.
*/
if (result != ISC_R_SUCCESS) {
if (result == DNS_R_PARTIALMATCH || result == ISC_R_NOTFOUND) {
result = ISC_R_SUCCESS;
}
dst_key_free(&key);
goto cleanup;
}
while (result == ISC_R_SUCCESS) {
dns_keynode_t *nextnode = NULL;
if (dst_key_compare(key, dns_keynode_key(keynode))) {
dns_keytable_detachkeynode(vctx->secroots, &keynode);
dns_rdataset_settrust(&vctx->keyset, dns_trust_secure);
dns_rdataset_settrust(&vctx->keysigs, dns_trust_secure);
*goodkey = true;
goto cleanup;
}
result = dns_keytable_findnextkeynode(vctx->secroots,
keynode, &nextnode);
dns_keytable_detachkeynode(vctx->secroots, &keynode);
keynode = nextnode;
}
cleanup:
if (keynode != NULL) {
dns_keytable_detachkeynode(vctx->secroots, &keynode);
}
if (key != NULL) {
dst_key_free(&key);
}
return (ISC_R_SUCCESS);
return (result);
}
/*%
+1 -1
View File
@@ -11,5 +11,5 @@
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
LIBINTERFACE = 1501
LIBREVISION = 1
LIBREVISION = 0
LIBAGE = 0
+3 -3
View File
@@ -50,7 +50,7 @@ OBJS = pk11.@O@ pk11_result.@O@ \
backtrace.@O@ base32.@O@ base64.@O@ \
bind9.@O@ buffer.@O@ bufferlist.@O@ \
commandline.@O@ counter.@O@ crc64.@O@ error.@O@ entropy.@O@ \
event.@O@ glob.@O@ hash.@O@ ht.@O@ heap.@O@ hex.@O@ hmac.@O@ \
event.@O@ hash.@O@ ht.@O@ heap.@O@ hex.@O@ hmac.@O@ \
httpd.@O@ iterated_hash.@O@ \
lex.@O@ lfsr.@O@ lib.@O@ log.@O@ \
md.@O@ mem.@O@ mutexblock.@O@ \
@@ -69,8 +69,8 @@ SRCS = pk11.c pk11_result.c \
aes.c app.c assertions.c \
backtrace.c base32.c base64.c bind9.c \
buffer.c bufferlist.c commandline.c counter.c crc64.c \
entropy.c error.c event.c glob.c hash.c ht.c heap.c hex.c \
hmac.c httpd.c iterated_hash.c \
entropy.c error.c event.c hash.c ht.c heap.c hex.c hmac.c \
httpd.c iterated_hash.c \
lex.c lfsr.c lib.c log.c \
md.c mem.c mutexblock.c \
netaddr.c netscope.c nonce.c openssl_shim.c pool.c \
+2 -2
View File
@@ -10,6 +10,6 @@
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
LIBINTERFACE = 1503
LIBREVISION = 0
LIBINTERFACE = 1502
LIBREVISION = 1
LIBAGE = 0
-250
View File
@@ -1,250 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <isc/errno.h>
#include <isc/glob.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#if HAVE_GLOB_H
#include <glob.h>
#elif defined(_WIN32) || defined(_WIN64)
#include <stdlib.h>
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#include <isc/list.h>
#define GLOB_WIN_IMPL 1
#define GLOB_ERR 0x0004 /* Return on error. */
#define GLOB_NOSPACE (-1)
#define GLOB_NOMATCH (-3)
/* custom glob implementation for windows */
static int
glob(const char *pattern, int flags, void *unused, glob_t *pglob);
static void
globfree(glob_t *pglob);
#else
#error "Required header missing: glob.h"
#endif
isc_result_t
isc_glob(const char *pattern, glob_t *pglob) {
REQUIRE(pattern != NULL);
REQUIRE(*pattern != '\0');
REQUIRE(pglob != NULL);
int rc = glob(pattern, GLOB_ERR, NULL, pglob);
switch (rc) {
case 0:
return (ISC_R_SUCCESS);
case GLOB_NOMATCH:
/* if a magic char (*?[]) was in pattern
* and no path matched we report error early,
* otherwise proceed as normal */
return (strpbrk(pattern, "[]*?")) ?
(ISC_R_FILENOTFOUND) : (ISC_R_SUCCESS);
case GLOB_NOSPACE:
return (ISC_R_NOMEMORY);
default:
return (errno != 0 ? isc_errno_toresult(errno) : ISC_R_IOERROR);
}
}
void
isc_globfree(glob_t *pglob) {
REQUIRE(pglob != NULL);
globfree(pglob);
}
#ifdef GLOB_WIN_IMPL
typedef struct file_path file_path_t;
struct file_path {
char *path;
ISC_LINK(file_path_t) link;
};
typedef ISC_LIST(file_path_t) file_list_t;
/* map a winapi error to a convenient errno code */
static int
map_error(DWORD win_err_code) {
switch (win_err_code) {
case ERROR_FILE_NOT_FOUND:
case ERROR_PATH_NOT_FOUND:
return (GLOB_NOMATCH);
case ERROR_ACCESS_DENIED:
return (EACCES);
case ERROR_NOT_ENOUGH_MEMORY:
return (GLOB_NOSPACE);
default:
return (EIO);
}
}
/* add file in directory dir, that matches glob expression
* provided in function glob(), to the linked list fl */
static int
append_file(isc_mem_t *mctx,
file_list_t *fl,
const char *dir,
const char *file,
size_t full_path_len)
{
file_path_t *fp = isc_mem_get(mctx, sizeof(file_path_t));
fp->path = isc_mem_get(mctx, full_path_len + 1);
_snprintf(fp->path, full_path_len + 1, "%s%s", dir, file);
ISC_LINK_INIT(fp, link);
ISC_LIST_PREPEND(*fl, fp, link);
}
/* sort files alphabetically case insensitive on windows */
static int
path_cmp(const void *path1, const void *path2) {
return _stricmp((const char *)path1, (const char *)path2);
}
static int
glob(const char *pattern, int flags, void *unused, glob_t *pglob) {
char path[MAX_PATH];
WIN32_FIND_DATAA find_data;;
HANDLE hnd;
REQUIRE(pattern != NULL);
REQUIRE(pglob != NULL);
UNUSED(flags);
UNUSED(unused);
pglob->mctx = NULL;
pglob->gl_pathc = 0;
pglob->gl_pathv = NULL;
hnd = FindFirstFileA(pattern, &find_data);
if (hnd == INVALID_HANDLE_VALUE) {
return (map_error(GetLastError()));
}
path[MAX_PATH - 1] = 0;
strncpy(path, pattern, MAX_PATH);
if (path[MAX_PATH - 1] != 0) {
errno = ENAMETOOLONG;
goto fail;
}
// strip filename from path.
size_t dir_len = strlen(path);
while (dir_len > 0 && path[dir_len - 1] != '/' && path[dir_len - 1] != '\\') {
dir_len--;
}
path[dir_len] = '\0';
isc_mem_create(&pglob->mctx);
pglob->reserved = isc_mem_get(pglob->mctx, sizeof(file_list_t));
size_t entries = 0;
do {
size_t file_len = strlen(find_data.cFileName);
size_t full_path_len = dir_len + file_len;
if (full_path_len > MAX_PATH) {
errno = ENAMETOOLONG;
goto fail;
}
append_file(pglob->mctx,
(file_list_t *)pglob->reserved,
path,
find_data.cFileName,
full_path_len);
entries++;
} while (FindNextFileA(hnd, &find_data));
FindClose(hnd);
pglob->gl_pathv = isc_mem_get(pglob->mctx, (entries + 1) * sizeof(char*));
pglob->gl_pathv[entries] = NULL;
pglob->gl_pathc = entries;
file_list_t *fl = (file_list_t *)pglob->reserved;
size_t e = 0;
file_path_t *fp;
for (fp = ISC_LIST_HEAD(*fl); fp != NULL; fp = ISC_LIST_NEXT(fp, link)) {
pglob->gl_pathv[e++] = fp->path;
}
qsort(pglob->gl_pathv, pglob->gl_pathc, sizeof(char*), path_cmp);
return (0);
fail:
int ec = errno;
FindClose(hnd);
if (pglob->mctx) {
globfree(pglob);
}
return ec;
}
void
globfree(glob_t* pglob) {
{
REQUIRE(pglob != NULL);
REQUIRE(pglob->mctx != NULL);
/* first free memory used by char ** gl_pathv */
if (pglob->gl_pathv) {
isc_mem_put(pglob->mctx,
pglob->gl_pathv,
(pglob->gl_pathc + 1) * sizeof(char *));
pglob->gl_pathv = NULL;
}
file_list_t *fl = (file_list_t *)pglob->reserved;
file_path_t *p, *next;
/* next free each individual file path string + nodes in list */
for (p = ISC_LIST_HEAD(*fl); p != NULL; p = next) {
next = ISC_LIST_NEXT(p, link);
isc_mem_put(pglob->mctx, p->path, strlen(p->path) + 1);
isc_mem_put(pglob->mctx, p, sizeof(file_path_t));
}
/* free linked list of files */
isc_mem_put(pglob->mctx, pglob->reserved, sizeof(file_list_t));
pglob->reserved = NULL;
pglob->gl_pathc = 0;
pglob->gl_pathv = NULL;
isc_mem_destroy(&pglob->mctx);
pglob->mctx = NULL;
}
#endif /* GLOB_WIN_IMPL */
-43
View File
@@ -1,43 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#ifndef ISC_GLOB_H
#define ISC_GLOB_H
#include <isc/lang.h>
#include <isc/result.h>
#if HAVE_GLOB_H
#include <glob.h>
#else
#include <stddef.h>
#include <isc/mem.h>
typedef struct {
size_t gl_pathc;
char **gl_pathv;
isc_mem_t *mctx;
void *reserved;
} glob_t;
#endif
ISC_LANG_BEGINDECLS
isc_result_t
isc_glob(const char *pattern, glob_t *pglob);
void
isc_globfree(glob_t *pglob);
ISC_LANG_ENDDECLS
#endif /* ISC_GLOB_H */
+4 -4
View File
@@ -75,22 +75,22 @@ typedef enum memory_order memory_order;
typedef struct atomic_int_fast32 {
isc_mutex_t m;
int32_t v;
int_fast32_t v;
} atomic_int_fast32_t;
typedef struct atomic_int_fast64 {
isc_mutex_t m;
int64_t v;
int_fast64_t v;
} atomic_int_fast64_t;
typedef struct atomic_uint_fast32 {
isc_mutex_t m;
uint32_t v;
uint_fast32_t v;
} atomic_uint_fast32_t;
typedef struct atomic_uint_fast64 {
isc_mutex_t m;
uint64_t v;
uint_fast64_t v;
} atomic_uint_fast64_t;
typedef struct atomic_bool_s {
+1 -2
View File
@@ -88,10 +88,9 @@
#define ISC_R_DISCQUOTA 66 /*%< disc quota */
#define ISC_R_DISCFULL 67 /*%< disc full */
#define ISC_R_DEFAULT 68 /*%< default */
#define ISC_R_IPV4PREFIX 69 /*%< IPv4 prefix */
/*% Not a result code: the number of results. */
#define ISC_R_NRESULTS 70
#define ISC_R_NRESULTS 69
ISC_LANG_BEGINDECLS
-16
View File
@@ -234,9 +234,6 @@ extern void mock_assert(const int result, const char* const expression,
#define _assert_int_not_equal(a, b, f, l) \
(((a) != (b)) ? (void)0 : (_assert_int_not_equal(a, b, f, l), abort()))
#else /* UNIT_TESTING */
#ifndef CPPCHECK
/*
* Assertions
*/
@@ -251,19 +248,6 @@ extern void mock_assert(const int result, const char* const expression,
/*% Invariant Assertion */
#define INVARIANT(e) ISC_INVARIANT(e)
#else /* CPPCHECK */
/*% Require Assertion */
#define REQUIRE(e) if (!(e)) abort()
/*% Ensure Assertion */
#define ENSURE(e) if (!(e)) abort()
/*% Insist Assertion */
#define INSIST(e) if (!(e)) abort()
/*% Invariant Assertion */
#define INVARIANT(e) if (!(e)) abort()
#endif /* CPPCHECK */
#endif /* UNIT_TESTING */
/*

Some files were not shown because too many files have changed in this diff Show More