]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agoAdded a isc_glob() function that wraps glob() calls for POSIX systems include-multiple-files-windows
Diego Fronza [Wed, 23 Oct 2019 19:25:06 +0000 (16:25 -0300)] 
Added a isc_glob() function that wraps glob() calls for POSIX systems
and implement a custom glob() function on Windows systems.

6 years agoCleaned up configuration files, removed unused directives and commented lines.
Diego Fronza [Tue, 22 Oct 2019 15:10:37 +0000 (12:10 -0300)] 
Cleaned up configuration files, removed unused directives and commented lines.

6 years agoAdded test to verify that both include glob-expression and include
Diego Fronza [Tue, 22 Oct 2019 13:43:24 +0000 (10:43 -0300)] 
Added test to verify that both include glob-expression and include
non-glob-expression works.

6 years agofixup! portability issue, field gl_flags from glob_t is not portable.
Diego dos Santos Fronza [Tue, 17 Sep 2019 14:31:24 +0000 (11:31 -0300)] 
fixup! portability issue, field gl_flags from glob_t is not portable.

6 years agofixup! using more portable field from glob_t structure: gl_pathc
Diego dos Santos Fronza [Mon, 16 Sep 2019 19:10:55 +0000 (16:10 -0300)] 
fixup! using more portable field from glob_t structure: gl_pathc

6 years agoAdded tests for include directive + glob expressions.
Diego dos Santos Fronza [Mon, 16 Sep 2019 15:03:10 +0000 (12:03 -0300)] 
Added tests for include directive + glob expressions.

6 years agoAllowing include directive to use glob expressions, e.g. include
Diego dos Santos Fronza [Fri, 13 Sep 2019 15:08:56 +0000 (12:08 -0300)] 
Allowing include directive to use glob expressions, e.g. include
"/opt/named.conf/*.conf".

6 years agoMerge branch '5-update-coding-style' into 'master'
Ondřej Surý [Tue, 22 Oct 2019 10:19:36 +0000 (06:19 -0400)] 
Merge branch '5-update-coding-style' into 'master'

Update the coding style to reflect the year 2019 and C99/C11 standard

Closes #5

See merge request isc-projects/bind9!2148

6 years agoUpdate the coding style to reflect the year 2019 and C11 standard
Ondřej Surý [Fri, 12 Jul 2019 12:42:42 +0000 (14:42 +0200)] 
Update the coding style to reflect the year 2019 and C11 standard

6 years agoMerge branch '1281-dnstap-per-view-configuration' into 'master'
Mark Andrews [Mon, 21 Oct 2019 21:20:48 +0000 (17:20 -0400)] 
Merge branch '1281-dnstap-per-view-configuration' into 'master'

Resolve "dnstap per view configuration"

Closes #1281

See merge request isc-projects/bind9!2477

6 years agoadd CHANGES
Mark Andrews [Mon, 21 Oct 2019 00:11:35 +0000 (11:11 +1100)] 
add CHANGES

6 years agocheck for relationship between dnstap and dnstap-output seperately
Mark Andrews [Mon, 21 Oct 2019 00:08:06 +0000 (11:08 +1100)] 
check for relationship between dnstap and dnstap-output seperately

6 years agoadd more dnstap/dnstap-output combinations
Mark Andrews [Mon, 21 Oct 2019 00:06:21 +0000 (11:06 +1100)] 
add more dnstap/dnstap-output combinations

6 years agoMerge branch 'security-master'
Tinderbox User [Sat, 19 Oct 2019 23:30:23 +0000 (23:30 +0000)] 
Merge branch 'security-master'

6 years agoMerge branch 'michal/address-cppcheck-1.89-warnings' into 'master'
Michał Kępień [Thu, 17 Oct 2019 09:50:06 +0000 (05:50 -0400)] 
Merge branch 'michal/address-cppcheck-1.89-warnings' into 'master'

Address cppcheck 1.89 warnings

See merge request isc-projects/bind9!2472

6 years agoSuppress cppcheck 1.89 false positive
Michał Kępień [Wed, 16 Oct 2019 20:06:00 +0000 (22:06 +0200)] 
Suppress cppcheck 1.89 false positive

