diff options
Diffstat (limited to 'src/liolib.c')
-rw-r--r-- | src/liolib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/liolib.c b/src/liolib.c index feeeb8f..7824a58 100644 --- a/src/liolib.c +++ b/src/liolib.c @@ -139,7 +139,11 @@ static int io_open (lua_State *L) { /* other filenames starting with teliva_ are never ok (reserved for the * framework, should not be accessed by apps directly */ else if (starts_with(filename, "teliva_")) { - snprintf(iolib_errbuf, 1024, "app tried to open file '%s'; that's never allowed for filenames starting with 'teliva_'", filename); + snprintf(iolib_errbuf, 1024, "app tried to open file '%s'; relative paths are never allowed", filename); + Previous_message = iolib_errbuf; + } + else if (contains(filename, "./")) { + snprintf(iolib_errbuf, 1024, "app tried to open file '%s'; relative paths are never allowed", filename); Previous_message = iolib_errbuf; } else if (file_operation_permitted(filename, mode)) { |