]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agoMerge branch 'marka-cppcheck-fixes-v9_12-and-v9_14' into 'v9_14'
Mark Andrews [Fri, 4 Oct 2019 03:36:19 +0000 (23:36 -0400)] 
Merge branch 'marka-cppcheck-fixes-v9_12-and-v9_14' into 'v9_14'

Address cppcheck reports (v9_11/v9_14)

See merge request isc-projects/bind9!2342

6 years agoAddress cppcheck reports
Mark Andrews [Fri, 13 Sep 2019 06:06:34 +0000 (16:06 +1000)] 
Address cppcheck reports

6 years agoMerge branch 'marka-silence-clang-v9_14' into 'v9_14'
Mark Andrews [Fri, 4 Oct 2019 01:58:45 +0000 (21:58 -0400)] 
Merge branch 'marka-silence-clang-v9_14' into 'v9_14'

silence clang warning by using local variable.

See merge request isc-projects/bind9!2441

6 years agosilence clang warning by using local variable.
Mark Andrews [Tue, 1 Oct 2019 04:06:53 +0000 (14:06 +1000)] 
silence clang warning by using local variable.

'isc_commandline_index' is a global variable so it can theoretically
change result between if expressions.  Save 'argv[isc_commandline_index]'
to local variable 'arg1' and use 'arg1 == NULL' in if expressions
instead of 'argc < isc_commandline_index + 1'.  This allows clang
to correctly determine what code is reachable.

(cherry picked from commit 1b27ab8642a43617d1359375d1cff7afd5bd79e3)

6 years agoMerge branch 'ondrej/fix-docs-autoreconf-v9_14' into 'v9_14'
Ondřej Surý [Thu, 3 Oct 2019 14:08:05 +0000 (10:08 -0400)] 
Merge branch 'ondrej/fix-docs-autoreconf-v9_14' into 'v9_14'

Fix docs -> autoreconf dependencies in the .gitlab-ci.yml (v9_14)

See merge request isc-projects/bind9!2439

6 years agoFix the triggering rule for autoreconf job (take 2)
Ondřej Surý [Tue, 1 Oct 2019 14:42:33 +0000 (16:42 +0200)] 
Fix the triggering rule for autoreconf job (take 2)

6 years agoFix docs -> autoreconf dependencies in the .gitlab-ci.yml
Ondřej Surý [Tue, 1 Oct 2019 14:29:33 +0000 (16:29 +0200)] 
Fix docs -> autoreconf dependencies in the .gitlab-ci.yml

6 years agoMerge branch 'ondrej/enable-cppcheck-v9_14' into 'v9_14'
Ondřej Surý [Thu, 3 Oct 2019 12:20:18 +0000 (08:20 -0400)] 
Merge branch 'ondrej/enable-cppcheck-v9_14' into 'v9_14'

Enable Cppcheck for v9_14 branch

See merge request isc-projects/bind9!2432

6 years agoUse util/suppressions.txt for Cppcheck suppressions list
Ondřej Surý [Thu, 3 Oct 2019 12:02:08 +0000 (14:02 +0200)] 
Use util/suppressions.txt for Cppcheck suppressions list

6 years agolib/isc/tests/md_test.c: Silence sizeofFunctionCall Cppcheck
Ondřej Surý [Thu, 3 Oct 2019 08:21:04 +0000 (10:21 +0200)] 
lib/isc/tests/md_test.c: Silence sizeofFunctionCall Cppcheck

6 years agolib/isc/tests/hmac_test.c: Silence sizeofFunctionCall Cppcheck
Ondřej Surý [Thu, 3 Oct 2019 08:20:29 +0000 (10:20 +0200)] 
lib/isc/tests/hmac_test.c: Silence sizeofFunctionCall Cppcheck

6 years agolib/dns/zone.c: Fix invalid order of DbC checks that could cause dereference before...
Ondřej Surý [Thu, 3 Oct 2019 08:16:03 +0000 (10:16 +0200)] 
lib/dns/zone.c: Fix invalid order of DbC checks that could cause dereference before NULL check

6 years agolib/dns/sdlz.c: Use the referenced variable in the DbC check
Ondřej Surý [Thu, 3 Oct 2019 08:15:35 +0000 (10:15 +0200)] 
lib/dns/sdlz.c: Use the referenced variable in the DbC check

6 years agolib/dns/sdb.c: Fix invalid order of DbC checks that could cause dereference before...
Ondřej Surý [Thu, 3 Oct 2019 08:14:43 +0000 (10:14 +0200)] 
lib/dns/sdb.c: Fix invalid order of DbC checks that could cause dereference before NULL check

6 years agoRemove randomly scattered additional style check suppressions that caused unmatchedSu...
Ondřej Surý [Fri, 27 Sep 2019 10:48:23 +0000 (12:48 +0200)] 
Remove randomly scattered additional style check suppressions that caused unmatchedSuppression

(cherry picked from commit a0d3614a609bc9e5af39f2282daac78c40ab6363)

6 years agolib/ns/query.c: Fix invalid order of DbC checks that could cause dereference before...
Ondřej Surý [Fri, 27 Sep 2019 10:12:14 +0000 (12:12 +0200)] 
lib/ns/query.c: Fix invalid order of DbC checks that could cause dereference before NULL check

(cherry picked from commit d1f035bbba57df40407a8c1dfbebc15cf42eccf3)

6 years agolib/ns/interfacemgr.c: Fix invalid order of DbC checks that could cause dereference...
Ondřej Surý [Fri, 27 Sep 2019 10:11:16 +0000 (12:11 +0200)] 
lib/ns/interfacemgr.c: Fix invalid order of DbC checks that could cause dereference before NULL check

(cherry picked from commit 033f3eb58046f2f1f97d434bc3e7bdc6f2c15125)

6 years agolib/ns/client.c: Fix invalid order of DbC checks that could cause dereference before...
Ondřej Surý [Fri, 27 Sep 2019 10:10:44 +0000 (12:10 +0200)] 
lib/ns/client.c: Fix invalid order of DbC checks that could cause dereference before NULL check

(cherry picked from commit b4a42a286fd33ef1bdc6d8b74ade12e56da3b35c)