cppcheck 1.89 emits a false positive for lib/dns/spnego_asn1.c:

    lib/dns/spnego_asn1.c:698:9: error: Uninitialized variable: data [uninitvar]
     memset(data, 0, sizeof(*data));
            ^
    lib/dns/spnego.c:1707:47: note: Calling function 'decode_NegTokenResp', 3rd argument '&resp' value is <Uninit>
     ret = decode_NegTokenResp(buf + taglen, len, &resp, NULL);
                                                  ^
    lib/dns/spnego_asn1.c:698:9: note: Uninitialized variable: data
     memset(data, 0, sizeof(*data));
            ^

This message started appearing with cppcheck 1.89 [1], but it will be
gone in the next release [2], so just suppress it for the time being.

[1] https://github.com/danmar/cppcheck/commit/af214e8212efa303e664920a468de00ee0b1fe3d

[2] https://github.com/danmar/cppcheck/commit/2595b826349a7ffbe1c958b806498b6e336bea33

6 years agoFix cppcheck 1.89 warnings
Michał Kępień [Wed, 16 Oct 2019 20:06:00 +0000 (22:06 +0200)] 
Fix cppcheck 1.89 warnings

cppcheck 1.89 enabled certain value flow analysis mechanisms [1] which
trigger null pointer dereference false positives in lib/dns/rpz.c:

    lib/dns/rpz.c:582:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1419:44: note: Calling function 'adj_trigger_cnt', 4th argument 'NULL' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:582:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:596:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1419:44: note: Calling function 'adj_trigger_cnt', 4th argument 'NULL' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:596:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:610:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1419:44: note: Calling function 'adj_trigger_cnt', 4th argument 'NULL' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:610:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^

It seems that cppcheck no longer treats at least some REQUIRE()
assertion failures as fatal, so add extra assertion macro definitions to
lib/isc/include/isc/util.h that are only used when the CPPCHECK
preprocessor macro is defined; these definitions make cppcheck 1.89
behave as expected.

There is an important requirement for these custom definitions to work:
cppcheck must properly treat abort() as a function which does not
return.  In order for that to happen, the __GNUC__ macro must be set to
a high enough number (because system include directories are used and
system headers compile attributes away if __GNUC__ is not high enough).
__GNUC__ is thus set to the major version number of the GCC compiler
used, which is what that latter does itself during compilation.

[1] https://github.com/danmar/cppcheck/commit/aaeec462e6d96bb70c2b1cf030979d09e2d7c959

6 years agoMerge branch 'michal/cleanup-with-cc-alg-remnants' into 'master'
Michał Kępień [Tue, 15 Oct 2019 20:35:11 +0000 (16:35 -0400)] 
Merge branch 'michal/cleanup-with-cc-alg-remnants' into 'master'

Remove remnants of the --with-cc-alg option

See merge request isc-projects/bind9!2436

6 years agoRemove remnants of the --with-cc-alg option
Michał Kępień [Tue, 15 Oct 2019 19:57:58 +0000 (21:57 +0200)] 
Remove remnants of the --with-cc-alg option

Commit afa81ee4e4e863fa646177947c55e8c6b1475f47 omitted some spots in
the source tree which are still referencing the removed --with-cc-alg
"configure" option.  Make sure the latter is removed completely.

6 years agoMerge branch 'michal/limit-triggers-for-openbsd-system-test-jobs' into 'master'
Michał Kępień [Tue, 15 Oct 2019 19:52:33 +0000 (15:52 -0400)] 
Merge branch 'michal/limit-triggers-for-openbsd-system-test-jobs' into 'master'

Limit triggers for OpenBSD system test jobs

See merge request isc-projects/bind9!2468

6 years agoLimit triggers for OpenBSD system test jobs
Michał Kępień [Tue, 15 Oct 2019 19:35:18 +0000 (21:35 +0200)] 
Limit triggers for OpenBSD system test jobs

When a GitLab CI runner is not under load, a single OpenBSD system test
job completes in about 12 minutes, which is considered decent.  However,
such jobs are usually multiplexed with other system test jobs on the
same host, which causes each of them to take even 40 minutes to
complete.  Taking retries into account, this is completely unacceptable
for everyday use, so only start OpenBSD system test jobs for pipelines
created through GitLab's web interface and for pipelines created for Git
tags.

