From dfe3e4bf15c42de3b95c49e6e9705e62ef279927 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Wed, 25 Oct 2017 00:36:58 +0200 Subject: [PATCH] scripting: Block the Z: drive from the filesel command ... fixes #248 --- source/utils/scripting.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/utils/scripting.c b/source/utils/scripting.c index 417edb0..61a599f 100644 --- a/source/utils/scripting.c +++ b/source/utils/scripting.c @@ -555,7 +555,10 @@ bool run_cmd(cmd_id id, u32 flags, char** argv, char* err_str) { char path[_VAR_CNT_LEN]; strncpy(path, argv[1], _VAR_CNT_LEN); char* npattern = strrchr(path, '/'); - if (!npattern) { + if (strncmp(path, "Z:", 2) == 0) { + ret = false; + if (err_str) snprintf(err_str, _ERR_STR_LEN, "forbidden drive"); + } else if (!npattern) { ret = false; if (err_str) snprintf(err_str, _ERR_STR_LEN, "invalid path"); } else {