6 years agolib/isccfg/parser.c: Fix invalid order of DbC checks that could cause dereference...
Ondřej Surý [Fri, 27 Sep 2019 10:07:32 +0000 (12:07 +0200)] 
lib/isccfg/parser.c: Fix invalid order of DbC checks that could cause dereference before NULL check

(cherry picked from commit f855f09a55bd7e3ba96ae42a64a81737c3c36ac6)

6 years agolib/isccfg/aclconf.c: Suppress nullPointerRedundantCheck false positive
Ondřej Surý [Fri, 27 Sep 2019 10:06:16 +0000 (12:06 +0200)] 
lib/isccfg/aclconf.c: Suppress nullPointerRedundantCheck false positive

(cherry picked from commit 09232213d70c2a746f18ee0e9797883b9fe43f57)

6 years agolib/isc/unix/socket.c: Suppress preprocessorErrorDirective error from Cppcheck
Ondřej Surý [Fri, 27 Sep 2019 10:04:35 +0000 (12:04 +0200)] 
lib/isc/unix/socket.c: Suppress preprocessorErrorDirective error from Cppcheck

(cherry picked from commit 026cf2ff4f72adfdf17d4b45496a1d3866c068ab)

6 years agolib/isc/task.c: Fix invalid order of DbC checks that could cause dereference before...
Ondřej Surý [Fri, 27 Sep 2019 10:02:41 +0000 (12:02 +0200)] 
lib/isc/task.c: Fix invalid order of DbC checks that could cause dereference before NULL check

(cherry picked from commit c662969da190dfa186d9357b2d4454b571c2ed1a)

6 years agolib/isc/pkc11.c: Fix possible NULL pointer dereference in push_attribute()
Ondřej Surý [Fri, 27 Sep 2019 10:01:30 +0000 (12:01 +0200)] 
lib/isc/pkc11.c: Fix possible NULL pointer dereference in push_attribute()

(cherry picked from commit e8948fd9b4b8b188db2d51600dc01a46d57d4b5f)

6 years agolib/isc/buffer.c: Fix invalid order of DbC checks that could cause dereference before...
Ondřej Surý [Fri, 27 Sep 2019 09:53:49 +0000 (11:53 +0200)] 
lib/isc/buffer.c: Fix invalid order of DbC checks that could cause dereference before NULL check

(cherry picked from commit e9f30fc2115524fdef638bc33beaf00a56d27b70)

6 years agolib/dns/tsig.c: Suppress Cppcheck false positive error uninitStructMember
Ondřej Surý [Fri, 27 Sep 2019 09:51:15 +0000 (11:51 +0200)] 
lib/dns/tsig.c: Suppress Cppcheck false positive error uninitStructMember

(cherry picked from commit 8f2ad12d0a308a5f72f60148694976563c9a577d)

6 years agolib/dns/tests/rbt_serialize_test.c: Fix dereference before DbC check
Ondřej Surý [Fri, 27 Sep 2019 09:40:44 +0000 (11:40 +0200)] 
lib/dns/tests/rbt_serialize_test.c: Fix dereference before DbC check

(cherry picked from commit 14c174d9212f0c8c9598d21e205d5d7380c54969)

6 years agoInstead of declaring unused va_list, just don't declare it at all
Ondřej Surý [Fri, 27 Sep 2019 09:40:00 +0000 (11:40 +0200)] 
Instead of declaring unused va_list, just don't declare it at all

(cherry picked from commit 269d507cccab454bf221f03d83b6882668b41c33)

6 years agolib/dns/rdatalist.c: Fix dereference before DbC check
Ondřej Surý [Fri, 27 Sep 2019 09:37:27 +0000 (11:37 +0200)] 
lib/dns/rdatalist.c: Fix dereference before DbC check

(cherry picked from commit 5fc7e98d296f2c094b11cfed68becc60a73d1594)

6 years agolib/dns/rdata/*/*.c: Silence false positive nullPointerRedundantCheck warning from...
Ondřej Surý [Fri, 27 Sep 2019 08:40:51 +0000 (10:40 +0200)] 
lib/dns/rdata/*/*.c: Silence false positive nullPointerRedundantCheck warning from Cppcheck

Cppcheck gets confused by:

void bar(void *arg) {
    foo *data = arg;
    REQUIRE(source != NULL);
    REQUIRE(data->member != NULL);
}

and for consistency the DbC check needs to be changed to

void bar(void *arg) {
    foo *data = arg;
    REQUIRE(data != NULL);
    REQUIRE(data->member != NULL);
}

(cherry picked from commit 66af8713d8a4350780c060d517dea27d2c31dd08)

6 years agolib/dns/rdata.c: Silence false positive nullPointerRedundantCheck warning from Cppcheck
Ondřej Surý [Fri, 27 Sep 2019 08:38:18 +0000 (10:38 +0200)] 
lib/dns/rdata.c: Silence false positive nullPointerRedundantCheck warning from Cppcheck

(cherry picked from commit e68333aa67e304ff295820cadb7bbfb293e77111)

6 years agolib/dns/rbtdb.c: Add DbC check to safely dereference rbtdb in rbt_datafixer()
Ondřej Surý [Fri, 27 Sep 2019 08:35:49 +0000 (10:35 +0200)] 
lib/dns/rbtdb.c: Add DbC check to safely dereference rbtdb in rbt_datafixer()

(cherry picked from commit d508ce4036ce4431b8e6a58697cf890bed6db341)

6 years agolib/dns/rbt.c: Suppress nullPointerRedundantCheck warnings from Cppcheck
Ondřej Surý [Fri, 27 Sep 2019 08:28:30 +0000 (10:28 +0200)] 
lib/dns/rbt.c: Suppress nullPointerRedundantCheck warnings from Cppcheck

(cherry picked from commit 8be5c3fcfcbe7ed2dee3eaf508d0a674141636fa)

6 years agolib/dns/name.c: Fix dereference before DbC check reported by Cppcheck
Ondřej Surý [Fri, 27 Sep 2019 08:05:27 +0000 (10:05 +0200)] 
lib/dns/name.c: Fix dereference before DbC check reported by Cppcheck

(cherry picked from commit 0f5860aad3a131d22b6fb1ffc97da83a1b1bca21)