6 years agoMerge branch 'michal/minor-gitlab-ci-tweaks' into 'master'
Michał Kępień [Tue, 15 Oct 2019 19:45:54 +0000 (15:45 -0400)] 
Merge branch 'michal/minor-gitlab-ci-tweaks' into 'master'

Minor GitLab CI tweaks

See merge request isc-projects/bind9!2435

6 years agoTweak dependencies for the Windows build job
Michał Kępień [Tue, 15 Oct 2019 18:49:08 +0000 (20:49 +0200)] 
Tweak dependencies for the Windows build job

Since the Windows build job does not use the files created as a result
of running "autoreconf -fi" in the "autoreconf:sid:amd64" job, set its
dependencies to an empty list.

Since it is currently not possible to use "needs: []" for jobs which do
not belong to the first stage of a pipeline, set the "needs" key for the
Windows build job to the "autoreconf:sid:amd64" job so that all build
jobs are started at the same time (without this change, the Windows
build job does not start until all jobs in the "precheck" stage are
finished).

As a side note, these changes also attempt to eliminate intermittent,
bogus GitLab error messages ("There has been a missing dependency
failure").

6 years agoFix artifacts created by the "autoreconf" CI job
Michał Kępień [Tue, 15 Oct 2019 18:49:08 +0000 (20:49 +0200)] 
Fix artifacts created by the "autoreconf" CI job

The intended purpose of the "autoreconf:sid:amd64" GitLab CI job is to
run "autoreconf -fi" and then pass the updated files on to subsequent
non-Windows build jobs.  However, the artifacts currently created by
that job only include files which are not tracked by Git.  Since we
currently do track e.g. "configure" with Git, the aforementioned job is
essentially a no-op.  Fix by manually specifying the files generated by
the "autoreconf:sid:amd64" job that should be passed on to subsequent
build jobs.

6 years agoMerge branch 'michal/add-openbsd-to-gitlab-ci' into 'master'
Michał Kępień [Tue, 15 Oct 2019 18:44:40 +0000 (14:44 -0400)] 
Merge branch 'michal/add-openbsd-to-gitlab-ci' into 'master'

Add OpenBSD to GitLab CI

Closes #148

See merge request isc-projects/bind9!2434

6 years agoAdd OpenBSD to GitLab CI
Michał Kępień [Tue, 15 Oct 2019 14:38:04 +0000 (16:38 +0200)] 
Add OpenBSD to GitLab CI

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

Some notes:

  - While GCC is packaged for OpenBSD, only old versions (4.2.1, 4.9.4)
    are readily available and none of them is the default system
    compiler, so we are only doing Clang builds in GitLab CI.

  - Unit tests are currently not run on OpenBSD because it ships with an
    old version of kyua which does not handle skipped tests properly.
    These jobs will be added when we move away from using kyua in the
    future as the test code itself works fine.

  - All OpenBSD jobs are run inside QEMU virtual machines, using GitLab
    Runner Custom executor.

6 years agoWork around an OpenBSD "make" quirk
Michał Kępień [Tue, 15 Oct 2019 14:38:04 +0000 (16:38 +0200)] 
Work around an OpenBSD "make" quirk

Consider the following Makefile:

    foo:
     false

On OpenBSD, the following happens for this Makefile:

  - "make foo" returns 1,
  - "make -k foo" returns 0,
  - "make -k -j6 foo" returns 1.

However, if the .NOTPARALLEL pseudo-target is added to this Makefile,
"make -k -j6 foo" will return 0 as well.

Since bin/tests/Makefile contains the .NOTPARALLEL pseudo-target,
running "make -k -j6 test" from bin/tests/ on OpenBSD prevents any
errors from being reported through that command's exit code.

Work around the issue by running "make -k -j6 test" in the
bin/tests/system/ directory instead as bin/tests/system/Makefile does
not contain the .NOTPARALLEL pseudo-target and thus things work as
expected there.

6 years agoMerge branch '1143-a-minor-documentation-issue-consideration-of-parsing-inconsistenci...
Mark Andrews [Sun, 13 Oct 2019 14:27:38 +0000 (10:27 -0400)] 
Merge branch '1143-a-minor-documentation-issue-consideration-of-parsing-inconsistencies-in-ipv4s-in-address-match-lists-and-in-a-controls-inet-statement' into 'master'

Resolve "A minor documentation issue & consideration of parsing inconsistencies in IPv4s in address match lists and in a controls/inet statement"

Closes #1143

See merge request isc-projects/bind9!2152

6 years agoDetect partial prefixes / incomplete IPv4 address in acls.
Mark Andrews [Mon, 15 Jul 2019 00:25:36 +0000 (10:25 +1000)] 
Detect partial prefixes / incomplete IPv4 address in acls.

6 years agoMerge branch 'u/fanf2/dsdigest-abbr' into 'master'
Ondřej Surý [Thu, 10 Oct 2019 19:58:17 +0000 (15:58 -0400)] 
Merge branch 'u/fanf2/dsdigest-abbr' into 'master'

cleanup: more consistent abbreviated DS digest type mnemonics

See merge request isc-projects/bind9!2440

6 years agocleanup: more consistent abbreviated DS digest type mnemonics
Tony Finch [Wed, 2 Oct 2019 18:43:09 +0000 (19:43 +0100)] 
cleanup: more consistent abbreviated DS digest type mnemonics

BIND supports the non-standard DNSKEY algorithm mnemonic ECDSA256
everywhere ECDSAP256SHA256 is allowed, and allows algorithm numbers
interchangeably with mnemonics. This is all done in one place by the
dns_secalg_fromtext() function.

DS digest types were less consistent: the rdata parser does not allow
abbreviations like SHA1, but the dnssec-* command line tools do; and
the command line tools do not alow numeric types though that is the
norm in rdata.

The command line tools now use the dns_dsdigest_fromtext() function
instead of rolling their own variant, and dns_dsdigest_fromtext() now
knows about abbreviated digest type mnemonics.

6 years agoMerge branch 'ondrej/1-week-artifact-expiration' into 'master'
Ondřej Surý [Thu, 10 Oct 2019 05:44:33 +0000 (01:44 -0400)] 
Merge branch 'ondrej/1-week-artifact-expiration' into 'master'

Synchronize the lifetime of artifact to 1 week

See merge request isc-projects/bind9!2448

6 years agoMerge branch 'fix-doc' into security-master
Tinderbox User [Wed, 9 Oct 2019 20:46:01 +0000 (20:46 +0000)] 
Merge branch 'fix-doc' into security-master

6 years agoregenerate doc
Tinderbox User [Wed, 9 Oct 2019 20:45:13 +0000 (20:45 +0000)] 
regenerate doc

6 years agoSynchronize the lifetime of artifact to 1 week
Ondřej Surý [Wed, 9 Oct 2019 19:34:18 +0000 (21:34 +0200)] 
Synchronize the lifetime of artifact to 1 week

6 years agoMerge branch '1119-tsan-lib/dns/view.c-attributes' into 'master'
Ondřej Surý [Wed, 9 Oct 2019 06:51:24 +0000 (02:51 -0400)] 
Merge branch '1119-tsan-lib/dns/view.c-attributes' into 'master'

Convert struct dns_view->attributes to atomic_uint to prevent some locking

See merge request isc-projects/bind9!2368

6 years agoMerge branch 'security-master-issue-numbers' into 'security-master'
Ondřej Surý [Wed, 9 Oct 2019 06:38:48 +0000 (02:38 -0400)] 
Merge branch 'security-master-issue-numbers' into 'security-master'

Fix the GitLab issue numbers in CHANGES and notes.xml

See merge request isc-private/bind9!121

6 years agoConvert struct dns_view->attributes to atomic_uint to prevent some locking
Ondřej Surý [Thu, 18 Jul 2019 12:22:31 +0000 (14:22 +0200)] 
Convert struct dns_view->attributes to atomic_uint to prevent some locking

6 years agoFix the GitLab issue numbers in CHANGES and notes.xml
Ondřej Surý [Wed, 9 Oct 2019 06:02:05 +0000 (08:02 +0200)] 
Fix the GitLab issue numbers in CHANGES and notes.xml

6 years agoregen master
Tinderbox User [Sun, 6 Oct 2019 03:16:14 +0000 (03:16 +0000)] 
regen master

6 years agoMerge branch 'ondrej/cleanup-copyrights' into 'master'
Ondřej Surý [Fri, 4 Oct 2019 06:40:56 +0000 (02:40 -0400)] 
Merge branch 'ondrej/cleanup-copyrights' into 'master'

Cleanup the COPYRIGHTS file

See merge request isc-projects/bind9!2377

6 years agoRemove The OpenSSL Project from COPYRIGHT, the OpenSSL patches were removed
Ondřej Surý [Mon, 23 Sep 2019 10:36:44 +0000 (12:36 +0200)] 
Remove The OpenSSL Project from COPYRIGHT, the OpenSSL patches were removed

6 years agoCleanup the last bits copyrighted to RSA Security and remove them from COPYRIGHT...
Ondřej Surý [Mon, 23 Sep 2019 10:35:23 +0000 (12:35 +0200)] 
Cleanup the last bits copyrighted to RSA Security and remove them from COPYRIGHT file

6 years agoRemove Doug Rabson and Jake Burkholder from COPYRIGHT, the code was removed
Ondřej Surý [Mon, 23 Sep 2019 10:28:52 +0000 (12:28 +0200)] 
Remove Doug Rabson and Jake Burkholder from COPYRIGHT, the code was removed

6 years agoRemove Aaron D. Gifford from COPYRIGHT, the code was removed
Ondřej Surý [Mon, 23 Sep 2019 10:27:55 +0000 (12:27 +0200)] 
Remove Aaron D. Gifford from COPYRIGHT, the code was removed

6 years agoRemove Rice University from COPYRIGHT, the code was removed
Ondřej Surý [Mon, 23 Sep 2019 10:27:29 +0000 (12:27 +0200)] 
Remove Rice University from COPYRIGHT, the code was removed

6 years agoRemove Japan Network Information Center from COPYRIGHT, the code was removed
Ondřej Surý [Mon, 23 Sep 2019 10:26:27 +0000 (12:26 +0200)] 
Remove Japan Network Information Center from COPYRIGHT, the code was removed

6 years agoMerge branch 'ondrej/remove-rsa-pkcs11-header-remnants' into 'master'
Ondřej Surý [Fri, 4 Oct 2019 06:35:58 +0000 (02:35 -0400)] 
Merge branch 'ondrej/remove-rsa-pkcs11-header-remnants' into 'master'

Remove unused RSA Security copyrighted cryptoki.h header

See merge request isc-projects/bind9!2445

6 years agoRemove unused RSA Security copyrighted cryptoki.h header
Ondřej Surý [Mon, 23 Sep 2019 10:35:23 +0000 (12:35 +0200)] 
Remove unused RSA Security copyrighted cryptoki.h header

6 years agoMerge branch '1226-yaml-empty-edns-options' into 'master'
Evan Hunt [Fri, 4 Oct 2019 06:16:14 +0000 (02:16 -0400)] 
Merge branch '1226-yaml-empty-edns-options' into 'master'

Resolve "dig: EDNS options in requests cause bad YAML output"

Closes #1226

See merge request isc-projects/bind9!2345

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

6 years agofix digdelv KEY-TAG test
Evan Hunt [Sat, 14 Sep 2019 17:51:42 +0000 (10:51 -0700)] 
fix digdelv KEY-TAG test

also incidentally added several missing ret=0 statements,
and removed some duplicates.

6 years agoTCP KEEPALIVE was missing from yaml output
Evan Hunt [Tue, 1 Oct 2019 22:37:40 +0000 (15:37 -0700)] 
TCP KEEPALIVE was missing from yaml output

6 years agoalways print a colon after EDNS option names in text output
Evan Hunt [Sat, 14 Sep 2019 17:23:24 +0000 (10:23 -0700)] 
always print a colon after EDNS option names in text output

make the same change as in the previous commit to non-YAML text output,
for better readability and consistency between formats.

6 years agoalways print a colon after EDNS option names in YAML output
Evan Hunt [Sat, 14 Sep 2019 17:23:24 +0000 (10:23 -0700)] 
always print a colon after EDNS option names in YAML output

previously, if the option was empty, then it was printed without a
colon, which could not be parsed as YAML. adding a colon in all cases
addresses this problem.

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

silence clang warning by using local variable.

See merge request isc-projects/bind9!2419

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.

6 years agoMerge branch 'ondrej/cppcheck-suppressions-list' into 'master'
Ondřej Surý [Thu, 3 Oct 2019 14:10:14 +0000 (10:10 -0400)] 
Merge branch 'ondrej/cppcheck-suppressions-list' into 'master'

Use util/suppressions.txt for Cppcheck suppressions list

See merge request isc-projects/bind9!2437

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 agoMerge branch 'ondrej/enable-cppcheck' into 'master'
Ondřej Surý [Thu, 3 Oct 2019 07:32:28 +0000 (03:32 -0400)] 
Merge branch 'ondrej/enable-cppcheck' into 'master'

Add Cppcheck job to the CI

See merge request isc-projects/bind9!2403

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

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

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

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

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

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

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

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

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()

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

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

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

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

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

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);
}

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

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()

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

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

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

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;
}

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

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()

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

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

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()

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

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

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

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.

