Commit graph

44164 commits

Author SHA1 Message Date
Mark Andrews
ba5053cddf Fix "good-viewzonelevel.conf.j2 has hard coded library extension"
Use @DYLIB@ instead of hard coded extension "so".
2025-10-28 05:40:28 +11:00
Andoni Duarte
40e8baf6d5 new: ci: Add tarball publication process to pipeline
Tarball uploading steps are to be included in the pipeline.

They are manual jobs that:

1. uploads a release tarball prepared by the "sign" job.
2. publish a previously staged release to a destination.
3. publishes a previously staged release to a well-known URL.

A template has been included since all three follow the same pattern.
Besides, rules commonly used by tag pipeline jobs.

Merge branch 'andoni/ci-release-process' into 'main'

See merge request isc-projects/bind9!11158
2025-10-27 15:51:58 +00:00
Michał Kępień
0734ec2a68 Deduplicate triggering rules for tag pipeline jobs
Define and use more YAML anchors for triggering rules commonly used by
tag pipeline jobs.  This builds on top of the work done in commit
675d9c7425, improving readability and
reuse.
2025-10-27 16:16:48 +01:00
Andoni Duarte Pintado
a27b1954f2 Add the "publish" job
Add a new SSH-confirmed GitLab CI job that publishes a previously staged
release to a well-known URL.  The details of what specifically this
entails are controlled by the staging environment.
2025-10-27 16:16:48 +01:00
Andoni Duarte Pintado
1d88db4d63 Add the "publish-private" job
Add a new SSH-confirmed GitLab CI job that publishes a previously staged
release to a destination that is not a well-known URL.  The details of
what specifically this entails are controlled by the staging
environment.
2025-10-27 16:16:48 +01:00
Andoni Duarte Pintado
a7fd3ebd0b Add the "staging" job
Add a new SSH-confirmed GitLab CI job that uploads a release tarball
prepared by the "sign" job to a staging environment specified using CI
variables.
2025-10-27 16:16:48 +01:00
Michał Kępień
868887ac65 Rework the "sign" job
Adapt the "sign" job to use the YAML template for SSH-confirmed jobs.
Make the signing process user-agnostic.
2025-10-27 16:16:48 +01:00
Michał Kępień
c61767453d Add a template for SSH-confirmed jobs
Add a YAML template for jobs that require an SSH connection to a
dedicated, locked-down runner for signing off on sensitive operations
(e.g. signing, publishing).

These jobs all follow a similar scheme:

 1. Runner prepares the necessary files in a well-known location (/tmp).
 2. Runner generates a shell script to be run by an authorized user.
 3. Runner sleeps while waiting for a signal that the script was run.
 4. Authorized user logs in to the runner over SSH and runs the script.
 5. Runner collects the relevant files and logs as job artifacts.

One additional complication is that each of the above steps needs to be
carried out under the assumption that GitLab Runner is running under a
different user account than the one used for logging in over SSH,
necessitating careful file permission handling.

Having a YAML template for jobs that need to follow the above scheme
significantly improves readability and reuse as each job only needs to
define (via the "variables" YAML key):

  - SSH_SCRIPT_RUNNER_PRE: the code the runner should execute before an
    authorized user logs in over SSH (typically: setting up files in a
    well-known location),

  - SSH_SCRIPT_CLIENT: contents of the shell script to be run by an
    authorized user,

  - SSH_SCRIPT_RUNNER_POST: the code the runner should execute after an
    authorized user runs the script over SSH (typically: artifact
    collection and cleanup).
