diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-17 01:33:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 01:33:33 +0200 |
commit | 440eb840ea18352488bd89e08e88d7ee34aab717 (patch) | |
tree | 60f78ad8af51d95b914fc4a288a7c888c71c1af7 /src/core/file_sys | |
parent | Merge pull request #6324 from lat9nq/appimage-freeze (diff) | |
parent | main: Prevent installing base titles into NAND (diff) | |
download | yuzu-440eb840ea18352488bd89e08e88d7ee34aab717.tar yuzu-440eb840ea18352488bd89e08e88d7ee34aab717.tar.gz yuzu-440eb840ea18352488bd89e08e88d7ee34aab717.tar.bz2 yuzu-440eb840ea18352488bd89e08e88d7ee34aab717.tar.lz yuzu-440eb840ea18352488bd89e08e88d7ee34aab717.tar.xz yuzu-440eb840ea18352488bd89e08e88d7ee34aab717.tar.zst yuzu-440eb840ea18352488bd89e08e88d7ee34aab717.zip |
Diffstat (limited to 'src/core/file_sys')
-rw-r--r-- | src/core/file_sys/registered_cache.cpp | 7 | ||||
-rw-r--r-- | src/core/file_sys/registered_cache.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 1fb66874e..b0cb65952 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -12,6 +12,7 @@ #include "common/logging/log.h" #include "core/crypto/key_manager.h" #include "core/file_sys/card_image.h" +#include "core/file_sys/common_funcs.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/nca_metadata.h" #include "core/file_sys/registered_cache.h" @@ -592,6 +593,12 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex const CNMT cnmt(cnmt_file); const auto title_id = cnmt.GetTitleID(); + const auto version = cnmt.GetTitleVersion(); + + if (title_id == GetBaseTitleID(title_id) && version == 0) { + return InstallResult::ErrorBaseInstall; + } + const auto result = RemoveExistingEntry(title_id); // Install Metadata File diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index b31630014..d042aef90 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -38,6 +38,7 @@ enum class InstallResult { ErrorAlreadyExists, ErrorCopyFailed, ErrorMetaFailed, + ErrorBaseInstall, }; struct ContentProviderEntry { |