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).
This commit is contained in:
Alexander Tkachev 2016-08-01 14:55:58 +06:00
parent dd9e5a95dc
commit acfa1d1f10
9 changed files with 132 additions and 19 deletions

View file

@ -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 = "");
};