6 years agolib/dns/gssapi_link.c: Fix %d -> %u formatting when printing unsigned integers
Ondřej Surý [Fri, 27 Sep 2019 08:04:26 +0000 (10:04 +0200)] 
lib/dns/gssapi_link.c: Fix %d -> %u formatting when printing unsigned integers

(cherry picked from commit cea871464fe56b951dfde5a33dda962551c919b1)

6 years agoFix passing NULL after the last typed argument to a variadic function leads to undefi...
Ondřej Surý [Fri, 27 Sep 2019 08:00:46 +0000 (10:00 +0200)] 
Fix passing NULL after the last typed argument to a variadic function leads to undefined behaviour.

From Cppcheck:

Passing NULL after the last typed argument to a variadic function leads to
undefined behaviour.  The C99 standard, in section 7.15.1.1, states that if the
type used by va_arg() is not compatible with the type of the actual next
argument (as promoted according to the default argument promotions), the
behavior is undefined.  The value of the NULL macro is an implementation-defined
null pointer constant (7.17), which can be any integer constant expression with
the value 0, or such an expression casted to (void*) (6.3.2.3). This includes
values like 0, 0L, or even 0LL.In practice on common architectures, this will
cause real crashes if sizeof(int) != sizeof(void*), and NULL is defined to 0 or
any other null pointer constant that promotes to int.  To reproduce you might be
able to use this little code example on 64bit platforms. If the output includes
"ERROR", the sentinel had only 4 out of 8 bytes initialized to zero and was not
detected as the final argument to stop argument processing via
va_arg(). Changing the 0 to (void*)0 or 0L will make the "ERROR" output go away.

void f(char *s, ...) {
    va_list ap;
    va_start(ap,s);
    for (;;) {
        char *p = va_arg(ap,char*);
        printf("%018p, %s\n", p, (long)p & 255 ? p : "");
        if(!p) break;
    }
    va_end(ap);
}

void g() {
    char *s2 = "x";
    char *s3 = "ERROR";

    // changing 0 to 0L for the 7th argument (which is intended to act as
    // sentinel) makes the error go away on x86_64
    f("first", s2, s2, s2, s2, s2, 0, s3, (char*)0);
}

void h() {
    int i;
    volatile unsigned char a[1000];
    for (i = 0; i<sizeof(a); i++)
        a[i] = -1;
}

int main() {
    h();
    g();
    return 0;
}

(cherry picked from commit d8879af877c232bd15d0011e65c8759f36a09901)

6 years agolib/dns/ecdb.c: Fix couple of DbC conditions reported by Cppcheck
Ondřej Surý [Fri, 27 Sep 2019 07:55:19 +0000 (09:55 +0200)] 
lib/dns/ecdb.c: Fix couple of DbC conditions reported by Cppcheck

(cherry picked from commit 91cc6b9eb9242da5eb188462725b3553fd372360)

6 years agoFix the constification of the dns_name_t * result variable for dns_tsig_identity()
Ondřej Surý [Fri, 27 Sep 2019 07:49:31 +0000 (09:49 +0200)] 
Fix the constification of the dns_name_t * result variable for dns_tsig_identity()

(cherry picked from commit fa7475b77a27d326be15a4c4b987f1f5388272dc)

6 years agobin/named/zoneconf.c: Reset dns_name_t *tsig on every view iteration
Ondřej Surý [Fri, 27 Sep 2019 07:39:35 +0000 (09:39 +0200)] 
bin/named/zoneconf.c: Reset dns_name_t *tsig on every view iteration

(cherry picked from commit 43925b2a8b1b17d1cbf7940f9ffa347889e181e9)

6 years agoChange dns_tsigkey_identity from macro to a function and const argument and result
Ondřej Surý [Fri, 27 Sep 2019 07:39:02 +0000 (09:39 +0200)] 
Change dns_tsigkey_identity from macro to a function and const argument and result

(cherry picked from commit 2e304b0b7f5f08d01572cc855deadb1026e15ca8)

6 years agoConstify dns_name_t *signer argument to dns_acl_allowed()
Ondřej Surý [Fri, 27 Sep 2019 07:38:18 +0000 (09:38 +0200)] 
Constify dns_name_t *signer argument to dns_acl_allowed()

(cherry picked from commit 4d2697b31c2a29b5e9027294ad9fa0940715e5b5)

6 years agobin/named/server.c: Fix couple of DbC conditions reported by Cppcheck
Ondřej Surý [Fri, 27 Sep 2019 07:19:36 +0000 (09:19 +0200)] 
bin/named/server.c: Fix couple of DbC conditions reported by Cppcheck

(cherry picked from commit 476277a6e66086c1148d57eb1f43cf75bcd5539f)

6 years agobin/dig/dighost.c: Fix REQUIRE(!= NULL) condition after the variable has been derefer...
Ondřej Surý [Fri, 27 Sep 2019 06:48:06 +0000 (08:48 +0200)] 
bin/dig/dighost.c: Fix REQUIRE(!= NULL) condition after the variable has been dereferenced

(cherry picked from commit 9366ca769f2f6d6ede4e12fe919179f4a409a9e6)

6 years agobin/delv/delv.c: Fix invalid logic operation in REQUIRE() condition
Ondřej Surý [Fri, 27 Sep 2019 06:46:03 +0000 (08:46 +0200)] 
bin/delv/delv.c: Fix invalid logic operation in REQUIRE() condition

(cherry picked from commit 9ab16d10d48e4476adfa54807c62fe69cee96526)

6 years agoAdd Cppcheck job to the CI
Ondřej Surý [Thu, 26 Sep 2019 12:47:04 +0000 (14:47 +0200)] 
Add Cppcheck job to the CI

This MR changes the default Debian sid build to wrap make with bear
that creates compilation database and use the compilation database
to run Cppcheck on the source files systematically.

The job is currently set to be allowed to fail as it will take some
time to fix all the Cppcheck detected issues.

(cherry picked from commit f55dc51f42576fbbc5912a3fbb77e156158b844b)

6 years agoMerge branch '1191-qmin-fetch-failure-v9_14' into 'v9_14'
Evan Hunt [Wed, 2 Oct 2019 04:45:55 +0000 (00:45 -0400)] 
Merge branch '1191-qmin-fetch-failure-v9_14' into 'v9_14'

