From: Vladimír Čunát Date: Wed, 11 Jun 2025 17:22:11 +0000 (+0200) Subject: modules/prefill: fix moving across filesystems X-Git-Tag: v6.0.15~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fenvironments%2Fdocs-prefill-rena-cs1397%2Fdeployments%2F7130;p=thirdparty%2Fknot-resolver.git modules/prefill: fix moving across filesystems I somehow thought thought that `os.rename()` behaves like the `mv` command, and unfortunately in the way I tested this, everything was inside a single mount-point. Official docs is one line that doesn't explain anything really :-/ --- diff --git a/NEWS b/NEWS index 2af1d8f62..691df0e06 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ Bugfixes - /network/edns-buffer-size: fix swapped upstream+downstream (!1711) - cache: fix a crash in case garbage collection is too slow (!1713) [system] assertion "env->is_cache" failed in cdb_write +- /cache/prefill: fix 6.0.13 regression (!1705) Knot Resolver 6.0.14 (2025-06-03) diff --git a/modules/prefill/prefill.lua b/modules/prefill/prefill.lua index 58849f5ab..e6ae2f462 100644 --- a/modules/prefill/prefill.lua +++ b/modules/prefill/prefill.lua @@ -70,7 +70,8 @@ end local function download(url, fname) local kluautil = require('kluautil') - local fname_tmp = os.tmpname() + -- fname_tmp is in the same directory, as os.rename below refuses to work across filesystems + local fname_tmp = fname .. '.' .. worker.id .. '.tmp' local file, ok, errmsg file, errmsg = io.open(fname_tmp, 'w') if not file then