aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-02-16 22:42:57 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-02-17 00:19:24 -0300
commit7a9bfd8dae3a1611366fc42b06f7ec34bc5347d6 (patch)
tree585e123aeeebc4e44444430af5beaccc50a1fa75
parentc0fe94c4a6f8c82e6d85a3700bab0e74e4244c4d (diff)
downloadluarocks-7a9bfd8dae3a1611366fc42b06f7ec34bc5347d6.tar.gz
luarocks-7a9bfd8dae3a1611366fc42b06f7ec34bc5347d6.tar.bz2
luarocks-7a9bfd8dae3a1611366fc42b06f7ec34bc5347d6.zip
fix: avoid cross-device links
Fixes #1559
-rw-r--r--src/luarocks/fs/unix/tools.lua5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua
index 7106ed81..42e22060 100644
--- a/src/luarocks/fs/unix/tools.lua
+++ b/src/luarocks/fs/unix/tools.lua
@@ -318,10 +318,7 @@ end
318function tools.lock_access(dirname, force) 318function tools.lock_access(dirname, force)
319 fs.make_dir(dirname) 319 fs.make_dir(dirname)
320 320
321 local tempfile = os.tmpname() 321 local tempfile = dir.path(dirname, ".lock.tmp." .. tostring(math.random(100000000)))
322 if not tempfile then
323 return nil, "failed creating temp file for locking"
324 end
325 322
326 local fd, fderr = io.open(tempfile, "w") 323 local fd, fderr = io.open(tempfile, "w")
327 if not fd then 324 if not fd then