From ea8cc330033761c3068d35cf2f82e006ebfc45d6 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 10 Feb 2020 14:09:55 -0700 Subject: [PATCH] Always allow opening directory savedata --- src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs | 3 +-- src/LibHac/FsService/FileSystemProxyCore.cs | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs b/src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs index 5e4b0974..9e9ac1c1 100644 --- a/src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs +++ b/src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs @@ -38,8 +38,7 @@ namespace LibHac.FsService.Creators switch (entryType) { case DirectoryEntryType.Directory: - // Actual FS does this check - // if (!allowDirectorySaveData) return ResultFs.InvalidSaveDataEntryType.Log(); + if (!allowDirectorySaveData) return ResultFs.InvalidSaveDataEntryType.Log(); rc = SubdirectoryFileSystem.CreateNew(out SubdirectoryFileSystem subDirFs, sourceFileSystem, saveDataPath.ToU8String()); if (rc.IsFailure()) return rc; diff --git a/src/LibHac/FsService/FileSystemProxyCore.cs b/src/LibHac/FsService/FileSystemProxyCore.cs index 5e8a2e45..3047ab78 100644 --- a/src/LibHac/FsService/FileSystemProxyCore.cs +++ b/src/LibHac/FsService/FileSystemProxyCore.cs @@ -222,9 +222,14 @@ namespace LibHac.FsService Result rc = OpenSaveDataDirectory(out IFileSystem saveDirFs, spaceId, saveDataRootPath, true); if (rc.IsFailure()) return rc; + // ReSharper disable once RedundantAssignment bool allowDirectorySaveData = AllowDirectorySaveData(spaceId, saveDataRootPath); bool useDeviceUniqueMac = Util.UseDeviceUniqueSaveMac(spaceId); + // Always allow directory savedata because we don't support transaction with file savedata yet + allowDirectorySaveData = true; + + // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (allowDirectorySaveData) { rc = saveDirFs.EnsureDirectoryExists(GetSaveDataIdPath(saveDataId)); @@ -233,6 +238,7 @@ namespace LibHac.FsService // Missing save FS cache lookup + // ReSharper disable once ConditionIsAlwaysTrueOrFalse rc = FsCreators.SaveDataFileSystemCreator.Create(out IFileSystem saveFs, out _, saveDirFs, saveDataId, allowDirectorySaveData, useDeviceUniqueMac, type, null);