1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-08 05:01:44 +00:00

ams: fix updater misbehavior before 0.15.0 releases

This commit is contained in:
Michael Scire 2020-10-14 12:28:26 -07:00
parent 2e7214b6fa
commit 5b02c77400

View file

@ -64,6 +64,10 @@ namespace ams::mitm {
/* Emummc file protection. */
FsFile g_emummc_file;
/* Maintain exclusive access to the fusee-secondary archive. */
FsFile g_secondary_file;
FsFile g_sept_payload_file;
constexpr inline bool IsHexadecimal(const char *str) {
while (*str) {
if (std::isxdigit(static_cast<unsigned char>(*str))) {
@ -129,6 +133,15 @@ namespace ams::mitm {
R_ABORT_UNLESS(fsFileWrite(&g_bis_key_file, 0, bis_keys, sizeof(bis_keys), FsWriteOption_Flush));
/* NOTE: g_bis_key_file is intentionally not closed here. This prevents any other process from opening it. */
}
/* Open a reference to the fusee-secondary archive. */
/* As upcoming/current atmosphere releases will contain more than one zip which users much choose between, */
/* maintaining an open reference prevents cleanly the issue of "automatic" updaters selecting the incorrect */
/* zip, and encourages good updating hygiene -- atmosphere should not be updated on SD while HOS is alive. */
{
R_ABORT_UNLESS(mitm::fs::OpenSdFile(std::addressof(g_secondary_file), "/atmosphere/fusee-secondary.bin", ams::fs::OpenMode_ReadWrite));
R_ABORT_UNLESS(mitm::fs::OpenSdFile(std::addressof(g_sept_payload_file), "/sept/payload.bin", ams::fs::OpenMode_ReadWrite));
}
}
/* Initialization implementation */