SERVFAIL if a prior qmin fetch has not been canceled when a new one starts

See merge request isc-projects/bind9!2426

6 years agoCHANGES
Evan Hunt [Wed, 2 Oct 2019 03:47:45 +0000 (20:47 -0700)] 
CHANGES

(cherry picked from commit 1d741c5c0fdb70198ca1f5c0834c54eda4bfd90b)

6 years agoSERVFAIL if a prior qmin fetch has not been canceled when a new one starts
Evan Hunt [Fri, 27 Sep 2019 20:28:09 +0000 (13:28 -0700)] 
SERVFAIL if a prior qmin fetch has not been canceled when a new one starts

(cherry picked from commit 488cb4da1051b3829e20ba3a47d8c11a91eccbcf)

6 years agoMerge branch '846-dig-idn-alabel-fallback-v9_14' into 'v9_14'
Ondřej Surý [Mon, 30 Sep 2019 10:51:14 +0000 (06:51 -0400)] 
Merge branch '846-dig-idn-alabel-fallback-v9_14' into 'v9_14'

Resolve "dig cannot display ACE query if locale is not unicode"

See merge request isc-projects/bind9!2413

6 years agoAdd CHANGES for GL #846
Ondřej Surý [Mon, 30 Sep 2019 07:10:39 +0000 (09:10 +0200)] 
Add CHANGES for GL #846

(cherry picked from commit dccec984c032b09008a569f3e6a8efacc633c5ef)

6 years agoTest of valid A-label in locale that cannot display it only with non-broken idn2
Ondřej Surý [Mon, 30 Sep 2019 07:04:59 +0000 (09:04 +0200)] 
Test of valid A-label in locale that cannot display it only with non-broken idn2

The libidn2 library on Ubuntu Bionic is broken and idn2_to_unicode_8zlz() does't
fail when it should.  This commit ensures that we don't run the system test for
valid A-label in locale that cannot display with the buggy libidn2 as it would
break the tests.

(cherry picked from commit c42e3583f932412346bb977645c401698f9c114b)

6 years agoEmit warning on IDN output failure
Petr Menšík [Wed, 30 Jan 2019 14:38:54 +0000 (15:38 +0100)] 
Emit warning on IDN output failure

Warning is emitted before any dig headers.

(cherry picked from commit 21371abd729e1dac0565425f1d5330c181c401ee)

6 years agoModify idna test to fallback to ACE
Petr Menšík [Tue, 29 Jan 2019 18:11:19 +0000 (19:11 +0100)] 
Modify idna test to fallback to ACE

Test valid A-label on input would be displayed as A-label on output if
locale does not allow U-label.

(cherry picked from commit ac0cf85f094e5ef1ea19164b59674a1cfff6e65c)

6 years agoFallback to ASCII on output IDN conversion error
Petr Menšík [Tue, 29 Jan 2019 17:07:44 +0000 (18:07 +0100)] 
Fallback to ASCII on output IDN conversion error

It is possible dig used ACE encoded name in locale, which does not
support converting it to unicode. Instead of fatal error, fallback to
ACE name on output.

(cherry picked from commit c8a871e908f932d35e42a363c1f571fbf38c8982)

6 years agoMerge branch 'marka-correct-list-v9_14' into 'v9_14'
Mark Andrews [Sun, 29 Sep 2019 01:19:40 +0000 (21:19 -0400)] 
Merge branch 'marka-correct-list-v9_14' into 'v9_14'

use correct list

See merge request isc-projects/bind9!2411

6 years agoAddress cut-and-paste error where list name was not changed in one instance for chang...
Mark Andrews [Fri, 27 Sep 2019 23:59:27 +0000 (09:59 +1000)] 
Address cut-and-paste error where list name was not changed in one instance for change 5292.

(cherry picked from commit 9cd308ac5e73337cda3be638ec18efc138ddacdb)

6 years agoMerge branch '147-add-windows-to-gitlab-ci-v9_14' into 'v9_14'
Michał Kępień [Fri, 27 Sep 2019 11:18:10 +0000 (07:18 -0400)] 
Merge branch '147-add-windows-to-gitlab-ci-v9_14' into 'v9_14'

[v9_14] Add Windows to GitLab CI

See merge request isc-projects/bind9!2408

6 years agoUpdate Windows-specific documentation
Michał Kępień [Thu, 26 Sep 2019 13:11:15 +0000 (15:11 +0200)] 
Update Windows-specific documentation

Bring the files describing Windows-specific aspects of building and
installing BIND up to date.  Remove the parts which are either outdated
(e.g. 32-bit build instructions), already included elsewhere (e.g. the
list of Windows systems BIND is known to run on), or inconvenient to
keep up to date in the long run (e.g. ARM chapter numbers).

(cherry picked from commit 646fcb733e1da88e488fa665b8b830e7990746fa)

6 years agoAdd Windows to GitLab CI
Michał Kępień [Thu, 26 Sep 2019 13:11:15 +0000 (15:11 +0200)] 
Add Windows to GitLab CI

Ensure BIND can be tested on Windows in GitLab to more quickly catch
build and test errors on that operating system.

