diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-21 13:17:24 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-21 13:17:24 +0000 |
commit | 9f969702ad3564f95eb20fe25950981bc7028851 (patch) | |
tree | dca7d6f8d55b1771fd66b3c0bd8f698ee25d7b05 /crawl-ref/source/clua.h | |
parent | 6e7c6ae56792add3f8d701eca7d144d96ed19458 (diff) | |
download | crawl-ref-9f969702ad3564f95eb20fe25950981bc7028851.tar.gz crawl-ref-9f969702ad3564f95eb20fe25950981bc7028851.zip |
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
Diffstat (limited to 'crawl-ref/source/clua.h')
-rw-r--r-- | crawl-ref/source/clua.h | 3 |
1 files changed, 2 insertions, 1 deletions
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); |