From f1889bbcfc31b58b3fc85ba2c3a4da19fdbefac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D1=85=D0=B0=D1=80=D0=B4=20PICCORO=20Len?= =?UTF-8?q?z=20McKAY?= Date: Mon, 14 Feb 2022 16:23:58 -0400 Subject: [PATCH] mod - auth_rx : check if file exits before write * backported from https://codeberg.org/minenux/minetest-mod-auth_rx/commit/48737b82a1422a26d2a3aea052af5be26da989fb --- mods/auth_rx/filter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/auth_rx/filter.lua b/mods/auth_rx/filter.lua index 71b8d0b..e8e9137 100644 --- a/mods/auth_rx/filter.lua +++ b/mods/auth_rx/filter.lua @@ -486,10 +486,10 @@ function AuthFilter( path, name, debug ) local file = io.open( path .. "/" .. name, "r" ) if not file then file = io.open( path .. "/" .. name, "w+") - file:write("pass now") if not file then error( "The specified ruleset file does not exist." ) end + file:write("pass now") file:close( file ) file = io.open( path .. "/" .. name, "r" ) end