flathub / flathub/org.libretro.RetroArch
[IMPORTANT] Global write access enabled for user
- Dominant language
- No language data
- Stars
- 20
- Forks
- 19
- Avg merge
- 49m
- Merged PRs (30d)
- 1
Description
Retroarch has global write permission. This is not typical, for example:
`PCSX2` flatpak configurations to use directories outside ~/.var/app/net.pcsx2.PCSX2/:
- Read/write permission is required to create the memory card outside: `flatpak override net.pcsx2.PCSX2 --user --filesystem=$HOME/mygamesaves/PCSX2/memcards:create`
- Write permission is required for the BIOS directory: `flatpak override net.pcsx2.PCSX2 --user --filesystem="$HOME/mystorage/PS2BIOS/:rw"`
- Read permission is required for the game list: `flatpak override net.pcsx2.PCSX2 --user --filesystem="$HOME/Downloads/PS2games/"`
## Steps to reproduce
1. **Save game directory**
- Create this directory: `~/gamesaves/`
- Change the save files directory: Navigate to **Settings** -> **Directory**, and modify `Save Files` to `/home/yourusername/gamesaves/`
2. **Install a core**: Navigate to **Main Menu** -> **Online updater** -> **Core Downloader**, and download `Sony - PlayStation 2 (LRPS2)`
3. **Load the core**: `Main Menu` -> `Load Core` -> `Sony - PlayStation 2 (LRPS2)`
4. Outside RetroArch, observe that this file will be written: `~/gamesaves/LRPS2 (alpha)/Slot 1/Shared Memory Card (8 MB).ps2` and the memory card can be formatted in the core, and games will be saved to it.
# Proposed solution
* Disable global write permission for RetroArch.
## Document how to enable write permission for a custom save directory
* Document
- To set a custom save directory: `flatpak override org.libretro.RetroArch --user --filesystem=$HOME/path/to/custom/retroarch/saves/:create`
- To set a custom BIOS directory: `flatpak override org.libretro.RetroArch --user --filesystem="$HOME/mystorage/retroarch/system/:rw"`
- To set a custom Download directory: `flatpak override org.libretro.RetroArch --user --filesystem="$HOME/Downloads/"`
Note: The override command applied to the save directory will grant write permission to all sub-directories (including all core directories), making it simple to implement.
Example of other packages that have documented this:
* [Cemu](https://github.com/flathub/info.cemu.Cemu) (Wii U emulator): `flatpak override --user --filesystem=host info.cemu.Cemu`
* [PCSX2](https://github.com/flathub/net.pcsx2.PCSX2): `flatpak override --user net.pcsx2.PCSX2 --filesystem=/path/to/my/PS2_BIOS`
* [Xemu](https://xemu.app/docs/troubleshooting/) (xbox emulator): `flatpak override app.xemu.xemu --user --filesystem="$HOME/savedgames/xemu/`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.