feat: unified DataDirectory model for preset data access#17
Open
feat: unified DataDirectory model for preset data access#17
Conversation
…ad of steamIntegration
…rectory model Replace 5 separate data directory mechanisms with a unified DataDirectory model where each directory has a configurable mode (copy, overlay, acl): - Add DataDirectory Q_GADGET struct (path + mode) to PresetManager - Remove needsDataAcl, needsConfigCopy, gameDirectories from LauncherInfo - Remove sharedDirectories from LaunchPreset and InstanceConfig - Add prepareDataDir/finalizeDataDir hooks to Steam/HeroicConfigManager - Add SetupOverlayMount and CopyDirectoryToUser to D-Bus helper - Add setupOverlayMount and copyDirectoryToUser to CouchPlayHelperClient - Implement unified setupDataDirectories() in SessionRunner - Remove setupLauncherAccess() and setupSharedDirectories() - Update QML EditPresetDialog with mode selector dropdown - Update tests for new API 20 files changed, +933, -493 lines
Add isPathWithinAllowedPrefix() to reject paths outside /home/, /var/home/, /run/media/, /tmp/ and reject '..' traversal in: - computeMountTarget: reject alias/source traversal, verify target stays within userHome - MountSharedDirectories: validate source path prefix - SetupOverlayMount: validate sourceDir path prefix - SetDirectoryAcl: validate path prefix - SetPathAclWithParents: validate path prefix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sharedDirectories,needsDataAcl,needsConfigCopy,gameDirectories,setupLauncherAccess/setupSharedDirectories) with a single unifiedDataDirectorymodelcopy|overlay|acl), fully configurable per presetprepareDataDir()/finalizeDataDir()) for launcher-specific setup around generic operationsSetupOverlayMount) and directory copying (CopyDirectoryToUser) to the D-Bus helper serviceArchitecture
Test plan
cmake --build buildpasses cleanctest --test-dir build --output-on-failure— 12/14 pass (2 pre-existing: flatpak test on build host, D-Bus helper version test)test_presetmanager— 230 lines of new tests for DataDirectory model, serialization, defaultstest_sessionrunner— updated for new unified dispatcher APItest_gamescopeinstance— updated for launcherId changesBreaking changes
sharedDirectoriesconfig key replaced bydataDirectories(legacy migration reads old key as fallback, converts toaclmode)needsDataAcl,needsConfigCopy,gameDirectoriesremoved fromLauncherInfosetupLauncherAccess()andsetupSharedDirectories()removed fromSessionRunner