Some notes:

  - While build jobs are triggered for all pipelines, system test jobs
    are not - due to the time it takes to run the complete system test
    suite on Windows (about 20 minutes), the latter are only run for
    pipelines created through GitLab's web interface and for pipelines
    created for Git tags.

  - Only the "Release" build configuration is currently used.  Adding
    "Debug" builds is a matter of extending .gitlab-ci.yml, but it was
    not done for the time being due to questionable usefulness of
    performing such builds in GitLab CI.

  - Only a 64-bit build is performed.  Adding support for 32-bit builds
    is not planned to be implemented.

  - Unit tests are still not run on Windows, but adding support for that
    is on the roadmap.

  - All Windows GitLab CI jobs are run inside Windows Server containers,
    using the Custom executor feature of GitLab Runner as Windows Server
    2016 is not supported by GitLab Runner's native Docker on Windows
    executor and Windows Server 2019 is not yet widely available from
    hosting providers.

  - The Windows Docker image used by GitLab CI is not stored in the
    GitLab Container Registry as it is over 27 GB in size and thus
    passing it between GitLab and its runners is impractical.

  - There is no vcvarsall.bat variant written in PowerShell and batch
    scripts are no longer supported by GitLab Runner Custom executor, so
    the environment variables set by vcvarsall.bat are injected back
    into the PowerShell environment by processing the output of "set".

  - Visual Studio parallel builds are a bit different than "make -jX"
    builds as parallelization happens in two tiers: project parallelism
    (controlled by the "/maxCpuCount" msbuild.exe switch) and compiler
    parallelism (controlled by the "/MP" cl.exe switch).  To limit the
    total number of compiler processes spawned concurrently to a value
    similar to the one used for Unix builds, msbuild.exe is allowed to
    build at most 2 projects at once, each of which can spawn up to half
    of BUILD_PARALLEL_JOBS worth of compiler processes.  Using such
    parameters is a fairly arbitrary decision taken to solve the
    trade-off between compilation speed and runner load.

  - Configuring network addresses in Windows Server containers is
    tricky.  Adding 10.53.0.1/24 and similar addresses to the vEthernet
    interface created by Docker never causes ifconfig.bat to fail, but
    in fact only one container can have any given IP address configured
    at any given time (the request to add the same address in another
    container is silently ignored).  Thus, in order to allow multiple
    system test jobs to be run in parallel, the addresses used in system
    tests are configured on the loopback interfaces.  Interestingly
    enough, the addresses set on the loopback interfaces... persist
    between containers.  Fortunately, this is acceptable for the time
    being and only requires ifconfig.bat failures to be ignored (as
    ifconfig.bat will fail if it attempts to configure an already
    existing address on an interface).  We also need to wait for a brief
    moment after calling ifconfig.bat as the addresses the latter
    attempts to configure may not be immediately available after it
    returns (and that causes runall.sh to error out).  Finally, for some
    reason we also need to signal that the DNS servers on each loopback
    interface are to be configured using DHCP or else ifconfig.bat will
    fail to add the requested addresses.

  - Since named.pid files created by named instances used in system
    tests contain Windows PIDs instead of Cygwin PIDs and various
    versions of Cygwin "kill" react differently when passed Windows PIDs
    without the -W switch, all "kill" invocations in GitLab CI need to
    use that switch (otherwise they would print error messages which
    would cause stop.pl to assume the process being killed died
    prematurely).  However, to preserve compatibility with older Cygwin
    versions used in our other Windows test environments, we alter the
    relevant scripts "on the fly" rather than in the Git repository.

  - In the containers used for running system tests, Windows Error
    Reporting is configured to automatically create crash dumps in
    C:\CrashDumps.  This directory is examined after the test suite is
    run to ensure no crashes went under stop.pl's radar.

(cherry picked from commit ca36405a3d0b59f2f809139ffb92a3bfefced8ad)

6 years agoFix the "statschannel" system test on Windows
Michał Kępień [Thu, 26 Sep 2019 13:11:15 +0000 (15:11 +0200)] 
Fix the "statschannel" system test on Windows

The SYSTEMTESTTOP variable is set by bin/tests/system/run.sh.  When
system tests are run on Windows, that variable will contain an absolute
Cygwin path.  In the case of the "statschannel" system test, using the
unmodified SYSTEMTESTTOP variable in tests.sh causes the RNDCCMD
variable to contain an invocation of a native Windows application with
an absolute Cygwin path passed as a parameter, which prevents rndc from
working in that system test.  Until we have a cleaner solution, override
SYSTEMTESTTOP with a relative path to work around the issue and thus fix
the "statschannel" system test on Windows.

(cherry picked from commit 4deb2a48d93b5186e958ddd6a8f5ffc80962a5ff)

6 years agoFix system test error reporting on Windows
Michał Kępień [Thu, 26 Sep 2019 13:11:15 +0000 (15:11 +0200)] 
Fix system test error reporting on Windows

Make sure the CYGWIN environment variable is set whenever system tests
are run on Windows to prevent stop.pl from making incorrect assumptions
about the environment it is running in, which triggers e.g. false
reports about named instances crashing on shutdown when system tests are
run on Windows.  This issue has not been caught earlier because the
CYGWIN environment variable was incidentally being set on a higher level
in our Windows test environments.

Error reporting for parallel system tests on Windows has been broken all
along: since all parallel.mk targets generated by parallel.sh pipe their
output through "tee", the return code from run.sh is lost and thus
running "make -f parallel.mk check" will not yield a non-zero return
code if some system tests fail.  The same applies to runsequential.sh.
Yet, runall.sh on Windows only sets its return code to a non-zero value
if either "make -f parallel.mk check" or runsequential.sh returns a
non-zero return code.  Fix by making runall.sh yield a non-zero return
code when testsummary.sh fails, which is the same approach as the one
used in the "test" target in bin/tests/system/Makefile.

(cherry picked from commit fed397c04bb3cfda453dc9d7f2f06b5164726047)

6 years agoMake VS solution upgrading unnecessary
Michał Kępień [Thu, 26 Sep 2019 13:11:15 +0000 (15:11 +0200)] 
Make VS solution upgrading unnecessary

Until now, the build process for BIND on Windows involved upgrading the
solution file to the version of Visual Studio used on the build host.
Unfortunately, the executable used for that (devenv.exe) is not part of
Visual Studio Build Tools and thus there is no clean way to make that
executable part of a Windows Server container.

Luckily, the solution upgrade process boils down to just adding XML tags
to Visual Studio project files and modifying certain XML attributes - in
files which we pregenerate anyway using win32utils/Configure.  Thus,
extend win32utils/Configure with three new command line parameters that
enable it to mimic what "devenv.exe bind9.sln /upgrade" does.  This
makes the devenv.exe build step redundant and thus facilitates building
BIND in Windows Server containers.

(cherry picked from commit 0476e8f1ac81b2ac131e35b766c4c5eef9703e21)

6 years agoEnable building dnssec-cds.exe
Michał Kępień [Thu, 26 Sep 2019 13:11:15 +0000 (15:11 +0200)] 
Enable building dnssec-cds.exe

Build configuration for the dnssec-cds Visual Studio project is absent
from the solution file template, which means the solution needs to be
upgraded using "devenv bind9.sln /upgrade" in order for the dnssec-cds
project to be built.  Add the build configuration for dnssec-cds to the
solution file template so that upgrading the solution is not necessary
for building that project.

