summaryrefslogtreecommitdiff
path: root/src/components/utils/include
diff options
context:
space:
mode:
authorAKalinich-Luxoft <AKalinich@luxoft.com>2017-06-15 10:24:20 +0300
committerAKalinich-Luxoft <AKalinich@luxoft.com>2017-06-20 10:53:16 +0300
commitf050b8f14ed2f3e048d7a4a0b2f1c424255649ac (patch)
tree38081a0ef91e333f638aa9a805b1b0b7e2a4ee74 /src/components/utils/include
parent817052ffe35991d6927e9176528821323b4e6812 (diff)
downloadsdl_core-f050b8f14ed2f3e048d7a4a0b2f1c424255649ac.tar.gz
Fixed RPC response in case filename contains forbidden symbols
According to requirements SDL must respond with INVALID_DATA to RPC request, which contains some filename param, which contains '/' symbol. The main idea here is to prevent access to files outside SDL working folder using such RPCs. In this commit: - Added IsFileNameValid function to check filename symbols - Added checking filename param for: DeleteFile, PutFile, SetAppIcon, SystemRequest
Diffstat (limited to 'src/components/utils/include')
-rw-r--r--src/components/utils/include/utils/file_system.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index 5862241c9c..a46135a47b 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -153,6 +153,14 @@ std::string CurrentWorkingDirectory();
std::string GetAbsolutePath(const std::string& path);
/**
+ * @brief Checks if file name contains invalid symbols e.g. '/'
+ * @param file_name file name to check
+ * @return true if file name does not contain any invalid symbol otherwise
+ * returns false
+ */
+bool IsFileNameValid(const std::string& file_name);
+
+/**
* @brief Removes file
*
* @param name path to file