Vladimír Čunát [Fri, 9 Jun 2023 19:30:01 +0000 (21:30 +0200)]
ci: drop `doc`; we have `pages` instead now
The `pages` job works. We might consolidate this later,
also e.g. drop the doc dependencies from the default image
if we won't really use that image for docs anymore.
Vladimír Čunát [Tue, 6 Jun 2023 14:13:57 +0000 (16:13 +0200)]
lib/rules,cache: use transactions, improve assertions
When inserting rules from a config file, process everything
in a single transaction to avoid using inconsistent sets of rules,
especially in a different instance and/or in case some error happens.
Vladimír Čunát [Wed, 24 May 2023 11:05:13 +0000 (13:05 +0200)]
ci lint:scan-build: fix the error count
The new reports are:
./lib/rules/api.c:301:3: warning: Memory copy function overflows destination buffer
memcpy(key_data_ruleset_end, &KEY_EXACT_MATCH, sizeof(KEY_EXACT_MATCH));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/rules/api.c:506:2: warning: Memory copy function overflows destination buffer
memcpy(key.data, &KEY_EXACT_MATCH, sizeof(KEY_EXACT_MATCH));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/rules/api.c:699:2: warning: Memory copy function overflows destination buffer
memcpy(key.data, &KEY_ZONELIKE_A, sizeof(KEY_ZONELIKE_A));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
I re-checked those places, and I believe they can never overflow.
I regularly run with ASAN as well, which would catch overflows.
I can't see a simple way of amending the code in a way
that the linter might be happy.
Vladimír Čunát [Wed, 24 May 2023 10:12:42 +0000 (12:12 +0200)]
lib: tweak selection errors when consuming cached answer
Forwarding-related changes uncovered this case
in integration.iter_limits test. Errors can happen also
when consuming data produced by cache, in which case there's
no suitable server to blame for the error.
Vladimír Čunát [Fri, 19 May 2023 07:09:06 +0000 (09:09 +0200)]
lib/rules: implement forwarding
Typical use cases should work now, briefly tested:
- forwarding all to a resolver
- forwarding a subtree downgraded to insecure (to resolver or auth)
- forwarding a subtree to auth without changing DNSSEC chain (atypical)
In some places we need to repeat kr_make_query()
The issue is that some of its inputs (e.g. STUB/FORWARD, zone cut)
are now not known at the beginning of PRODUCE yet.
Also, checking that QNAME matches is useless on a cached reply.
Vladimír Čunát [Sun, 7 May 2023 07:46:21 +0000 (09:46 +0200)]
lib/resolve.c: split in two files
I know that moving code makes e.g. blaming harder,
but this was a really long file now.
This commit _only_ moves code, except for nits:
- minor pieces moved into an -impl.h shared by both resolve*.c
There a couple functions changed to non-static or static inline.
- order is preserved, for now at least
Vladimír Čunát [Fri, 28 Apr 2023 09:19:33 +0000 (11:19 +0200)]
lib/rules: add API for loading a zonefile
Two main use cases are actual RPZ file
and also the /local-data/records string (plain RRsets).
The RPZ semantics isn't very close to the specs,
but I believe the practical usability is already better
than our old RPZ implementation, thanks to following CNAMEs.
Vladimír Čunát [Wed, 22 Jul 2020 16:43:04 +0000 (18:43 +0200)]
new policy engine - prototype
Picked up old work, rebase-squashed after many months;
then fixed up a little as needed in this newer version.
(and later many minor fixes got squashed in)
Vladimír Čunát [Wed, 22 Jul 2020 08:29:16 +0000 (10:29 +0200)]
lib/cache: simplify passing qry/req parameters
- kr_layer_t isn't really useful in the inner functions
(it's mainly useful through ->state when returning from layer)
- kr_query seems a little more suitable to pass than kr_request
Oto Šťáva [Wed, 7 Jun 2023 13:04:10 +0000 (15:04 +0200)]
tests/dnstap: let Go handle its transitive dependencies
Dependabot reported that we have some vulnerable dependencies. The
problem is that the ones it wants to bump to do not support older Go
versions, which we need to use due to some distros not having the most
recent Go packages available.
The `go.sum` file contains the outdated ones (because I tried with an
older Go), but as far as I can tell, from Go docs and other places, it
is actually not a lockfile, so newer Go should update the packages
regardless of what is in `go.sum`.
Oto Šťáva [Wed, 7 Jun 2023 06:15:41 +0000 (08:15 +0200)]
tests/pytests: adapt to new pylint
New version of pylint removed the disabled `bad-continuation` check. It
also added a parens check that we were violating in
`test_random_close.py`, which is now fixed as well.