2025-10-27 16:16:48 +01:00
Michał Kępień
8d548cbb58 Revise release directory naming
Include the Git tag in the name of the release directory rather than
just the version number.  Revise the script for the "release" job
accordingly.  This enables using the $CI_COMMIT_TAG variable in job
scripts without the need to resort to string manipulation to strip the
leading "v", improving readability.  The only place where string
manipulation is applied to the Git tag is now the "release" job itself,
to verify that the Git tag matches the version number embedded in the
source tarball name.
2025-10-27 14:00:04 +01:00
Mark Andrews
b14a6935ea fix: test: test-syncplugin.c:plugin_register was broken
The variables example2com, example3com, and example4com where not
being initalised on all paths leading to Coverity issues ID 637690,
ID 637691 and ID 637692 being raised.  In addition the tests to free
them were wrong as they depended on the unintialised variables. This
has been fixed.

Closes #5598

Merge branch '5598-properly-determine-if-name-is-dynamic' into 'main'

See merge request isc-projects/bind9!11155
2025-10-27 23:46:39 +11:00
Mark Andrews
de81887c2a test-syncplugin.c:plugin_register was broken
The variables example2com, example3com, and example4com where not
being initalised on all paths leading to Coverity issues ID 637690,
ID 637691 and ID 637692 being raised.  In addition the tests to free
them were wrong as they depended on the unintialised variables. This
has been fixed.
2025-10-27 23:00:08 +11:00
Michał Kępień
90408b813d chg: dev: Stop prettifying JSON statistics
Passing the JSON_C_TO_STRING_PRETTY flag to
json_object_to_json_string_ext() makes the latter produce prettified
JSON output.  This results in a huge amount of redundant whitespace
being inserted into each HTTP response (whitespace amounts to about 40%
of the entire JSON payload).

The bandwidth cost can be amortized by enabling HTTP compression on the
client side ("Accept-Encoding: deflate"), but that does not affect the
size of data at rest.

Use the JSON_C_TO_STRING_PLAIN flag instead of JSON_C_TO_STRING_PRETTY
to minimize the size of JSON responses sent via the statistics channel.
External tools should be used for prettifying JSON data.

Closes #3304

Merge branch '3304-stop-prettifying-json-statistics' into 'main'

See merge request isc-projects/bind9!10786
2025-10-27 10:57:58 +01:00
Michał Kępień
4797b2a155
Stop prettifying JSON statistics
Passing the JSON_C_TO_STRING_PRETTY flag to
json_object_to_json_string_ext() makes the latter produce prettified
JSON output.  This results in a huge amount of redundant whitespace
being inserted into each HTTP response (whitespace amounts to about 40%
of the entire JSON payload).

The bandwidth cost can be amortized by enabling HTTP compression on the
client side ("Accept-Encoding: deflate"), but that does not affect the
size of data at rest.

Use the JSON_C_TO_STRING_PLAIN flag instead of JSON_C_TO_STRING_PRETTY
to minimize the size of JSON responses sent via the statistics channel.
External tools should be used for prettifying JSON data.
2025-10-27 10:56:38 +01:00
Michał Kępień
3219874fe7 chg: test: Properly process JSON and XML in tests
Processing JSON and XML using `grep` and `sed` is error-prone, overly
lax in some ways, overly strict in others, and neither accurate nor
expressive.  Use `jq` and `xmllint` with XPath expressions to make
things right in system tests.

See #3304

Merge branch '3304-properly-process-json-and-xml-in-tests' into 'main'