(cherry picked from commit 1d5259b0a0482846e7e5e48e789bb2bee3d6e7fb)

6 years agoDrop named-checkzone dependency on libbind9
Michał Kępień [Thu, 26 Sep 2019 13:11:15 +0000 (15:11 +0200)] 
Drop named-checkzone dependency on libbind9

named-checkzone does not use libbind9.  Update the Visual Studio project
file template for named-checkzone to reflect that, thus preventing
compilation issues during parallel builds.

(cherry picked from commit 918ebd9830d108d3624636be2e1e3792e420bd3e)

6 years agoAdd missing nsupdate dependency on libirs
Michał Kępień [Thu, 26 Sep 2019 13:11:15 +0000 (15:11 +0200)] 
Add missing nsupdate dependency on libirs

When commit 8eb88aafee951859264e36c315b1289cd8c2088b removed liblwres,
it also modified nsupdate to use libirs instead of liblwres, but the
Visual Studio project files were not updated to reflect that change.
Make sure the nsupdate Visual Studio project depends on the libirs
project to prevent compilation issues during parallel builds.

(cherry picked from commit de1859422ec4ff573df1bce85b6e0a687c0f9a6c)

6 years agoMerge branch 'marka-win32-vsconf-v9_14' into 'v9_14'
Michał Kępień [Fri, 27 Sep 2019 07:15:19 +0000 (03:15 -0400)] 
Merge branch 'marka-win32-vsconf-v9_14' into 'v9_14'

[v9_14] allow VSCONF to be overridden at runtime

See merge request isc-projects/bind9!2406

6 years agoallow VSCONF to be overridden at runtime
Mark Andrews [Thu, 5 Sep 2019 04:31:04 +0000 (14:31 +1000)] 
allow VSCONF to be overridden at runtime

(cherry picked from commit 2433e3e808ebcec024896a14bb9134ff8d5830d4)

6 years agoMerge branch 'marka-resolver-fix-v9_14' into 'v9_14'
Mark Andrews [Fri, 27 Sep 2019 07:07:43 +0000 (03:07 -0400)] 
Merge branch 'marka-resolver-fix-v9_14' into 'v9_14'

use test specific shell variables

See merge request isc-projects/bind9!2388

6 years agouse test specific shell variables
Mark Andrews [Tue, 24 Sep 2019 03:11:08 +0000 (13:11 +1000)] 
use test specific shell variables

(cherry picked from commit 4a5400c1b70b0b95e41cb87a90b6c09bc0eebe01)

6 years agoMerge branch 'ondrej/fix-clang-10-error-v9_14' into 'v9_14'
Ondřej Surý [Thu, 26 Sep 2019 13:25:44 +0000 (09:25 -0400)] 
Merge branch 'ondrej/fix-clang-10-error-v9_14' into 'v9_14'

Silence false positive warning from Clang 10 in random_test.c

See merge request isc-projects/bind9!2405

6 years agoSilence false positive warning from Clang 10 in random_test.c
Ondřej Surý [Thu, 26 Sep 2019 12:55:53 +0000 (14:55 +0200)] 
Silence false positive warning from Clang 10 in random_test.c

(cherry picked from commit 9ff02c81704b864bfea963cfaa0f83e6b0410554)

6 years agoMerge branch 'michal/prevent-unbuffered-stderr-io-on-windows-v9_14' into 'v9_14'
Michał Kępień [Thu, 26 Sep 2019 12:00:54 +0000 (08:00 -0400)] 
Merge branch 'michal/prevent-unbuffered-stderr-io-on-windows-v9_14' into 'v9_14'

[v9_14] Prevent unbuffered stderr I/O on Windows

See merge request isc-projects/bind9!2401

6 years agoPrevent unbuffered stderr I/O on Windows
Michał Kępień [Thu, 26 Sep 2019 11:53:03 +0000 (13:53 +0200)] 
Prevent unbuffered stderr I/O on Windows

Make stderr fully buffered on Windows to improve named performance when
it is logging to stderr, which happens e.g. in system tests.  Note that:

  - line buffering (_IOLBF) is unavailable on Windows,

  - fflush() is called anyway after each log message gets written to the
    default stderr logging channels created by libisc.

(cherry picked from commit c72da3497d821c06a9b641b1c8544f957c726238)

6 years agoMerge branch '1246-fix-stdatomic-shim-for-win32-v9_14' into 'v9_14'
Ondřej Surý [Thu, 26 Sep 2019 11:43:16 +0000 (07:43 -0400)] 
Merge branch '1246-fix-stdatomic-shim-for-win32-v9_14' into 'v9_14'

Resolve "Add atomic_fetch_add and atomic_fetch_or shims"

See merge request isc-projects/bind9!2399

6 years agoFix the wrong function for the atomic_fetch_add_explicit64 shim on non-WIN64 build
Ondřej Surý [Thu, 4 Jul 2019 09:04:29 +0000 (11:04 +0200)] 
Fix the wrong function for the atomic_fetch_add_explicit64 shim on non-WIN64 build

6 years agoMerge branch 'michal/prevent-cygwin-from-concealing-non-abort-crashes-v9_14' into...
Michał Kępień [Thu, 26 Sep 2019 08:38:08 +0000 (04:38 -0400)] 
Merge branch 'michal/prevent-cygwin-from-concealing-non-abort-crashes-v9_14' into 'v9_14'

Prevent Cygwin from concealing non-abort() crashes

See merge request isc-projects/bind9!2394

6 years agoPrevent Cygwin from concealing non-abort() crashes
Michał Kępień [Thu, 26 Sep 2019 08:34:01 +0000 (10:34 +0200)] 
Prevent Cygwin from concealing non-abort() crashes

BIND system tests are run in a Cygwin environment.  Apparently Cygwin
shell sets the SEM_NOGPFAULTERRORBOX bit in its process error mode which
is then inherited by all spawned child processes.  This bit prevents the
Windows Error Reporting dialog from being displayed, which I assume is
part of an effort to contain memory handling errors triggered by Cygwin
binaries in the Cygwin environment.  Unfortunately, this also prevents
automatic crash dump creation by Windows Error Reporting and Cygwin
itself does not handle memory errors in native Windows processes spawned
from a Cygwin shell.

