summaryrefslogtreecommitdiff
path: root/src/components/utils/src/file_system.cc
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-08-08 15:11:01 -0400
committerGitHub <noreply@github.com>2017-08-08 15:11:01 -0400
commite5466470e2affa1ab4d65ddc2362f4152bb6c910 (patch)
tree799db4e7318366f933ef7d8cb3b1897256363c87 /src/components/utils/src/file_system.cc
parent17a08c54f983b8b0e5bff882dcca915fcf898750 (diff)
parentf050b8f14ed2f3e048d7a4a0b2f1c424255649ac (diff)
downloadsdl_core-e5466470e2affa1ab4d65ddc2362f4152bb6c910.tar.gz
Merge pull request #1613 from AKalinich-Luxoft/fix/fix_rpc_filename_with_slash
Fix RPC response in case filename contains forbidden symbols
Diffstat (limited to 'src/components/utils/src/file_system.cc')
-rw-r--r--src/components/utils/src/file_system.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index 947b5b090a..d31582c8e1 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -231,6 +231,10 @@ std::string file_system::GetAbsolutePath(const std::string& path) {
return std::string(abs_path);
}
+bool file_system::IsFileNameValid(const std::string& file_name) {
+ return file_name.end() == std::find(file_name.begin(), file_name.end(), '/');
+}
+
bool file_system::DeleteFile(const std::string& name) {
if (FileExists(name) && IsAccessible(name, W_OK)) {
return !remove(name.c_str());