]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/prefill: fix moving across filesystems docs-prefill-rena-cs1397/deployments/7130
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 11 Jun 2025 17:22:11 +0000 (19:22 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 4 Jul 2025 17:21:19 +0000 (19:21 +0200)
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 :-/

NEWS
modules/prefill/prefill.lua

diff --git a/NEWS b/NEWS
index 2af1d8f62a108ed012adee353c133f64030f3d0c..691df0e06d14c0e71ecf1b899f7e363efe35e8c5 100644 (file)
--- 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)
index 58849f5ab6fdaf6faa4a9381dc3fc20827027afc..e6ae2f4622659cc5728f2c7df12c189ca8997b5a 100644 (file)
@@ -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