From 3e4e65e01b8054e68d97af18a2fa5d2b60bdb5cd Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sun, 13 Feb 2022 00:44:14 -0500 Subject: [PATCH] additional security --- computers/commands/cd/init.lua | 2 +- computers/commands/mkdir/init.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/computers/commands/cd/init.lua b/computers/commands/cd/init.lua index 4be4e85..925350f 100644 --- a/computers/commands/cd/init.lua +++ b/computers/commands/cd/init.lua @@ -1,7 +1,7 @@ function cd(pos, input, data) local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd - if input and input ~= "" and not input:find("/") then + if input and input ~= "" and not input:find("/") and not input:find("\\") then if input == ".." then local uri = data.element.pwd:split("/") uri[#uri] = nil diff --git a/computers/commands/mkdir/init.lua b/computers/commands/mkdir/init.lua index 5ecfb87..dad19f7 100644 --- a/computers/commands/mkdir/init.lua +++ b/computers/commands/mkdir/init.lua @@ -1,7 +1,7 @@ function mkdir(pos, input, data) local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd - if input and input ~= "" and not input:find("/") then + if input and input ~= "" and not input:find("/") and not input:find("\\") then minetest.mkdir(path .. "/" .. input) return "folder " .. input .. " created" else