From 06eaf679b99af0292050c4746166049c0ad01adc Mon Sep 17 00:00:00 2001 From: d0k3 Date: Wed, 22 Feb 2017 17:59:33 +0100 Subject: [PATCH] Properly check for /Nintendo 3DS/ path write permission --- source/fs/fsutil.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/fs/fsutil.c b/source/fs/fsutil.c index aa0c569..3c2ea46 100644 --- a/source/fs/fsutil.c +++ b/source/fs/fsutil.c @@ -438,8 +438,9 @@ bool PathCopyVrtToFat(char* dest, char* orig, u32* flags) { } } - // check destination write permission (SysNAND CTRNAND only) - if ((*dest == '1') && (!flags || (*flags & (OVERWRITE_CUR|OVERWRITE_ALL))) && + // check destination write permission (special paths only) + if (((*dest == '1') || (strncmp(dest, "0:/Nintendo 3DS", 16) == 0)) && + (!flags || (*flags & (OVERWRITE_CUR|OVERWRITE_ALL))) && !CheckWritePermissions(dest)) return false; // the copy process takes place here @@ -573,8 +574,9 @@ bool PathCopyWorker(char* dest, char* orig, u32* flags, bool move) { } } - // check destination write permission (SysNAND CTRNAND only) - if ((*dest == '1') && (!flags || (*flags & (OVERWRITE_CUR|OVERWRITE_ALL))) && + // check destination write permission (special paths only) + if (((*dest == '1') || (strncmp(dest, "0:/Nintendo 3DS", 16) == 0)) && + (!flags || (*flags & (OVERWRITE_CUR|OVERWRITE_ALL))) && !CheckWritePermissions(dest)) return false; // the copy process takes place here