Fix by clearing the SEM_NOGPFAULTERRORBOX bit inside named if it is
started in a Cygwin environment, thus overriding the Cygwin-set process
error mode in order to enable Windows Error Reporting to handle all
named crashes.

(cherry picked from commit 3d4b17806f96762b08ba94382c8a5fbfefde0a87)

6 years agoMerge branch '1245-properly-initialize-libxml2-v9_14' into 'v9_14'
Michał Kępień [Thu, 26 Sep 2019 08:31:55 +0000 (04:31 -0400)] 
Merge branch '1245-properly-initialize-libxml2-v9_14' into 'v9_14'

[v9_14] Properly initialize libxml2

See merge request isc-projects/bind9!2392

6 years agoAdd CHANGES entry
Michał Kępień [Thu, 26 Sep 2019 08:20:26 +0000 (10:20 +0200)] 
Add CHANGES entry

5293. [bug] On Windows, named crashed upon any attempt to fetch XML
statistics from it. [GL #1245]

(cherry picked from commit b5bcd4b8d64301e3c10c1bfadfda26fb53e4a4b0)

6 years agoProperly initialize libxml2
Michał Kępień [Thu, 26 Sep 2019 08:20:26 +0000 (10:20 +0200)] 
Properly initialize libxml2

When libxml2 is to be used in a multi-threaded application, the
xmlInitThreads() function must be called before any other libxml2
function.  This function does different things on various platforms and
thus one can get away without calling it on Unix systems, but not on
Windows, where it initializes critical section objects used for
synchronizing access to data structures shared between threads.  Add the
missing xmlInitThreads() call to prevent crashes on affected systems.

Also add a matching xmlCleanupThreads() call to properly release the
resources set up by xmlInitThreads().

(cherry picked from commit a3c0b00ef6b37e51e9c0075a8afffb8e1ff3398c)

6 years agoMerge branch '1205-named-crashes-when-setting-nsec3param-v9_14' into 'v9_14'
Mark Andrews [Tue, 24 Sep 2019 03:06:24 +0000 (23:06 -0400)] 
Merge branch '1205-named-crashes-when-setting-nsec3param-v9_14' into 'v9_14'

Resolve "named crashes when setting nsec3param"

See merge request isc-projects/bind9!2379

6 years agoadd CHANGES
Mark Andrews [Tue, 24 Sep 2019 00:48:59 +0000 (10:48 +1000)] 
add CHANGES

(cherry picked from commit 31c8f66f258bafc439b866f8b3c41de36df4e43f)

6 years agoQueue nsec3param setting until receive_secure_serial has completed.
Mark Andrews [Fri, 6 Sep 2019 05:34:38 +0000 (15:34 +1000)] 
Queue nsec3param setting until receive_secure_serial has completed.

(cherry picked from commit 456888c00fe5a9109bb9710724d8a4056b8f04a5)

6 years agoMove dns_zone_setdb() to after the db is created.
Mark Andrews [Wed, 4 Sep 2019 04:02:33 +0000 (14:02 +1000)] 
Move dns_zone_setdb() to after the db is created.

Addresses the database changing w/o the changes being done under task lock.
Fix: build the database before assigning it to the zone.

(cherry picked from commit 4e686f40e0aee0ad96ce672cab09d5ac938276ab)

6 years agoMerge branch 'michal/run-freebsd-jobs-automatically-for-all-pipelines-v9_14' into...
Michał Kępień [Tue, 17 Sep 2019 18:26:16 +0000 (14:26 -0400)] 
Merge branch 'michal/run-freebsd-jobs-automatically-for-all-pipelines-v9_14' into 'v9_14'

[v9_14] Run FreeBSD jobs automatically for all pipelines

See merge request isc-projects/bind9!2353

6 years agoRun FreeBSD jobs automatically for all pipelines
Michał Kępień [Tue, 17 Sep 2019 18:24:12 +0000 (20:24 +0200)] 
Run FreeBSD jobs automatically for all pipelines

No problems have been observed on the FreeBSD GitLab CI runner during
the burn-in period, when FreeBSD jobs needed to be triggered manually.
Thus, make the FreeBSD jobs run automatically along other GitLab CI
jobs.

(cherry picked from commit f7bc95409da869e50803c632450050d4eb0fbfed)

6 years agoMerge branch 'mnowak/Red_Hat_find_docbook-xsl-v9_14' into 'v9_14'
Michal Nowak [Tue, 17 Sep 2019 16:07:26 +0000 (12:07 -0400)] 
Merge branch 'mnowak/Red_Hat_find_docbook-xsl-v9_14' into 'v9_14'

Find docbook-xsl and dblatex templates on Red Hat/Fedora

See merge request isc-projects/bind9!2351

6 years agoRemove unused configure checks for dblatex
Michal Nowak [Tue, 17 Sep 2019 06:01:41 +0000 (08:01 +0200)] 
Remove unused configure checks for dblatex

(cherry picked from commit c871dda0aad00f9c829a83dc058148a0492a486e)

6 years agoFind docbook-xsl and dblatex templates on Red Hat/Fedora
Michal Nowak [Mon, 9 Sep 2019 12:21:19 +0000 (14:21 +0200)] 
Find docbook-xsl and dblatex templates on Red Hat/Fedora

`/usr/share/sgml/docbook/xsl-stylesheets` and `/usr/share/dblatex` are
places where docbook-style-xsl and, respectively, dblatex packages on
Red Hat systems put their XSL templates. Unless we hint this place it
has to be added to `./configure` manually (`--with-docbook-xsl=...`):
https://src.fedoraproject.org/rpms/bind/blob/master/f/bind.spec#_691.

On Fedora 30:

Before
```
./configure
...
checking for Docbook-XSL path... auto
checking for html/docbook.xsl... "not found"
checking for xhtml/docbook.xsl... "not found"
checking for manpages/docbook.xsl... "not found"
checking for html/chunk.xsl... "not found"
checking for xhtml/chunk.xsl... "not found"
checking for html/chunktoc.xsl... "not found"
checking for xhtml/chunktoc.xsl... "not found"
checking for html/maketoc.xsl... "not found"
checking for xhtml/maketoc.xsl... "not found"
checking for xsl/docbook.xsl... "not found"
checking for xsl/latex_book_fast.xsl... "not found"
```

After:
```
./configure
...
checking for Docbook-XSL path... auto
checking for html/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl
checking for xhtml/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl
checking for manpages/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl
checking for html/chunk.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl
checking for xhtml/chunk.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunk.xsl
checking for html/chunktoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/chunktoc.xsl
checking for xhtml/chunktoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunktoc.xsl
checking for html/maketoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/maketoc.xsl
checking for xhtml/maketoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/maketoc.xsl
checking for xsl/docbook.xsl... /usr/share/dblatex/xsl/docbook.xsl
checking for xsl/latex_book_fast.xsl... /usr/share/dblatex/xsl/latex_book_fast.xsl
```

(cherry picked from commit 0055b9616e00c6af4fc6116baae99bd80616cfab)

6 years agoMerge branch 'ondrej/improve-flycheck-configuration-v9_14' into 'v9_14'
Ondřej Surý [Tue, 17 Sep 2019 11:31:08 +0000 (07:31 -0400)] 
Merge branch 'ondrej/improve-flycheck-configuration-v9_14' into 'v9_14'

Remove the current directory from the flycheck configuration

See merge request isc-projects/bind9!2349

6 years agoRemove the current directory from the flycheck configuration
Ondřej Surý [Tue, 17 Sep 2019 11:03:57 +0000 (13:03 +0200)] 
Remove the current directory from the flycheck configuration

6 years agoMerge branch 'mnowak_README_fixes-v9_14' into 'v9_14'
Michal Nowak [Mon, 16 Sep 2019 05:46:46 +0000 (01:46 -0400)] 
Merge branch 'mnowak_README_fixes-v9_14' into 'v9_14'

Various README.md and README fixes

See merge request isc-projects/bind9!2337

6 years agoVarious README.md and README fixes
Michal Nowak [Mon, 9 Sep 2019 07:35:02 +0000 (09:35 +0200)] 
Various README.md and README fixes

Fixing typos, typographical glitches. Added backticks around binaries,
modules, and libraries so it's more consistent. Added a paragraph with
ISC Security Policy.

(cherry picked from commit 4e2fdd7ee910e2dbffc0754b494129ae8ccda4c3)

6 years agoMerge branch 'marka-win32-fixup-v9_11-v9_14' into 'v9_14'
Mark Andrews [Fri, 13 Sep 2019 04:31:22 +0000 (00:31 -0400)] 
Merge branch 'marka-win32-fixup-v9_11-v9_14' into 'v9_14'

reinstate error handler

See merge request isc-projects/bind9!2341

6 years agoreinstate error handler
Mark Andrews [Fri, 13 Sep 2019 04:17:32 +0000 (14:17 +1000)] 
reinstate error handler

(cherry picked from commit 7fb0a0db53d7be30500ecf32d9953564676516c9)

6 years agoMerge branch 'marka-win32-fixup-v9_11-v9_14' into 'v9_14'
Mark Andrews [Fri, 13 Sep 2019 04:28:01 +0000 (00:28 -0400)] 
Merge branch 'marka-win32-fixup-v9_11-v9_14' into 'v9_14'

win32 fixup v9_11

See merge request isc-projects/bind9!2340

6 years agodeclare alloc_failure
Mark Andrews [Fri, 13 Sep 2019 03:57:41 +0000 (13:57 +1000)] 
declare alloc_failure

(cherry picked from commit 0d23bc5b55c64e7d1998a6b6392e9be50e5d2037)

6 years agodeclare result
Mark Andrews [Fri, 13 Sep 2019 03:48:20 +0000 (13:48 +1000)] 
declare result

(cherry picked from commit 9ee27573afabac963ceb54dff032821acca25bab)

6 years agoMerge branch 'michal/add-freebsd-to-ci-v9_14' into 'v9_14'
Michał Kępień [Thu, 12 Sep 2019 13:23:38 +0000 (09:23 -0400)] 
Merge branch 'michal/add-freebsd-to-ci-v9_14' into 'v9_14'

[v9_14] Add FreeBSD to CI

See merge request isc-projects/bind9!2334

6 years agoAdd FreeBSD to GitLab CI
Michał Kępień [Thu, 12 Sep 2019 12:25:57 +0000 (14:25 +0200)] 
Add FreeBSD to GitLab CI

Ensure BIND can be tested on FreeBSD in GitLab to more quickly catch
build and test errors on that operating system.  Make the relevant jobs
optional until the CI environment supporting them is deemed stable
enough for continuous use.

FreeBSD jobs are run using the Custom executor feature of GitLab Runner.
Unlike the Docker executor, the Custom executor does not support the
"image" option and thus some way of informing the runner about the OS
version to use for a given job is necessary.  Arguably the simplest way
of doing that without a lot of code duplication in .gitlab-ci.yml would
be to use a YAML template with a "variables" block specifying the
desired FreeBSD release to use, but including such a template in a job
definition would cause issues in case other variables also needed to be
set for that job (e.g. CFLAGS or EXTRA_CONFIGURE for build jobs).  Thus,
only one FreeBSD YAML template is defined instead and the Custom
executor scripts on FreeBSD runners extract the OS version to use from
the CI job name.  This allows .gitlab-ci.yml variables to be defined for
FreeBSD jobs in the same way as for Docker-based jobs.

(cherry picked from commit 51af91d0073e773259ec19b61daf9bca40ef79a9)

6 years agoSet --logfile for all kyua invocations
Michał Kępień [Thu, 12 Sep 2019 12:25:57 +0000 (14:25 +0200)] 
Set --logfile for all kyua invocations

When kyua is called without the --logfile command line option, the log
file is created at a default location which is derived from the HOME
environment variable.  On FreeBSD GitLab CI runners, /home is a
read-only directory and thus kyua invocations not using the --logfile
option fail when HOME is set to something beneath /home.  Set --logfile
to /dev/null for all kyua invocations whose logs are irrelevant in order
to prevent kyua failures caused by HOME being non-writable.

(cherry picked from commit 1bffa602babbc7e76f1ac786e5e35dd7a5d8109f)