6 years agoMerge branch '1119-disable-time-consuming-tests-benchmarks-when-tsan-is-enabled'...
Ondřej Surý [Wed, 2 Oct 2019 12:49:00 +0000 (08:49 -0400)] 
Merge branch '1119-disable-time-consuming-tests-benchmarks-when-tsan-is-enabled' into 'master'

Disable time consuming tests when compiling with Thread Sanitizer

See merge request isc-projects/bind9!2365

6 years agoDisable benchmark tests when Thread Sanitizer is enabled
Ondřej Surý [Thu, 4 Jul 2019 12:25:59 +0000 (14:25 +0200)] 
Disable benchmark tests when Thread Sanitizer is enabled

6 years agoDeclare __SANITIZE_THREAD__ in isc/util.h when clang ThreadSanitizer is used
Ondřej Surý [Thu, 4 Jul 2019 12:25:59 +0000 (14:25 +0200)] 
Declare __SANITIZE_THREAD__ in isc/util.h when clang ThreadSanitizer is used

6 years agoMerge branch '1119-tsan-lib/isc/tests/timer_test.c' into 'master'
Ondřej Surý [Wed, 2 Oct 2019 12:06:13 +0000 (08:06 -0400)] 
Merge branch '1119-tsan-lib/isc/tests/timer_test.c' into 'master'

