* added streaming i/o for scripting, and a byteutil.get_size function * added i/o stream class, also added named pipes support on lua side via ffi * added constant file.named_pipes_prefix * added buffered and yield modes for io_stream * added new time function for work with UTC - utc_time, utc_offset, local_time * docs updated * constant pid moved to os.pid * now gmtime_s and localtime_s used only in windows
21 lines
519 B
Lua
21 lines
519 B
Lua
local forbiddenPaths = {
|
|
"/..\\", "\\../",
|
|
"/../", "\\..\\"
|
|
}
|
|
|
|
return function(path)
|
|
local corrected = true
|
|
|
|
if path:starts_with("../") or path:starts_with("..\\") then
|
|
corrected = false
|
|
else
|
|
for _, forbiddenPath in ipairs(forbiddenPaths) do
|
|
if path:find(forbiddenPath) then
|
|
corrected = false
|
|
break
|
|
end
|
|
end
|
|
end
|
|
|
|
if not corrected then error "special path \"../\" is not allowed in path to named pipe" end
|
|
end |