From 9f969702ad3564f95eb20fe25950981bc7028851 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Thu, 21 Jun 2007 13:17:24 +0000 Subject: Override loadfile and dofile in the Lua user-script interpreter so they have to use datafile_path, and cannot use shell metacharacters (not that it matters) and ../ paths. Multiple loading is not prevented; we could probably add another function that does that. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1614 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/clua.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/clua.h') diff --git a/crawl-ref/source/clua.h b/crawl-ref/source/clua.h index a060923da7..419d34c908 100644 --- a/crawl-ref/source/clua.h +++ b/crawl-ref/source/clua.h @@ -73,6 +73,8 @@ public: bool runhook(const char *hook, const char *params, ...); static int file_write(lua_State *ls); + static int loadfile(lua_State *ls, const char *file); + static bool is_path_safe(const char *file); public: std::string error; @@ -106,7 +108,6 @@ private: void load_cmacro(); void load_chooks(); void init_throttle(); - void guard_pcall(); void vfnreturns(const char *par, va_list va); -- cgit v1.2.3-54-g00ecf