From b1e6bb8daa90787f1ec31b9750a38a5eeba7c3c0 Mon Sep 17 00:00:00 2001 From: Electro707 Date: Sat, 2 Nov 2024 21:29:53 -0400 Subject: [PATCH] Added sanitization around path for mkdir and rmdir --- lib/dtutils/file.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dtutils/file.lua b/lib/dtutils/file.lua index 9a8eee90..fc2ee9ef 100644 --- a/lib/dtutils/file.lua +++ b/lib/dtutils/file.lua @@ -812,7 +812,7 @@ dtutils_file.libdoc.functions["mkdir"] = { function dtutils_file.mkdir(path) if not dtutils_file.check_if_file_exists(path) then local mkdir_cmd = dt.configuration.running_os == "windows" and "mkdir" or "mkdir -p" - return dsys.external_command(mkdir_cmd.." "..path) + return dsys.external_command(mkdir_cmd.." "..dtutils_file.sanitize_filename(path)) else return 0 end @@ -837,7 +837,7 @@ dtutils_file.libdoc.functions["rmdir"] = { function dtutils_file.rmdir(path) local rm_cmd = dt.configuration.running_os == "windows" and "rmdir /S /Q" or "rm -r" - return dsys.external_command(rm_cmd.." "..path) + return dsys.external_command(rm_cmd.." "..dtutils_file.sanitize_filename(path)) end dtutils_file.libdoc.functions["create_tmp_file"] = {