aboutsummaryrefslogtreecommitdiff
path: root/backends/networking/sdl_net/handlerutils.h
diff options
context:
space:
mode:
authorAlexander Tkachev2016-08-01 14:55:58 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitacfa1d1f1069e4a4bbed8599d0e6b4e9b2ea37fe (patch)
treee9d57e3797ac334df20794c10bfec2a049e974b0 /backends/networking/sdl_net/handlerutils.h
parentdd9e5a95dc5bbae20d3da05d638139120f3113f4 (diff)
downloadscummvm-rg350-acfa1d1f1069e4a4bbed8599d0e6b4e9b2ea37fe.tar.gz
scummvm-rg350-acfa1d1f1069e4a4bbed8599d0e6b4e9b2ea37fe.tar.bz2
scummvm-rg350-acfa1d1f1069e4a4bbed8599d0e6b4e9b2ea37fe.zip
CLOUD: Handle paths in marked places
Paths containing '../' are forbidden to use in Files Manager. There is also a special inner black list of paths which are not used and a check that specified path is under "savepath" or "rootpath" (from "cloud" domain).
Diffstat (limited to 'backends/networking/sdl_net/handlerutils.h')
-rw-r--r--backends/networking/sdl_net/handlerutils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/backends/networking/sdl_net/handlerutils.h b/backends/networking/sdl_net/handlerutils.h
index c6722688e8..4c2eff49b6 100644
--- a/backends/networking/sdl_net/handlerutils.h
+++ b/backends/networking/sdl_net/handlerutils.h
@@ -35,6 +35,12 @@ public:
static Common::SeekableReadStream *getArchiveFile(Common::String name);
static Common::String readEverythingFromStream(Common::SeekableReadStream *const stream);
+ static Common::String normalizePath(const Common::String &path);
+ static bool hasForbiddenCombinations(const Common::String &path);
+ static bool isBlacklisted(const Common::String &path);
+ static bool hasPermittedPrefix(const Common::String &path);
+ static bool permittedPath(const Common::String path);
+
static void setMessageHandler(Client &client, Common::String message, Common::String redirectTo = "");
static void setFilesManagerErrorMessageHandler(Client &client, Common::String message, Common::String redirectTo = "");
};