From 0647f866498412f22999966cc97b122db2ef9318 Mon Sep 17 00:00:00 2001 From: wwylele Date: Thu, 20 Oct 2016 11:45:01 +0800 Subject: FileSys: w->rw permission lift only happens in SDMC archive --- src/core/file_sys/archive_sdmc.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/file_sys/archive_sdmc.cpp') diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index c747ba82c..333dfb92e 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -19,6 +19,17 @@ namespace FileSys { ResultVal> SDMCArchive::OpenFile(const Path& path, const Mode& mode) const { + Mode modified_mode; + modified_mode.hex = mode.hex; + + // SDMC archive always opens a file with at least read permission + modified_mode.read_flag.Assign(1); + + return OpenFileBase(path, modified_mode); +} + +ResultVal> SDMCArchive::OpenFileBase(const Path& path, + const Mode& mode) const { LOG_DEBUG(Service_FS, "called path=%s mode=%01X", path.DebugStr().c_str(), mode.hex); const PathParser path_parser(path); -- cgit v1.2.3