aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaverick2797 <git.maverick2797@gmail.com>2022-11-25 18:38:10 +0800
committerorwell96 <orwell@bleipb.de>2023-03-17 19:57:43 +0100
commit82987b1a4f74074088a414d90898ad19ec8c4b20 (patch)
treeda98eb71facc4b58bc26fcbd174785eef7274144
parentcad4809b9917d4abbd1ed1dc3ddbc8cbd67b2d50 (diff)
downloadadvtrains-82987b1a4f74074088a414d90898ad19ec8c4b20.tar.gz
advtrains-82987b1a4f74074088a414d90898ad19ec8c4b20.tar.bz2
advtrains-82987b1a4f74074088a414d90898ad19ec8c4b20.zip
small security fixes in advtrains_luaautomation/
- fixed file permissions of advtrains_luaautomation/README.md (755->644) - fixed file permissions of advtrains_luaautomation/environment.lua (755->644) - prevented LuaATC section_occupancy() from having direct access to the interlocking section id occupancy table - simplify section_occupancy() logic
-rw-r--r--[-rwxr-xr-x]advtrains_luaautomation/README.md0
-rw-r--r--[-rwxr-xr-x]advtrains_luaautomation/environment.lua7
2 files changed, 2 insertions, 5 deletions
diff --git a/advtrains_luaautomation/README.md b/advtrains_luaautomation/README.md
index 67a4b80..67a4b80 100755..100644
--- a/advtrains_luaautomation/README.md
+++ b/advtrains_luaautomation/README.md
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua
index 6b1a283..d85bedc 100755..100644
--- a/advtrains_luaautomation/environment.lua
+++ b/advtrains_luaautomation/environment.lua
@@ -229,11 +229,8 @@ if advtrains.interlocking then
if not ts_id then return nil end
ts_id = tostring(ts_id)
local response = advtrains.interlocking.db.get_ts(ts_id)
- if response == nil then
- return false
- else
- return response.trains
- end
+ if not response then return false end
+ return table.copy(response.trains)
end
end