Time of checking to time of use is already short as possible.
[verification] Build successful
Change-Id: Ifa55b413962fb88321771ac952487f6901581790
Signed-off-by: Rafal Walczyna <r.walczyna@partner.samsung.com>
result_cb(make_directory_worker(path));
}
-// pass oldPath by copy to prevent possible TOCTOU bug
-void FilesystemManager::Rename(const std::string oldPath, const std::string& newPath,
+void FilesystemManager::Rename(const std::string& oldPath, const std::string& newPath,
const std::function<void(const FilesystemStat&)>& success_cb,
const std::function<void(FilesystemError)>& error_cb) {
ScopeLogger();
const std::function<void(const FilesystemStat&)>& success_cb,
const std::function<void(FilesystemError)>& error_cb);
- void Rename(const std::string oldPath, const std::string& newPath,
+ void Rename(const std::string& oldPath, const std::string& newPath,
const std::function<void(const FilesystemStat&)>& success_cb,
const std::function<void(FilesystemError)>& error_cb);
return retval;
}
-// pass path by copy to prevent possible TOCTOU bug
-FilesystemStat FilesystemStat::getStat(const std::string path) {
+FilesystemStat FilesystemStat::getStat(const std::string& path) {
ScopeLogger();
struct stat aStatObj;
FilesystemStat _result;
picojson::value toJSON() const;
- static FilesystemStat getStat(const std::string path);
+ static FilesystemStat getStat(const std::string& path);
};
} // namespace filesystem
} // namespace extension