From d410494a7dda235db68eb80259e22613ccf5841e Mon Sep 17 00:00:00 2001 From: RipleyTom Date: Wed, 12 Jul 2017 17:04:13 +0200 Subject: [PATCH] Fixes pkg overwriting files without the PKG_FILE_ENTRY_OVERWRITE flag --- rpcs3/Crypto/unpkg.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp index 3f4d0e3849..d4eba1195e 100644 --- a/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -228,6 +228,12 @@ bool pkg_install(const fs::file& pkg_f, const std::string& dir, atomic_t const bool did_overwrite = fs::is_file(path); + if (did_overwrite && (entry.type&PKG_FILE_ENTRY_OVERWRITE) == 0) + { + LOG_NOTICE(LOADER, "Didn't overwrite %s", name); + break; + } + if (fs::file out{ path, fs::rewrite }) { for (u64 pos = 0; pos < entry.file_size; pos += BUF_SIZE)