See merge request isc-projects/bind9!10942
2025-10-25 08:00:41 +02:00
Michał Kępień
5110dbacb9
Remove unused Perl scripts
The traffic-json.pl and traffic-xml.pl scripts that were used in the
"statschannel" system test in the past became dead code when commit
1202fd912a rewrote parts of that test to
Python.  Remove those scripts.
2025-10-25 07:37:48 +02:00
Michał Kępień
d08addc2be
Remove unused xmllint-html.sh script
There are no longer any HTML files in the BIND 9 source repository.
Remove the xmllint-html.sh script that was used in the past to check
those for errors.
2025-10-25 07:37:48 +02:00
Michał Kępień
5872000d9e
Use xmllint in system tests inspecting XML data
Inspecting XML data using sed and grep is error-prone, overly lax in
some ways, overly strict in others, and neither accurate nor expressive.
Use xmllint and XPath expressions for inspecting XML data in the
"statistics", "statschannel", and "synthfromdnssec" system tests to
address these deficiencies.
2025-10-25 07:37:48 +02:00
Michał Kępień
85773d4d21
Detect xmllint at build time
Detect whether and where the xmllint utility is available at build time,
so that it can be used in system tests.  If the tool is not found,
specific checks employing it will be skipped.
2025-10-25 07:37:48 +02:00
Michał Kępień
b494e02761
Use jq in system tests inspecting JSON data
Inspecting JSON data using grep is error-prone, overly lax in some ways,
overly strict in others, and neither accurate nor expressive.  Use jq
for inspecting JSON data in the "statschannel" and "synthfromdnssec"
system tests to address these deficiencies.
2025-10-25 07:37:48 +02:00
Michał Kępień
273b4bbfd7
Detect jq at build time
Detect whether and where the jq utility is available at build time, so
that it can be used in system tests.  If the tool is not found, specific
checks employing it will be skipped.
2025-10-25 07:37:48 +02:00
Ondřej Surý
08ccc8bea8 chg: dev: Fix assertion failure from arc4random_uniform with invalid limit
When the arc4random_uniform() is called on NetBSD with upper_bound that
makes no sense statistically (0 or 1), the call crashes the calling
program.  Fix this by returning 0 when upper bound is < 2 as does Linux,
FreeBSD and NetBSD.  (Hint: System CSPRNG should never crash.)

Closes #5596

Merge branch '5596-fix-isc_random_uniform-on-NetBSD' into 'main'

See merge request isc-projects/bind9!11147
2025-10-24 22:20:51 +02:00
Ondřej Surý
871bce312b Fix assertion failure from arc4random_uniform with invalid limit
When the arc4random_uniform() is called on NetBSD with upper_bound that
makes no sense statistically (0 or 1), the call crashes the calling
program.  Fix this by returning 0 when upper bound is < 2 as does Linux,
FreeBSD and NetBSD.  (Hint: System CSPRNG should never crash.)
2025-10-24 22:20:43 +02:00
Ondřej Surý
92dfbbff9e rem: test: Drop the unit test for testing randomness
Since we are using system routines for randomness, there's no point
in spending time and run the statistical suite for testing PRNG.

Merge branch 'ondrej/drop-random-unit-test' into 'main'

See merge request isc-projects/bind9!11137
2025-10-24 21:17:08 +02:00
Ondřej Surý
90b3def5e9
Drop the unit test for testing randomness
Since we are using system routines for randomness, there's no point
in spending time and run the statistical suite for testing PRNG.
2025-10-24 21:16:55 +02:00
Michal Nowak
6badc6e939 chg: pkg: minimal meson version required is 1.3.0
The minimal required meson version is 1.3.0.

Where distribution repositories don't provide meson 1.3.0 or newer, meson from PyPI may be used instead.

Merge branch 'aydin/meson-bump-version' into 'main'

See merge request isc-projects/bind9!10997
2025-10-24 18:35:00 +02:00
Aydın Mercan
9fd2632155
add muon's static analyzer to CI
Muon features a basic static analyzer that is functional enough to have
caught several meson mistakes.
2025-10-24 16:42:29 +02:00
Michal Nowak
c4f3aaeea1
Drop the NO_BUILD_TEST_PREREQ hack
With the updated meson, jammy does not need to avoid the
"meson-test-prereq" target.
2025-10-24 16:42:27 +02:00
Aydın Mercan
881ecfd8e5
get rid of unused meson variables
Found by muon's own static analyzer.
2025-10-24 16:42:26 +02:00
Aydın Mercan
9eaf32db1a
bump the minimum meson version to 1.3.0
After a couple releases, it appears that the minimum version can be
increased without much trouble.

Because meson only requires python 3.7 or greater, most supported
distributions can run a newer meson without having to deal with
additional dependencies or a new python version.
2025-10-24 16:42:24 +02:00
Michal Nowak
365f9f04d6 fix: pkg: fix fuzzing builds
Previously fuzzing builds were broken due to some typos in the `meson.build`.

