From 0958f312e0db0bfce9eda2351aae26e8e2f18ed4 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Tue, 6 Nov 2018 14:57:52 -0600 Subject: [PATCH] Remove insecure environment It did not delete the empty folder anyway. --- README.md | 2 +- colddb.lua | 10 +--------- init.lua | 8 +------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3505df9..74f723c 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ API - **colddb.add_global_tag(db,tag)** - Add an extra folder to the directory and advance the database to the added folder. + Adds an extra folder to the directory and advance the database to the added folder. - **colddb.add_tag(db,name,tag)** diff --git a/colddb.lua b/colddb.lua index 95001af..fbf1378 100644 --- a/colddb.lua +++ b/colddb.lua @@ -1,7 +1,5 @@ colddb = {} -local ie = ... - local function createDir(directory) return minetest.mkdir(directory) end @@ -98,13 +96,7 @@ function colddb.remove_tag(db,name) local wc = delete_path:len() delete_path = delete_path:sub(0,wc-1) db.tags[name] = nil - local err,msg = os.remove(delete_path) - if err == nil and ie then - local err,msg = ie.os.remove(delete_path) - if err == nil and ie then - assert(ie, "Please add colddb to secure.trusted_mods in the settings") - end - end + os.remove(delete_path) end end diff --git a/init.lua b/init.lua index bc7e835..f9cee77 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,2 @@ modpath = minetest.get_modpath("colddb") - -local ie = minetest.request_insecure_environment() -if ie then - loadfile(modpath .. "/colddb.lua")(ie) -else - dofile(modpath .. "/colddb.lua") -end \ No newline at end of file +dofile(modpath .. "/colddb.lua")