additional security

This commit is contained in:
unknown 2022-02-13 00:44:14 -05:00
parent 2060c59920
commit 3e4e65e01b
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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