From 1764752eebf5d025cd39cb4cc2f0f61beb586b55 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Thu, 25 Jul 2024 14:27:04 +0200 Subject: views: improve interaction with old-style policies i.e. respect the old chain-rule notion in this case. ... because why not, and someone wanted to use it this way already. Logically it makes sense in some cases, but I still implore to prefer 6.x -style rules where possible, as e.g. the interations are better. --- modules/policy/policy.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/policy/policy.lua b/modules/policy/policy.lua index 60b03478..f599e7d1 100644 --- a/modules/policy/policy.lua +++ b/modules/policy/policy.lua @@ -857,10 +857,14 @@ function policy.TAGS_ASSIGN(names) end -- Perform a list of actions sequentially; meant for kr_view_insert_action(). +-- Return value of the last one is propagated. function policy.COMBINE(list) if #list == 1 then return list[1] end local r = 'function(state,req) ' - for _, item in ipairs(list) do + for i, item in ipairs(list) do + if i == #list then + r = r .. 'return ' + end r = r .. item .. '(state,req); ' end return r .. 'end' @@ -934,7 +938,11 @@ policy.layer = { if ffi.C.kr_view_select_action(req, view_action_buf) == 0 then local act_str = ffi.string(view_action_buf[0].data, view_action_buf[0].len) - return loadstring('return '..act_str)()(state, req) + local new_state = loadstring('return '..act_str)()(state, req) + -- We still respect the chain-rule notion, i.e. we skip + -- lua-configured policy rules iff the action was "final" + -- (`refused` and `noanswer` in the current 6.x) + if new_state ~= nil then return new_state end end local qry = req:initial() -- same as :current() but more descriptive -- cgit v1.2.3 From b905135b48b64e034c1ea83cc9e759654b3aa2b3 Mon Sep 17 00:00:00 2001 From: Frantisek Tobias Date: Mon, 19 Aug 2024 17:16:38 +0200 Subject: modules/stats: add answer.stale --- NEWS | 1 + daemon/lua/kres-gen-33.lua | 1 + lib/resolve.h | 1 + manager/knot_resolver_manager/statistics.py | 6 ++++++ modules/serve_stale/serve_stale.lua | 7 +++++-- modules/stats/README.rst | 2 ++ modules/stats/stats.c | 8 +++++++- 7 files changed, 23 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/NEWS b/NEWS index a9540326..11c4bc45 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ Improvements - answer NOTIMPL for meta-types and non-IN RR classes (!1589) - views: improve interaction with old-style policies (!1576) +- stats: add stale answer counter 'answer.stale' (!1591) Bugfixes -------- diff --git a/daemon/lua/kres-gen-33.lua b/daemon/lua/kres-gen-33.lua index 6be16bc4..40a03453 100644 --- a/daemon/lua/kres-gen-33.lua +++ b/daemon/lua/kres-gen-33.lua @@ -248,6 +248,7 @@ struct kr_request { ranked_rr_array_t add_selected; _Bool answ_validated; _Bool auth_validated; + _Bool stale_accounted; uint8_t rank; struct kr_rplan rplan; trace_log_f trace_log; diff --git a/lib/resolve.h b/lib/resolve.h index 443fef29..cbc20877 100644 --- a/lib/resolve.h +++ b/lib/resolve.h @@ -260,6 +260,7 @@ struct kr_request { ranked_rr_array_t add_selected; bool answ_validated; /**< internal to validator; beware of caching, etc. */ bool auth_validated; /**< see answ_validated ^^ ; TODO */ + bool stale_accounted; /** Overall rank for the request. * diff --git a/manager/knot_resolver_manager/statistics.py b/manager/knot_resolver_manager/statistics.py index 4a0eb783..ae9d9811 100644 --- a/manager/knot_resolver_manager/statistics.py +++ b/manager/knot_resolver_manager/statistics.py @@ -119,6 +119,12 @@ if _prometheus_support: label=("instance_id", sid), value=metrics["answer"]["cached"], ) + yield _counter( + "resolver_answer_stale", + "number of queries that utilized stale data", + label=("instance_id", sid), + value=metrics["answer"]["stale"], + ) yield _counter( "resolver_answer_rcode_noerror", "number of NOERROR answers", diff --git a/modules/serve_stale/serve_stale.lua b/modules/serve_stale/serve_stale.lua index faf07fbe..c1528e80 100644 --- a/modules/serve_stale/serve_stale.lua +++ b/modules/serve_stale/serve_stale.lua @@ -8,9 +8,10 @@ local ffi = require('ffi') M.timeout = 3*sec M.callback = ffi.cast("kr_stale_cb", - function (ttl) --, name, type, qry) + function (ttl, _, _, qry) --log_debug(ffi.C.SRVSTALE, ' => called back with TTL: ' .. tostring(ttl)) if ttl + 3600 * 24 > 0 then -- at most one day stale + qry.request.stale_accounted = true return 1 else return -1 @@ -27,7 +28,9 @@ M.layer = { local now = ffi.C.kr_now() local deadline = qry.creation_time_mono + M.timeout if now > deadline or qry.flags.NO_NS_FOUND then - log_debug(ffi.C.LOG_GRP_SRVSTALE, ' => no reachable NS, using stale data') + log_qry(qry, ffi.C.LOG_GRP_SRVSTALE, + ' => no reachable NS, using stale data "%s"', + kres.dname2str(qry:name())) qry.stale_cb = M.callback -- TODO: probably start the same request that doesn't stale-serve, -- but first we need some detection of non-interactive / internal requests. diff --git a/modules/stats/README.rst b/modules/stats/README.rst index 1def925c..e9258274 100644 --- a/modules/stats/README.rst +++ b/modules/stats/README.rst @@ -55,6 +55,8 @@ Built-in counters keep track of number of queries and answers matching specific +-----------------+----------------------------------+ | answer.cached | queries answered from cache | +-----------------+----------------------------------+ +| answer.stale | queries that utilized stale data | ++-----------------+----------------------------------+ +-----------------+----------------------------------+ | **Answers categorized by RCODE** | diff --git a/modules/stats/stats.c b/modules/stats/stats.c index deed9c94..596847d7 100644 --- a/modules/stats/stats.c +++ b/modules/stats/stats.c @@ -37,12 +37,17 @@ #define UPSTREAMS_COUNT 512 /* Size of recent upstreams */ #endif -/** @cond internal Fixed-size map of predefined metrics. */ +/** @cond internal Fixed-size map of predefined metrics. + * + * When changing the list, don't forget _parse_resolver_metrics() + * in ../../manager/knot_resolver_manager/statistics.py + */ #define CONST_METRICS(X) \ X(answer,total) X(answer,noerror) X(answer,nodata) X(answer,nxdomain) X(answer,servfail) \ X(answer,cached) X(answer,1ms) X(answer,10ms) X(answer,50ms) X(answer,100ms) \ X(answer,250ms) X(answer,500ms) X(answer,1000ms) X(answer,1500ms) X(answer,slow) \ X(answer,sum_ms) \ + X(answer,stale) \ X(answer,aa) X(answer,tc) X(answer,rd) X(answer,ra) X(answer, ad) X(answer,cd) \ X(answer,edns0) X(answer,do) \ X(query,edns) X(query,dnssec) \ @@ -303,6 +308,7 @@ static int collect(kr_layer_t *ctx) DEPRECATED use new names metric_answer_edns0 and metric_answer_do */ + stat_const_add(data, metric_answer_stale, param->stale_accounted); stat_const_add(data, metric_query_edns, knot_pkt_has_edns(param->answer)); stat_const_add(data, metric_query_dnssec, knot_pkt_has_dnssec(param->answer)); -- cgit v1.2.3 From 39f4b5af72f3aca0174476235f43915477f20adb Mon Sep 17 00:00:00 2001 From: menakite <29005531+menakite@users.noreply.github.com> Date: Wed, 14 Aug 2024 19:36:54 +0200 Subject: cache: move setting EDE "Stale Answer" to the the serve_stale module. It is not guaranteed yet that the request will finish in state DONE. This prevents other EDE codes from being applied to the request and in case the request ends in FAIL state it produces a SERVFAIL answer with EDE "Stale Answer", which is a bit weird. Move setting EDEs in answer_finalize in the serve_stale module, where the proper EDE in case of NXDOMAIN is set too. --- lib/cache/api.c | 4 +--- modules/serve_stale/serve_stale.lua | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/lib/cache/api.c b/lib/cache/api.c index 0cd18534..046dae20 100644 --- a/lib/cache/api.c +++ b/lib/cache/api.c @@ -237,9 +237,7 @@ int32_t get_new_ttl(const struct entry_h *entry, const struct kr_query *qry, int res_stale = qry->stale_cb(res, owner, type, qry); if (res_stale >= 0) { VERBOSE_MSG(qry, "responding with stale answer\n"); - /* LATER: Perhaps we could use a more specific Stale - * NXDOMAIN Answer code for applicable responses. */ - kr_request_set_extended_error(qry->request, KNOT_EDNS_EDE_STALE, "6Q6X"); + qry->request->stale_accounted = true; return res_stale; } } diff --git a/modules/serve_stale/serve_stale.lua b/modules/serve_stale/serve_stale.lua index c1528e80..7aa2ee78 100644 --- a/modules/serve_stale/serve_stale.lua +++ b/modules/serve_stale/serve_stale.lua @@ -11,7 +11,6 @@ M.callback = ffi.cast("kr_stale_cb", function (ttl, _, _, qry) --log_debug(ffi.C.SRVSTALE, ' => called back with TTL: ' .. tostring(ttl)) if ttl + 3600 * 24 > 0 then -- at most one day stale - qry.request.stale_accounted = true return 1 else return -1 @@ -39,6 +38,23 @@ M.layer = { return state end, + + answer_finalize = function (state, req) + local qry = req:resolved() + if state ~= kres.DONE or qry == nil then + return state + end + + if req.stale_accounted and qry.stale_cb ~= nil then + if req.answer:rcode() == kres.rcode.NOERROR then + req:set_extended_error(kres.extended_error.STALE, 'WFAC') + elseif req.answer:rcode() == kres.rcode.NXDOMAIN then + req:set_extended_error(kres.extended_error.STALE_NXD, 'QSF6') + end + end + + return state + end, } return M -- cgit v1.2.3 From f4305163b032b31850ec70751dbf4e080a411ee7 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Wed, 21 Aug 2024 14:14:26 +0200 Subject: modules/serve_stale: drop the unused arguments again This should fix the lint:other CI. Forgotten in 39f4b5af72f3a. --- modules/serve_stale/serve_stale.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/serve_stale/serve_stale.lua b/modules/serve_stale/serve_stale.lua index 7aa2ee78..d1b18f90 100644 --- a/modules/serve_stale/serve_stale.lua +++ b/modules/serve_stale/serve_stale.lua @@ -8,7 +8,7 @@ local ffi = require('ffi') M.timeout = 3*sec M.callback = ffi.cast("kr_stale_cb", - function (ttl, _, _, qry) + function (ttl) --, name, type, qry) --log_debug(ffi.C.SRVSTALE, ' => called back with TTL: ' .. tostring(ttl)) if ttl + 3600 * 24 > 0 then -- at most one day stale return 1 -- cgit v1.2.3 From 6eddeec96536df1b859d64b147f687519d5305d6 Mon Sep 17 00:00:00 2001 From: Aleš Mrázek Date: Fri, 2 Aug 2024 18:53:50 +0200 Subject: scripts: use env shebang --- ci/gh_actions.py | 2 +- ci/respdiff/run-respdiff-tests.sh | 2 +- daemon/lua/kres-gen.sh | 2 +- modules/ta_update/ta_update.test.integr/rfc5011/dns2rpl.py | 2 +- modules/ta_update/ta_update.test.integr/rfc5011/genkeyszones.sh | 2 +- poe | 2 +- scripts/bench.sh | 2 +- scripts/bugreport-journals.py | 2 +- scripts/build-in-obs.sh | 2 +- scripts/coverage_c_combine.sh | 2 +- scripts/coverage_env.sh | 2 +- scripts/create_setup.py | 2 +- scripts/enable-repo-cznic-labs.sh | 2 +- scripts/gen-cdefs.sh | 2 +- scripts/gen-pgp-keyblock.sh | 2 +- scripts/get-date.sh | 2 +- scripts/luacov_gen_empty.sh | 2 +- scripts/make-archive.sh | 2 +- scripts/make-doc.sh | 2 +- scripts/make-obs.sh | 2 +- scripts/make-package.sh | 2 +- scripts/poe-tasks/check | 2 +- scripts/poe-tasks/configure | 2 +- scripts/poe-tasks/docs | 2 +- scripts/poe-tasks/examples | 2 +- scripts/poe-tasks/format | 2 +- scripts/poe-tasks/gen-setuppy | 2 +- scripts/poe-tasks/kresctl | 2 +- scripts/poe-tasks/man | 4 ++-- scripts/poe-tasks/run | 2 +- scripts/poe-tasks/run-debug | 4 ++-- scripts/poe-tasks/test | 2 +- scripts/run-pylint.sh | 2 +- scripts/run-scanbuild-with-args.sh | 2 +- scripts/test-config.sh | 2 +- scripts/test-integration-prepare.sh | 2 +- scripts/update-authors.sh | 2 +- scripts/update-root-hints.sh | 2 +- scripts/upstream-version.sh | 2 +- tests/dnstap/src/dnstap-test/run.sh | 2 +- tests/integration/deckard | 2 +- tests/packaging/dependencies.py | 2 +- tests/packaging/interactive/cache-clear.sh | 2 +- tests/packaging/interactive/etag.sh | 2 +- tests/packaging/interactive/metrics.sh | 2 +- tests/packaging/interactive/reload.sh | 2 +- tests/packaging/interactive/workers.sh | 2 +- tests/packaging/knot-resolver.sh | 2 +- tests/packaging/kresctl.sh | 2 +- tests/packaging/systemd_service.sh | 2 +- 50 files changed, 52 insertions(+), 52 deletions(-) (limited to 'modules') diff --git a/ci/gh_actions.py b/ci/gh_actions.py index bbeb3b34..b99096f5 100755 --- a/ci/gh_actions.py +++ b/ci/gh_actions.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-3.0-or-later import json import time diff --git a/ci/respdiff/run-respdiff-tests.sh b/ci/respdiff/run-respdiff-tests.sh index 2bfc44d9..6f065038 100755 --- a/ci/respdiff/run-respdiff-tests.sh +++ b/ci/respdiff/run-respdiff-tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # $1 == udp/tcp/tls, it selects configuration file to use diff --git a/daemon/lua/kres-gen.sh b/daemon/lua/kres-gen.sh index d335c0ec..d14c0286 100755 --- a/daemon/lua/kres-gen.sh +++ b/daemon/lua/kres-gen.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # Run with "ninja kres-gen" to re-generate $1 diff --git a/modules/ta_update/ta_update.test.integr/rfc5011/dns2rpl.py b/modules/ta_update/ta_update.test.integr/rfc5011/dns2rpl.py index 317d6719..6002e830 100755 --- a/modules/ta_update/ta_update.test.integr/rfc5011/dns2rpl.py +++ b/modules/ta_update/ta_update.test.integr/rfc5011/dns2rpl.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 """ Generate RFC 5011 test simulating successful KSK roll-over in 2017. diff --git a/modules/ta_update/ta_update.test.integr/rfc5011/genkeyszones.sh b/modules/ta_update/ta_update.test.integr/rfc5011/genkeyszones.sh index 4a654695..5ff1d8f1 100755 --- a/modules/ta_update/ta_update.test.integr/rfc5011/genkeyszones.sh +++ b/modules/ta_update/ta_update.test.integr/rfc5011/genkeyszones.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash # First, generate DNSSEC keys with timers set to simulate 2017 KSK roll-over. # Second, fake system time to pretend that we are at the beginning on time slots diff --git a/poe b/poe index b1fafd95..17926194 100755 --- a/poe +++ b/poe @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash script_dir="$(dirname "$(readlink -f "$0")")" diff --git a/scripts/bench.sh b/scripts/bench.sh index 232c5231..d5a9f38e 100755 --- a/scripts/bench.sh +++ b/scripts/bench.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later set -o errexit -o nounset diff --git a/scripts/bugreport-journals.py b/scripts/bugreport-journals.py index d66ddfba..bb4d9f24 100755 --- a/scripts/bugreport-journals.py +++ b/scripts/bugreport-journals.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 """ Collect systemd-journal log entries around time of daemon exit and coredumps. """ diff --git a/scripts/build-in-obs.sh b/scripts/build-in-obs.sh index 3256ddee..176b9ad4 100755 --- a/scripts/build-in-obs.sh +++ b/scripts/build-in-obs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # # Push packaging files to OBS diff --git a/scripts/coverage_c_combine.sh b/scripts/coverage_c_combine.sh index a891ded5..46181119 100755 --- a/scripts/coverage_c_combine.sh +++ b/scripts/coverage_c_combine.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # $1 = top source directory diff --git a/scripts/coverage_env.sh b/scripts/coverage_env.sh index 0f6810f7..4f55d857 100755 --- a/scripts/coverage_env.sh +++ b/scripts/coverage_env.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # generate variables for coverage testing diff --git a/scripts/create_setup.py b/scripts/create_setup.py index 087ce3b0..2240cea8 100755 --- a/scripts/create_setup.py +++ b/scripts/create_setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Original source: diff --git a/scripts/enable-repo-cznic-labs.sh b/scripts/enable-repo-cznic-labs.sh index cbc64c68..e7c53a82 100755 --- a/scripts/enable-repo-cznic-labs.sh +++ b/scripts/enable-repo-cznic-labs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # enable CZ.NIC Labs Debian/Ubuntu repos - see https://pkg.labs.nic.cz/doc/ set -e diff --git a/scripts/gen-cdefs.sh b/scripts/gen-cdefs.sh index d56ab86d..968f40b9 100755 --- a/scripts/gen-cdefs.sh +++ b/scripts/gen-cdefs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later set -o pipefail -o errexit diff --git a/scripts/gen-pgp-keyblock.sh b/scripts/gen-pgp-keyblock.sh index 29855312..bfdb2349 100755 --- a/scripts/gen-pgp-keyblock.sh +++ b/scripts/gen-pgp-keyblock.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Script to create/update Knot Resolver PGP keyring set -o errexit -o nounset diff --git a/scripts/get-date.sh b/scripts/get-date.sh index 36531558..fed10048 100755 --- a/scripts/get-date.sh +++ b/scripts/get-date.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later set -o nounset cd "$(dirname $0)/.." diff --git a/scripts/luacov_gen_empty.sh b/scripts/luacov_gen_empty.sh index 127734df..a953d914 100755 --- a/scripts/luacov_gen_empty.sh +++ b/scripts/luacov_gen_empty.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # Generate stats file in luacov format indicating that files named on stdin # were not processed. diff --git a/scripts/make-archive.sh b/scripts/make-archive.sh index 9f2be0ea..b4cd3367 100755 --- a/scripts/make-archive.sh +++ b/scripts/make-archive.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # Create a development tarball set -o errexit -o nounset -o xtrace diff --git a/scripts/make-doc.sh b/scripts/make-doc.sh index 1723ada7..503d7943 100755 --- a/scripts/make-doc.sh +++ b/scripts/make-doc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later set -o errexit -o nounset cd "$(dirname "${0}")/.." diff --git a/scripts/make-obs.sh b/scripts/make-obs.sh index abe96701..cc0aab73 100755 --- a/scripts/make-obs.sh +++ b/scripts/make-obs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # # create OpenSUSE Build System (OBS) source package diff --git a/scripts/make-package.sh b/scripts/make-package.sh index 85549e65..8b0ba95c 100755 --- a/scripts/make-package.sh +++ b/scripts/make-package.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit set -o nounset diff --git a/scripts/poe-tasks/check b/scripts/poe-tasks/check index 08ce18a8..5563a9de 100755 --- a/scripts/poe-tasks/check +++ b/scripts/poe-tasks/check @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/poe-tasks/configure b/scripts/poe-tasks/configure index 452b1a3b..1ca961a7 100755 --- a/scripts/poe-tasks/configure +++ b/scripts/poe-tasks/configure @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/poe-tasks/docs b/scripts/poe-tasks/docs index d15c074e..6a62eb78 100755 --- a/scripts/poe-tasks/docs +++ b/scripts/poe-tasks/docs @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/poe-tasks/examples b/scripts/poe-tasks/examples index 45f22436..c214167a 100755 --- a/scripts/poe-tasks/examples +++ b/scripts/poe-tasks/examples @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/poe-tasks/format b/scripts/poe-tasks/format index fa113f19..0a83e3c2 100755 --- a/scripts/poe-tasks/format +++ b/scripts/poe-tasks/format @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/poe-tasks/gen-setuppy b/scripts/poe-tasks/gen-setuppy index 752beea1..3f337b39 100755 --- a/scripts/poe-tasks/gen-setuppy +++ b/scripts/poe-tasks/gen-setuppy @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/poe-tasks/kresctl b/scripts/poe-tasks/kresctl index 4b4880b7..e46ad3c1 100755 --- a/scripts/poe-tasks/kresctl +++ b/scripts/poe-tasks/kresctl @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/poe-tasks/man b/scripts/poe-tasks/man index ba28e414..9b06b360 100755 --- a/scripts/poe-tasks/man +++ b/scripts/poe-tasks/man @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" @@ -6,4 +6,4 @@ source $src_dir/_env.sh build_kresd -man -l .install_kresd/share/man/man8/$1* \ No newline at end of file +man -l .install_kresd/share/man/man8/$1* diff --git a/scripts/poe-tasks/run b/scripts/poe-tasks/run index c1bdf78b..f217988d 100755 --- a/scripts/poe-tasks/run +++ b/scripts/poe-tasks/run @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/poe-tasks/run-debug b/scripts/poe-tasks/run-debug index b48f2359..661b7fe2 100755 --- a/scripts/poe-tasks/run-debug +++ b/scripts/poe-tasks/run-debug @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" @@ -10,4 +10,4 @@ echo The manager will start after you connect echo API will be running on port 5000 echo ---------------------------------------- -KRES_DEBUG_MANAGER=1 poe run $@ \ No newline at end of file +KRES_DEBUG_MANAGER=1 poe run $@ diff --git a/scripts/poe-tasks/test b/scripts/poe-tasks/test index 0f451b68..3c1d7a9c 100755 --- a/scripts/poe-tasks/test +++ b/scripts/poe-tasks/test @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ensure consistent behaviour src_dir="$(dirname "$(realpath "$0")")" diff --git a/scripts/run-pylint.sh b/scripts/run-pylint.sh index 92413826..653d54bd 100755 --- a/scripts/run-pylint.sh +++ b/scripts/run-pylint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later set -o errexit -o nounset diff --git a/scripts/run-scanbuild-with-args.sh b/scripts/run-scanbuild-with-args.sh index b2954536..fa4a98cd 100755 --- a/scripts/run-scanbuild-with-args.sh +++ b/scripts/run-scanbuild-with-args.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later set -o errexit -o nounset diff --git a/scripts/test-config.sh b/scripts/test-config.sh index 695e5182..2b55066d 100755 --- a/scripts/test-config.sh +++ b/scripts/test-config.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # Utility script used by meson to run config tests post installation set -o nounset -o errexit diff --git a/scripts/test-integration-prepare.sh b/scripts/test-integration-prepare.sh index 13db1438..17f08df3 100755 --- a/scripts/test-integration-prepare.sh +++ b/scripts/test-integration-prepare.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later set -o errexit -o nounset diff --git a/scripts/update-authors.sh b/scripts/update-authors.sh index 8ccb77ed..4e2f6806 100755 --- a/scripts/update-authors.sh +++ b/scripts/update-authors.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # avoid confusing changes in ordering diff --git a/scripts/update-root-hints.sh b/scripts/update-root-hints.sh index 5f7a564b..862d834b 100755 --- a/scripts/update-root-hints.sh +++ b/scripts/update-root-hints.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later set -o nounset -o xtrace diff --git a/scripts/upstream-version.sh b/scripts/upstream-version.sh index 77613b70..4efa42db 100755 --- a/scripts/upstream-version.sh +++ b/scripts/upstream-version.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # # return latest upstream version of Knot Resolver diff --git a/tests/dnstap/src/dnstap-test/run.sh b/tests/dnstap/src/dnstap-test/run.sh index 70d82254..f1ed9fb2 100755 --- a/tests/dnstap/src/dnstap-test/run.sh +++ b/tests/dnstap/src/dnstap-test/run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e KRESD_CMD=$1 MESON_BUILD_ROOT=$(pwd) diff --git a/tests/integration/deckard b/tests/integration/deckard index b5b33867..0e100ff1 160000 --- a/tests/integration/deckard +++ b/tests/integration/deckard @@ -1 +1 @@ -Subproject commit b5b338678d48a9807097000afe03ebfdf705f7a3 +Subproject commit 0e100ff13d4df3208d63b74ab4812b7e2a0c17bf diff --git a/tests/packaging/dependencies.py b/tests/packaging/dependencies.py index 324ff30b..1262d2e1 100755 --- a/tests/packaging/dependencies.py +++ b/tests/packaging/dependencies.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import importlib import importlib.util diff --git a/tests/packaging/interactive/cache-clear.sh b/tests/packaging/interactive/cache-clear.sh index 377cf5d3..79d88a12 100755 --- a/tests/packaging/interactive/cache-clear.sh +++ b/tests/packaging/interactive/cache-clear.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # clear full cache kresctl cache clear diff --git a/tests/packaging/interactive/etag.sh b/tests/packaging/interactive/etag.sh index f14ef96a..3a9de46c 100755 --- a/tests/packaging/interactive/etag.sh +++ b/tests/packaging/interactive/etag.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/tests/packaging/interactive/metrics.sh b/tests/packaging/interactive/metrics.sh index 1ad48930..63ac035d 100755 --- a/tests/packaging/interactive/metrics.sh +++ b/tests/packaging/interactive/metrics.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/tests/packaging/interactive/reload.sh b/tests/packaging/interactive/reload.sh index 9daa1890..85bca315 100755 --- a/tests/packaging/interactive/reload.sh +++ b/tests/packaging/interactive/reload.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/tests/packaging/interactive/workers.sh b/tests/packaging/interactive/workers.sh index 4f54f6ae..b23afcdb 100755 --- a/tests/packaging/interactive/workers.sh +++ b/tests/packaging/interactive/workers.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash expected_workers="5" diff --git a/tests/packaging/knot-resolver.sh b/tests/packaging/knot-resolver.sh index 6aa38bde..2c252f7e 100755 --- a/tests/packaging/knot-resolver.sh +++ b/tests/packaging/knot-resolver.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # fail fast set -e diff --git a/tests/packaging/kresctl.sh b/tests/packaging/kresctl.sh index 579f1a10..aff02b6b 100755 --- a/tests/packaging/kresctl.sh +++ b/tests/packaging/kresctl.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # fail fast set -e diff --git a/tests/packaging/systemd_service.sh b/tests/packaging/systemd_service.sh index c6ac826b..9dec16ab 100755 --- a/tests/packaging/systemd_service.sh +++ b/tests/packaging/systemd_service.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # fail fast set -e -- cgit v1.2.3 From e2742842fc9b2b24a7bff1fd533a70a212f0cd77 Mon Sep 17 00:00:00 2001 From: menakite <29005531+menakite@users.noreply.github.com> Date: Sat, 17 Aug 2024 03:10:25 +0200 Subject: modules/dns64: change EDE from "Forged Answer" to "Synthesized". --- modules/dns64/dns64.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/dns64/dns64.lua b/modules/dns64/dns64.lua index b4fb1ecb..4dc8cb45 100644 --- a/modules/dns64/dns64.lua +++ b/modules/dns64/dns64.lua @@ -152,7 +152,7 @@ function M.layer.consume(state, req, pkt) end end ffi.C.kr_ranked_rrarray_finalize(req.answ_selected, qry.uid, req.pool) - req:set_extended_error(kres.extended_error.FORGED, "BHD4: DNS64 synthesis") + req:set_extended_error(kres.extended_error.SYNTHESIZED, "BHD4: from DNS64") end local function hexchar2int(char) -- cgit v1.2.3 From 18d88a87de5cad3918761130b5d250ac25b5e2a0 Mon Sep 17 00:00:00 2001 From: menakite <29005531+menakite@users.noreply.github.com> Date: Fri, 16 Aug 2024 06:12:33 +0200 Subject: modules/workarounds: fix module initialisation. Rename config to init, which is called when a module is loaded. It seems it's been broken for a while. --- modules/workarounds/workarounds.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/workarounds/workarounds.lua b/modules/workarounds/workarounds.lua index 4ce7c478..4cbfdb9d 100644 --- a/modules/workarounds/workarounds.lua +++ b/modules/workarounds/workarounds.lua @@ -4,7 +4,7 @@ if not policy then modules.load('policy') end local M = {} -- the module -function M.config() +function M.init() policy.add(policy.suffix(policy.FLAGS('NO_0X20'), { -- https://github.com/DNS-OARC/dns-violations/blob/master/2017/DVE-2017-0003.md todname('avqs.mcafee.com'), todname('avts.mcafee.com'), -- cgit v1.2.3