Merge branch 'aydin/fuzz-meson-fix' into 'main'

See merge request isc-projects/bind9!11052
2025-10-24 15:37:36 +02:00
Michal Nowak
552dced1e5
Drop doh and geoip from pairwise testing exclusion list
doh and geoip features can be part of pairwise testing. Their exclusion
was a misunderstanding.
2025-10-24 14:35:28 +03:00
Aydın Mercan
5d7bc87cec
fix fuzzing
The fuzzing binary builds have been fixed and now is run as a part of
the test suite for sanity checks.

The `oss-fuzz` backend has been made functional with the addition of the
`oss-fuzz-args` option. It allows the setup script to pass the
LIB_FUZZING_ENGINE environment variable to meson.
2025-10-24 14:35:28 +03:00
Michal Nowak
fb2b56a888 fix: dev: Make libcap mandatory on Linux again
When refactoring the BIND 9.21 build system to meson, libcap was
unintentionally made optional on Linux.

Closes #5590

Merge branch '5590-make-libcap-mandatory-on-linux-again' into 'main'

See merge request isc-projects/bind9!11136
2025-10-24 11:24:45 +02:00
Michal Nowak
590c3c28e6
Make libcap mandatory on Linux again
When refactoring the BIND 9.21 build system to meson, libcap was
unintentionally made optional on Linux.
2025-10-24 10:46:53 +02:00
Michał Kępień
3849f59c29 new: ci: Automatically trigger rebase of -sub branches
After a merge into the public project, trigger automatic rebase in the respective private branch of the private project.

Merge branch 'pspacek/auto-rebase-sub-branches' into 'main'

See merge request isc-projects/bind9!11012
2025-10-24 04:47:26 +02:00
Petr Špaček
675d9c7425
Apply special git tag rules only in the private project
We do not want to re-release tags we create in the private project
anyway. Moreover pushing tags back into the public project after release
caused to Gitlab to create tag pipelines which never finished, which was
only confusing thing.
2025-10-24 04:42:58 +02:00
Petr Špaček
d65ac00715
Trigger rebase in private project after merge into the public one
Actual rebase and push is handled by pipeline inside the private project.
2025-10-24 04:42:58 +02:00
Petr Špaček
545ef542a1
Do not fail post-merge jobs if merge request reference is missing
Push without merge request reference on top happens when merging tags
back into the public project so these failures would produce log noise.
2025-10-24 04:42:58 +02:00
Petr Špaček
cbaf4fe6cd
Do not fail post-merge jobs after force-push
Rebase happens in -sub branches regularly so these failures would
produce log noice.
2025-10-24 04:42:58 +02:00
Petr Špaček
43b9628955
Deduplicate Git NAME and EMAIL variables
As an additional perk, I hope JOB_ID will make it easier to debug it
something goes wrong with automated commits.
2025-10-24 04:42:58 +02:00
Evan Hunt
3d0ddb5f9b chg: dev: Refactoring in lib/isccfg
`cfg_obj_t` objects no longer depend on the `cfg_parser_t` life-cycle; they can now persist until the last reference is detached. The `file` field, which was previously a pointer to memory allocated in the parser, is now a pointer to a subsidiary `cfg_obj_t` of type string. The API calls for creating and detaching these objects have been simplified accordingly.

Since `cfg_obj_t` is now long-lived, a zone can hold a reference to its own configuration data, making it possible to use `rndc showzone` even if `allow-new-zones` is disabled.

Several API calls related to the parser have been removed or hidden. The `cfg_parse_file()` and `cfg_parse_buffer()` functions now internally create and destroy their own parsers, eliminating the need for the caller to do so.

Most of these changes are intended to simplify dumping of running configuration data in a future commit.

Merge branch 'colin/hide-cfg-parser' into 'main'

