Skip to content

Commit b1e6bb8

Browse files
committed
Added sanitization around path for mkdir and rmdir
1 parent 26e797d commit b1e6bb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/dtutils/file.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ dtutils_file.libdoc.functions["mkdir"] = {
812812
function dtutils_file.mkdir(path)
813813
if not dtutils_file.check_if_file_exists(path) then
814814
local mkdir_cmd = dt.configuration.running_os == "windows" and "mkdir" or "mkdir -p"
815-
return dsys.external_command(mkdir_cmd.." "..path)
815+
return dsys.external_command(mkdir_cmd.." "..dtutils_file.sanitize_filename(path))
816816
else
817817
return 0
818818
end
@@ -837,7 +837,7 @@ dtutils_file.libdoc.functions["rmdir"] = {
837837

838838
function dtutils_file.rmdir(path)
839839
local rm_cmd = dt.configuration.running_os == "windows" and "rmdir /S /Q" or "rm -r"
840-
return dsys.external_command(rm_cmd.." "..path)
840+
return dsys.external_command(rm_cmd.." "..dtutils_file.sanitize_filename(path))
841841
end
842842

843843
dtutils_file.libdoc.functions["create_tmp_file"] = {

0 commit comments

Comments
 (0)