From 60e2479b16fe8ae688fabce7d2aac2355affe311 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Mon, 17 Apr 2017 23:28:40 +0200 Subject: [PATCH] Handle write permissions when build titlekey / seed db --- source/game/gameutil.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/game/gameutil.c b/source/game/gameutil.c index 7889ec5..6675f0d 100644 --- a/source/game/gameutil.c +++ b/source/game/gameutil.c @@ -1669,6 +1669,10 @@ u32 BuildTitleKeyInfo(const char* path, bool dec, bool dump) { const char* path_in = path; UINT br; + // write permissions + if (!CheckWritePermissions(path_out)) + return 1; + if (!path_in && !dump) { // no input path given - initialize memset(tik_info, 0, 16); if ((fvx_stat(path_out, NULL) == FR_OK) && @@ -1737,6 +1741,10 @@ u32 BuildSeedInfo(const char* path, bool dump) { u32 inputtype = 0; // 0 -> none, 1 -> seeddb.bin, 2 -> seed system save UINT br; + // write permissions + if (!CheckWritePermissions(path_out)) + return 1; + if (!path_in && !dump) { // no input path given - initialize memset(seed_info, 0, 16); if ((fvx_stat(path_out, NULL) == FR_OK) &&