diff --git a/NEWS b/NEWS index db4cd7a2803f41ffc6b7b16a3d4a4d3176df5f5c..a343d807600c95be816406287163012968765116 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ Improvements Bugfixes -------- - cache: missing filesystem support for pre-allocation is no longer fatal (#549) +- lua: policy.rpz() no longer watches the file when watch is set to false (!954) Knot Resolver 5.0.1 (2020-02-05) diff --git a/modules/policy/README.rst b/modules/policy/README.rst index 657ead6fc4883a7e63acf8ef86d84ae6d0e8b02e..0cc196ba3e6c26ea597c52551cba246576281e7e 100644 --- a/modules/policy/README.rst +++ b/modules/policy/README.rst @@ -285,11 +285,11 @@ Most properties (actions, filters) are described above. Like suffix match, but you can also provide a common suffix of all matches for faster processing (nil otherwise). This function is faster for small suffix tables (in the order of "hundreds"). -.. function:: policy.rpz(action, path, [watch]) +.. function:: policy.rpz(action, path, [watch = true]) :param action: the default action for match in the zone; typically you want ``policy.DENY`` :param path: path to zone file | database - :param watch: boolean, if not false, the file will be reloaded on file change + :param watch: boolean, if true, the file will be reloaded on file change Enforce RPZ_ rules. This can be used in conjunction with published blocklist feeds. The RPZ_ operation is well described in this `Jan-Piet Mens's post`_, diff --git a/modules/policy/policy.lua b/modules/policy/policy.lua index de58c31fea56f3a8e80bf712b01c5240dfaed0ae..2cc8f5ed6ecbd1167ece19481b8722a6530cab43 100644 --- a/modules/policy/policy.lua +++ b/modules/policy/policy.lua @@ -403,7 +403,7 @@ end function policy.rpz(action, path, watch) local rules = rpz_parse(action, path) - if watch or true then + if watch ~= false then local has_notify, notify = pcall(require, 'cqueues.notify') if has_notify then local bit = require('bit')