See merge request isc-projects/bind9!11132
2025-10-23 20:43:07 +00:00
Evan Hunt
2877b57735 restore the former change_directory logging
change_directory() now lives in libisccfg. when it was moved,
the logging behavior changed: previously it had been logged
by named only, in the general logging category, and without the
named.conf filename and line number. it was not logged by
named-checkconf. this behavior has now been restored.
2025-10-23 13:01:31 -07:00
Colin Vidal
6f4d4ddb1c test rndc showzone works for named.conf zones
Since the zone now has a reference to their respective configuration
tree, `rndc showzone` can be used for any zones (including those
defined in namedconf), without `allow-new-zones` being enabled.
Add a test for this.

The test is part of the addzone suite because showzone used to be
related to addzone, but this could be moved elsewhere in the future
if more specific tests are needed for showzone.
2025-10-23 13:01:11 -07:00
Colin Vidal
6b5246b3d2 ensure parser/cfg_obj log includes the line number
Since the `file` property of cfg_obj_t can now be null (instead of
"none"), cfg_obj_t would take a fallback flow where the line was not
logged. This fixes it.

Also, add the log line when parser_complain is called and `file` is null
(which might happend when parsing buffer only) to also include the line
number.
2025-10-23 13:01:11 -07:00
Evan Hunt
0db377da57 simplify and regularize cfg_* functions
- several functions that can no longer fail have been changed to
  type void, and unnecessary 'cleanup' sections were removed
- renamed cfg_create_obj() to cfg_obj_create(), and cfg_create_tuple()
  to cfg_tuple_create(), to match typical nomenclature.
- fixed a memory leak bug, in which an element could be removed
  from a list in delete_zoneconf() without being freed. this has
  been addressed by adding a cfg_list_unlink() function.
  list elements are now allocated based on the list they will
  be stored in, using the same mctx.
2025-10-23 13:01:10 -07:00
Evan Hunt
4f7f2dae59 simplify cfg_parser API
- the cfg_parser_create() and cfg_parser_destroy() calls are no
  longer used outside parser.c, so they are now static functions
- cfg_parser_attach(), cfg_parser_reset(), and cfg_parser_setflags()
  are no longer used at all, and have been removed.
- cfg_parser_mapadd() has been renamed for clarity to cfg_map_add().
2025-10-23 13:01:09 -07:00
Colin Vidal
d03f6e6fd4 cfg_parse_ functions internally handle the parser
Instead of (1) allocating a parser, (2) parsing a file/buffer then (3)
freeing the parser, the parser is now internally created/destroyed from
within the `cfg_parse_*` functions. This simplifies a lot the use cases,
especially around the error cases where the parser needs to be freed in
a cleanup goto.

The only trick was the parser callback mechanism, which would previously
have been set up between steps 1 and 2.  Since it's never been used for
any purpose other than the "directory" option, the chdir call has now
been moved inside the parser and the generic callback mechanism has been
removed, replacing CFG_CLAUSEFLAG_CALLBACK with CFG_CLAUSEFLAG_CHDIR.
2025-10-23 13:01:08 -07:00
Evan Hunt
0191ba5540 store the zone configuration object in the zone
when configuring a zone, we can now save the zone's configuration
object in the zone itself by calling dns_zone_setcfg().  this can
then be used by "rndc showzone" to print the zone's configuration,
which is simpler than searching for it using the new-zones
configuration, and allows it to work even if "allow-new-zones"
is disabled.
2025-10-23 13:01:06 -07:00
Evan Hunt
6de1d0dbc4 update cfg_obj_attach/destroy
now that cfg_obj_destroy() has been simplified, we can use the
ISC_REFCOUNT macros to declare cfg_obj_attach() and _detach().
2025-10-23 13:01:02 -07:00
Colin Vidal
ea03d743f7 remove all shared and global parsers
Remove all global cfg_parser objects as well as shared parsers between
views to dynamically add zones. Instead, parser are transirently created
whenever needed.
2025-10-23 13:00:03 -07:00