# HG changeset patch # User Kim Alvefur # Date 1655660972 -7200 # Node ID ee5b061588ea33a9490b2d11401f9f988e06ae63 # Parent cc0ec027781305ac2313d3636fb3885d8fcbba2f net.unbound: Merge luaunbound and prosody defaults in absence of user config (fixes #1763) (thanks rgd) add_defaults() is supposed to merge 3 tables, the defaults in luaunbound, the defaults from prosody and any config from the prosody config file. In the case where no `unbound={}` has been in the config, it skips over the merge and returns only the prosody built-in defaults. This results in libunbound skipping reading resolv.conf and uses its default behavior of full recursive resolution. Prior to #1737 there were only two tables, the luaunbound defaults and the prosody config, where bypassing the merge and returning the former did the right thing. diff -r cc0ec0277813 -r ee5b061588ea net/unbound.lua --- a/net/unbound.lua Tue Jun 14 16:28:49 2022 +0200 +++ b/net/unbound.lua Sun Jun 19 19:49:32 2022 +0200 @@ -28,19 +28,16 @@ local builtin_defaults = { hoststxt = false } local function add_defaults(conf) - if conf then - for option, default in pairs(builtin_defaults) do - if conf[option] == nil then - conf[option] = default; - end + conf = conf or {}; + for option, default in pairs(builtin_defaults) do + if conf[option] == nil then + conf[option] = default; end - for option, default in pairs(libunbound.config) do - if conf[option] == nil then - conf[option] = default; - end + end + for option, default in pairs(libunbound.config) do + if conf[option] == nil then + conf[option] = default; end - else - return builtin_defaults; end return conf; end