Linux: Fix file picker not launching from disabling core dumps

Core dumps are disabled by default on Linux, but this prevents access to the file picker due to security hardening. To work around this, core dumps are selectively enabled and disabled around the file picker tasks.
This commit is contained in:
KeatonTheBot
2026-01-12 16:14:39 -06:00
parent 1b3bf1473d
commit cfa22a7957
9 changed files with 124 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ using Ryujinx.Ava.UI.Windows;
using Ryujinx.Ava.Utilities;
using Ryujinx.Common.Helper;
using Ryujinx.Common.Logging;
using Ryujinx.Common.Utilities;
using Ryujinx.HLE.FileSystem;
using Ryujinx.HLE.HOS.Services.Account.Acc;
using Ryujinx.HLE.Loaders.Processes.Extensions;
@@ -410,6 +411,8 @@ namespace Ryujinx.Ava.Common
public static async Task ExtractAoc(IStorageProvider storageProvider, string updateFilePath, string updateName)
{
OsUtils.SetCoreDumpable(true);
Gommon.Optional<IStorageFolder> result = await storageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions
{
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle]
@@ -419,10 +422,17 @@ namespace Ryujinx.Ava.Common
return;
ExtractAoc(result.Value.Path.LocalPath, updateFilePath, updateName);
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
public static async Task ExtractSection(IStorageProvider storageProvider, NcaSectionType ncaSectionType, string titleFilePath, string titleName, int programIndex = 0)
{
OsUtils.SetCoreDumpable(true);
Gommon.Optional<IStorageFolder> result = await storageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions
{
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle]
@@ -432,6 +442,11 @@ namespace Ryujinx.Ava.Common
return;
ExtractSection(result.Value.Path.LocalPath, ncaSectionType, titleFilePath, titleName, programIndex);
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
public static (Result? result, bool canceled) CopyDirectory(FileSystemClient fs, string sourcePath, string destPath, CancellationToken token)