Convert all variables accessed between multiple threads to atomic

See merge request isc-projects/bind9!2364

6 years agoConvert all variables accessed between multiple threads to atomic
Ondřej Surý [Thu, 4 Jul 2019 12:21:15 +0000 (14:21 +0200)] 
Convert all variables accessed between multiple threads to atomic

6 years agoMerge branch '1119-tsan-lib/isc/tests/task_test.c' into 'master'
Ondřej Surý [Wed, 2 Oct 2019 11:38:10 +0000 (07:38 -0400)] 
Merge branch '1119-tsan-lib/isc/tests/task_test.c' into 'master'

Convert all variables accessed between multiple threads to atomic

See merge request isc-projects/bind9!2363

6 years agoProperly initialize atomic variables
Ondřej Surý [Fri, 12 Jul 2019 14:44:51 +0000 (16:44 +0200)] 
Properly initialize atomic variables

6 years agolib/isc/tests/task_test.c: Convert all variables accessed between multiple threads...
Ondřej Surý [Thu, 4 Jul 2019 12:15:39 +0000 (14:15 +0200)] 
lib/isc/tests/task_test.c: Convert all variables accessed between multiple threads to atomic

6 years agoMerge branch '1119-tsan-lib/dns/zone.c-flags' into 'master'
Ondřej Surý [Wed, 2 Oct 2019 11:08:35 +0000 (07:08 -0400)] 
Merge branch '1119-tsan-lib/dns/zone.c-flags' into 'master'

Convert the dns_zone_t flags, options and keyopts to stdatomic

See merge request isc-projects/bind9!2359

6 years agoConvert DNS_ZONEKEY_, DNS_ZONEFLG_ and DNS_ZONELOADFLAG_ #defines to enums
Ondřej Surý [Fri, 27 Sep 2019 12:29:17 +0000 (14:29 +0200)] 
Convert DNS_ZONEKEY_, DNS_ZONEFLG_ and DNS_ZONELOADFLAG_ #defines to enums