Commit Graph
28402 Commits
Author SHA1 Message Date
Michał Kępień be38f0c33a Fix cppcheck 1.90 warnings
cppcheck 1.90 reports the following false positives for
lib/dns/tests/rbt_serialize_test.c:

    lib/dns/tests/rbt_serialize_test.c:412:12: warning: Either the condition 'base!=NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
      p = base + (r % filesize);
               ^
    lib/dns/tests/rbt_serialize_test.c:407:20: note: Assuming that condition 'base!=NULL' is not redundant
      assert_true(base != NULL && base != MAP_FAILED);
                       ^
    lib/dns/tests/rbt_serialize_test.c:405:14: note: Assignment 'base=mmap(NULL,filesize,PROT_READ|PROT_WRITE,0|MAP_PRIVATE,fd,0)', assigned value is 0
      base = mmap(NULL, filesize, PROT_READ|PROT_WRITE,
                 ^
    lib/dns/tests/rbt_serialize_test.c:412:12: note: Null pointer addition
      p = base + (r % filesize);
               ^
    lib/dns/tests/rbt_serialize_test.c:413:12: warning: Either the condition 'base!=NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
      q = base + filesize;
               ^
    lib/dns/tests/rbt_serialize_test.c:407:20: note: Assuming that condition 'base!=NULL' is not redundant
      assert_true(base != NULL && base != MAP_FAILED);
                       ^
    lib/dns/tests/rbt_serialize_test.c:405:14: note: Assignment 'base=mmap(NULL,filesize,PROT_READ|PROT_WRITE,0|MAP_PRIVATE,fd,0)', assigned value is 0
      base = mmap(NULL, filesize, PROT_READ|PROT_WRITE,
                 ^
    lib/dns/tests/rbt_serialize_test.c:413:12: note: Null pointer addition
      q = base + filesize;
               ^

This is caused by cppcheck not understanding how cmocka's assert_true()
macro works.  The problem being reported is a false positive: if mmap()
fails, the lines flagged by cppcheck will never be reached.  Address the
problem by suppressing nullPointerArithmeticRedundantCheck warnings for
the affected lines.
2020-03-04 12:41:01 +01:00
Michał Kępień ab4c911629 Fix cppcheck 1.90 warning
cppcheck 1.90 reports the following issue for bin/named/query.c:

    bin/named/query.c:6838:2: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
     snprintf(mbuf, sizeof(mbuf) - 1,
     ^

Tweak the format specifier for client->query.restarts to address the
problem.
2020-03-04 12:41:01 +01:00
Michał Kępień 2a01bfd851 Fix cppcheck 1.90 warnings
cppcheck 1.90 reports some false positives for lib/dns/client.c:

    lib/dns/client.c:1431:2: warning: Either the condition 'rctx==((void*)0)' is redundant or there is possible null pointer dereference: rctx. [nullPointerRedundantCheck]
     rctx->rdataset = rdataset;
     ^
    lib/dns/client.c:1416:11: note: Assuming that condition 'rctx==((void*)0)' is not redundant
     if (rctx == NULL)
              ^
    lib/dns/client.c:1415:9: note: Assignment 'rctx=isc__mem_get(mctx,sizeof(*rctx),"lib/dns/client.c",1415)', assigned value is 0
     rctx = isc_mem_get(mctx, sizeof(*rctx));
            ^
    lib/dns/client.c:1431:2: note: Null pointer dereference
     rctx->rdataset = rdataset;
     ^
    lib/dns/client.c:1438:2: warning: Either the condition 'rctx==((void*)0)' is redundant or there is possible null pointer dereference: rctx. [nullPointerRedundantCheck]
     rctx->sigrdataset = sigrdataset;
     ^
    lib/dns/client.c:1416:11: note: Assuming that condition 'rctx==((void*)0)' is not redundant
     if (rctx == NULL)
              ^
    lib/dns/client.c:1415:9: note: Assignment 'rctx=isc__mem_get(mctx,sizeof(*rctx),"lib/dns/client.c",1415)', assigned value is 0
     rctx = isc_mem_get(mctx, sizeof(*rctx));
            ^
    lib/dns/client.c:1438:2: note: Null pointer dereference
     rctx->sigrdataset = sigrdataset;
     ^
    lib/dns/client.c:1445:2: warning: Either the condition 'rctx==((void*)0)' is redundant or there is possible null pointer dereference: rctx. [nullPointerRedundantCheck]
     rctx->client = client;
     ^
    lib/dns/client.c:1416:11: note: Assuming that condition 'rctx==((void*)0)' is not redundant
     if (rctx == NULL)
              ^
    lib/dns/client.c:1415:9: note: Assignment 'rctx=isc__mem_get(mctx,sizeof(*rctx),"lib/dns/client.c",1415)', assigned value is 0
     rctx = isc_mem_get(mctx, sizeof(*rctx));
            ^
    lib/dns/client.c:1445:2: note: Null pointer dereference
     rctx->client = client;
     ^
    lib/dns/client.c:1827:2: warning: Either the condition 'ctx==((void*)0)' is redundant or there is possible null pointer dereference: ctx. [nullPointerRedundantCheck]
     ctx->client = client;
     ^
    lib/dns/client.c:1815:10: note: Assuming that condition 'ctx==((void*)0)' is not redundant
     if (ctx == NULL)
             ^
    lib/dns/client.c:1814:8: note: Assignment 'ctx=isc__mem_get(client->mctx,sizeof(*ctx),"lib/dns/client.c",1814)', assigned value is 0
     ctx = isc_mem_get(client->mctx, sizeof(*ctx));
           ^
    lib/dns/client.c:1827:2: note: Null pointer dereference
     ctx->client = client;
     ^

All of them are caused by cppcheck not recognizing the relationship
between isc_mem_get() returning NULL and the result variable being set
to ISC_R_NOMEMORY (with a subsequent jump to a cleanup section).

Move "goto cleanup;" statements into error handling branches to prevent
cppcheck from generating these warnings.
2020-03-04 12:41:01 +01:00
Michał Kępień ae7c0cca89 Fix cppcheck 1.89 warnings
cppcheck 1.89 enabled certain value flow analysis mechanisms [1] which
trigger null pointer dereference false positives that were previously
not reported.  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

(cherry picked from commit abfde3d543)
2020-03-04 12:41:01 +01:00
Mark Andrews 2cc370f4c5 Merge branch '1656-masterformat-system-test-failed-missing-sleep-1-v9_11' into 'v9_11'
properly wait for zone to be loaded

See merge request isc-projects/bind9!3154
2020-03-04 07:41:32 +00:00
Mark Andrews 5c54402889 properly wait for zone to be loaded
(cherry picked from commit 0abcface49)
2020-03-04 18:17:08 +11:00
Mark Andrews 5b23aebb5e Merge branch 'marka-check-touched-v9_11' into 'v9_11'
Marka check touched v9 11

See merge request isc-projects/bind9!3149
2020-03-03 22:41:06 +00:00
Mark Andrews ae311b8234 Add CHANGES entry
(cherry picked from commit 64474db14e)
2020-03-04 09:20:45 +11:00
Mark Andrews fe03f7e9c8 Restart zone maintenance if it had been stalled.
(cherry picked from commit f171347b5f)
2020-03-04 09:20:44 +11:00
Mark Andrews e7a486be25 Check inline master zones that are touched reload correctly.
(cherry picked from commit 50e079d6c3)
2020-03-04 09:20:40 +11:00
Mark Andrews 18ec83cf23 Merge branch '1627-call-set_resigntime-and-zone_settimer-v9_11' into 'v9_11'
Resolve "inline re-signing stops"

See merge request isc-projects/bind9!3139
2020-03-03 05:56:15 +00:00
Mark Andrews 63f845b716 add release note entry
(cherry picked from commit 23ce0f32e5)
2020-03-03 16:36:42 +11:00
Mark Andrews 463a9e385c Add CHANGES note
(cherry picked from commit 905549f061)
2020-03-03 16:29:20 +11:00
Ondřej SurýandMark Andrews 14d4bbea61 Adjust lock/unlock in zone_rekey()
(cherry picked from commit aaaa7e67fa)
2020-03-03 16:28:42 +11:00
Mark Andrews 6bf56cdf4d Ensure that resigintime and the zone timer are set
(cherry picked from commit a6626594aa)
2020-03-03 16:28:41 +11:00
Matthijs MekkingandMark Andrews ef99d6bda0 Add more zone locks
Add more zone locks around code that touches zone timer setting
in failure modes.

(cherry picked from commit 143d1c9767)
2020-03-03 16:28:37 +11:00
Mark Andrews 0536bfc91a Always call set_resigntime with the zone lock held
(cherry picked from commit 7212961849)
2020-03-03 16:17:34 +11:00
Mark Andrews 43ff3b3ad5 Always call zone_settimer()
zone_needdump() could potentially not call zone_settimer() so
explitly call zone_settimer() as zone->resigntime could have
gone backward.

(cherry picked from commit 5ec57f31b0)
2020-03-03 16:17:30 +11:00
Mark Andrews bfef5ce9bc Call set_resigntime() in receive_secure_serial()
With RRSIG records no longer being signed with the full
sig-validity-interval we need to ensure the zone->resigntime
as it may need to be set to a earlier time.

(cherry picked from commit 5d1611afdc)
2020-03-03 16:16:38 +11:00
Ondřej Surý 3df6760518 Merge branch 'ondrej/use-pkg-config-for-libxml2-v9_11' into 'v9_11'
use pkg-config for libxml2 (v9.11)

See merge request isc-projects/bind9!3118
2020-03-02 14:33:49 +00:00
Ondřej Surý 2def018af7 Add release notes for pkg-config requirement for libxml2 2020-03-02 15:07:18 +01:00
Ondřej SurýandOndřej Surý 7110ceb880 Use pkg-config for --with-libxml2=auto/yes
The downstream distributors of BIND 9 (Debian in this case) are in
process of removing xml2-config command from the libxml2-dev package
(see Debian Bug #949056 for details).  The removal of the script will
make BIND 9 to fail to build from the source when --with-libxml2=yes is
specified or not link with libxml2 when --with-libxml2=auto is specified
and then fail ABI changes (Debian Bug #949056).

When --with-libxml2=<path>, the script checks for <path>/bin/xml2-config
and uses the specified path to link with libxml2. This has been kept to
retain backwards compatibility with systems that does not ship
pkg-config.
2020-03-02 15:07:18 +01:00
Ondřej Surý 6050c766de Merge branch '414-use-p11-kit-headers-v9_11' into 'v9_11'
Resolve "Legal issue with pkcs11 headers"

See merge request isc-projects/bind9!3133
2020-03-02 10:29:36 +00:00
Ondřej Surý 5edc8b5338 Use standard PKCS#11 standard error codes instead of custom error codes
* CKR_CRYPTOKI_ALREADY_INITIALIZED: This value can only be returned by
  `C_Initialize`. It means that the Cryptoki library has already been
  initialized (by a previous call to `C_Initialize` which did not have a
  matching `C_Finalize` call).

* CKR_FUNCTION_NOT_SUPPORTED: The requested function is not supported by this
  Cryptoki library. Even unsupported functions in the Cryptoki API should have a
  "stub" in the library; this stub should simply return the value
  CKR_FUNCTION_NOT_SUPPORTED.

* CKR_LIBRARY_LOAD_FAILED: The Cryptoki library could not load a dependent
  shared library.

(cherry picked from commit f6922d6e78)
2020-03-02 11:01:05 +01:00
Ondřej SurýandOndřej Surý 4b9cdbaf7e Replace the OASIS PKCS#11 header file with one from p11-kit
The OASIS pkcs11.h header has a restrictive license.  Replace the
pkcs11.h pkcs11f.h and pkcs11t.h headers with pkcs11.h from p11-kit.

For source distribution, the license for the OASIS headers itself
doesn't pose any licensing problem when combined with MPL license, but
it possibly creates problem for downstream distributors of BIND 9.

(cherry picked from commit c47fad2431)
2020-03-02 10:43:45 +01:00
Mark Andrews 392430c6dc Merge branch '1638-rrsig-soa-and-re-signing-v9_11' into 'v9_11'
Resolve "RRSIG(SOA) and re-signing."

See merge request isc-projects/bind9!3129
2020-02-27 23:31:02 +00:00
Mark Andrews a32d952d9d capture named-journalprint output
(cherry picked from commit 88c828cb9f)
2020-02-28 10:14:02 +11:00
Mark Andrews 317e0cf4c9 sort RRSIG(SOA) to be last of RRSIGs with a common re-resign time
(cherry picked from commit a24fd55836)
2020-02-28 10:13:57 +11:00
Mark Andrews 51f3d3781e use the full sig-validity-interval for RRSIG(SOA)
(cherry picked from commit 660dc3eba7)
2020-02-28 10:10:26 +11:00
Evan Hunt 9fe133ceed Merge branch '1632-spelling-v9_11-take2' into 'v9_11'
fix additional spelling errors

See merge request isc-projects/bind9!3115
2020-02-25 06:27:50 +00:00
Evan Hunt 191b616579 fix additional spelling errors 2020-02-24 22:04:43 -08:00
Evan Hunt e09f0856f0 Merge branch '1632-spelling-v9_11' into 'v9_11'
fix spelling errors reported by Fossies.

See merge request isc-projects/bind9!3112
2020-02-21 23:02:26 +00:00
Evan Hunt e63223332c fix spelling errors reported by Fossies. 2020-02-21 14:09:59 -08:00
Mark Andrews 75d70433e4 Merge branch 'marka-fix-signature-test-v9_11' into 'v9_11'
Fix code to generate the test signatues.

See merge request isc-projects/bind9!3106
2020-02-21 07:20:38 +00:00
Mark Andrews 4ecf3b8961 fixup! Fix code to generate the test signatues. 2020-02-21 18:10:44 +11:00
Mark Andrews 22422a2f5d Fix code to generate the test signatues.
* ctx needs to be destroyed before it is regenerated.
* emit the name of the signature to be replaced.
* cleanup memory before asserting so post longjump doesn't detect a
  memory leak.
* comment code.

(cherry picked from commit 3a8c8a2a31)
2020-02-21 17:45:47 +11:00
Michał Kępień 67451d5502 Merge branch 'michal/make-a-sed-script-in-doc-arm-makefile.in-portable-v9_11' into 'v9_11'
[v9_11] Make a sed script in doc/arm/Makefile.in portable

See merge request isc-projects/bind9!3099
2020-02-20 11:28:32 +00:00
Michał Kępień 2b07349098 Make a sed script in doc/arm/Makefile.in portable
BSD sed does not recognize \s as a whitespace matching token.  Make the
sed script in doc/arm/Makefile.in which ensures GitLab identifiers are
not split across lines portable by replacing \s with [[:space:]].

(cherry picked from commit b25e6b51f6)
2020-02-20 12:24:28 +01:00
Michał Kępień 7eb9446e24 Merge branch 'michal/increase-lifetime-of-docs-sid-amd64-artifacts-v9_11' into 'v9_11'
[v9_11] Increase lifetime of docs:sid:amd64 artifacts

See merge request isc-projects/bind9!3094
2020-02-20 10:57:38 +00:00
Michał Kępień 1728dfaae2 Increase lifetime of docs:sid:amd64 artifacts
Artifacts generated by the docs:sid:amd64 job need to be retained longer
than for other jobs as they are used for building bind.isc.org contents.
If these artifacts are removed too quickly, pipelines in the pages/bind
GitLab project start failing, preventing content updates from being
published.  Increase lifetime of the relevant job artifacts to prevent
this from happening.

(cherry picked from commit 9751ba5a75)
2020-02-20 11:53:30 +01:00
Tinderbox User 6afa4a49bc Merge branch 'prep-release' into v9_11 v9.11.16 2020-02-12 15:42:40 +00:00
Tinderbox User aa55ef6c43 prep 9.11.16 2020-02-12 15:37:33 +00:00
Michal Nowak 9a18bab7f6 Merge branch 'mnowak/coverity-disable-web-tag-v9_11' into 'v9_11'
[v9_11] Run Coverity Scan only when specific variables are present

See merge request isc-projects/bind9!3056
2020-02-12 15:00:33 +00:00
Michal Nowak d28e40b05d Run Coverity Scan only when specific variables are present
Submissions to Coverity Scan should be limited to those originated from
release branches and only from a specific schedule which holds
COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN variables.

(cherry picked from commit 48530aa21395414b0f9788ea5ab158b2b09ab977)
2020-02-12 15:00:32 +00:00
Michał Kępień 4bf6c17885 Merge branch 'michal/prepare-release-notes-for-bind-9.11.16' into 'v9_11'
Prepare release notes for BIND 9.11.16

See merge request isc-projects/bind9!3052
2020-02-12 13:18:59 +00:00
Michał Kępień f9c164b08b Add release notes section for BIND 9.11.16 2020-02-12 13:58:01 +01:00
Michał Kępień 44ee969186 Merge branch 'michal/minor-README-tweaks-v9_11' into 'v9_11'
[v9_11] Minor README tweaks

See merge request isc-projects/bind9!3049
2020-02-12 10:39:09 +00:00
Michał Kępień 3ac942e5db Minor CHANGES tweak
(cherry picked from commit a0349b18e0)
2020-02-12 11:29:38 +01:00
Stephen MorrisandMichał Kępień 0e1b8415a2 Minor README tweaks
(cherry picked from commit bc539d48e7)
2020-02-12 11:29:23 +01:00
Michal Nowak 7bfbf10585 Merge branch 'mnowak/coverity2-v9_11' into 'v9_11'
[v9_11] Add Coverity Scan to CI

See merge request isc-projects/bind9!3047
2020-02-12 10:15:39 +00:00