Implement a Virtual File System #5

Closed
opened 2024-08-27 11:43:50 +02:00 by faraphel · 1 comment
Owner

Virtual File System

Our patching system require to allow a modder to access the game files alongside the assets inside their mod so that he can apply his modifications.
To prevent the modder from accessing hosts files, it would be preferable to use a virtual file system instead of a real one on which the required files will be mounted.

The path of this file system shall follow the same syntax as the standard UNIX ones, starting at the "/" root on which required directories could be mounted as "/games/" or "/assets/".
Using a path outside of a mounted directories shall either create temporary files that will be deleted once the engine is freed, or should raise an exception. Alternatively, a "/tmp/" directory could be mounted on which theses files could be accessed.

# Virtual File System Our patching system require to allow a modder to access the game files alongside the assets inside their mod so that he can apply his modifications. To prevent the modder from accessing hosts files, it would be preferable to use a virtual file system instead of a real one on which the required files will be mounted. The path of this file system shall follow the same syntax as the standard UNIX ones, starting at the "/" root on which required directories could be mounted as "/games/" or "/assets/". Using a path outside of a mounted directories shall either create temporary files that will be deleted once the engine is freed, or should raise an exception. Alternatively, a "/tmp/" directory could be mounted on which theses files could be accessed.
faraphel added the
enhancement
label 2024-08-27 11:43:50 +02:00
faraphel self-assigned this 2024-08-27 11:43:50 +02:00
faraphel added this to the Atlas-Launcher project 2024-08-27 11:43:50 +02:00
Author
Owner

tiny-vfs

tiny-vfs is a very small project aiming to implement a virtual file system. Sadly, it seem way too rudimentary to be usable for this project.

vfspp

vfspp is a small project aiming to implement this kinds of virtual file system.
Sadly, it does not implement any kind of directory exploration, only file manipulation.

cppfs

cppfs is a library specialized in the manipulation of the file system, a kind of alternative to the standard std::filesystem C++ library. Its capacities to implement a virtual file system seem a bit off our goal for this project.

FUSE

FUSE is a linux feature allowing for overwriting the filesystem calls. It is a very low level feature that require the implementation of multiple functions to replace the base comportment of the kernel.
This feature seem very complex to implement and can only seem to support a single FUSE running at the same time. For future optimisation and multitasking reason, I would prefer a virtual file system that could be instantiated as much as required at the same time.

Custom

A custom virtual file system library have instead be implemented for the Atlas launcher : it create a temporary folder on which others directories can be mounted by creating symlinks. Path can be virtual or real : a virtual path being in the virtual file system, and a real one being in the host file system. The script language will only manipulate virtual paths while the engine will resolve them into their real path to use them. It is programmed so that path outside of the virtual file system cannot be accessed, it is not possible to use syntax such as "/", "." or ".." to escape this security.

While very rudimentary, this implementation seem incredibly simple and efficient. Further security tests shall be needed to guarantee there is no way to escape the sand-boxing.

# tiny-vfs [tiny-vfs](https://github.com/anthony-y/tiny-vfs) is a very small project aiming to implement a virtual file system. Sadly, it seem way too rudimentary to be usable for this project. # vfspp [vfspp](https://github.com/nextgeniuspro/vfspp) is a small project aiming to implement this kinds of virtual file system. Sadly, it does not implement any kind of directory exploration, only file manipulation. # cppfs [cppfs](https://cppfilesystem.org/) is a library specialized in the manipulation of the file system, a kind of alternative to the standard `std::filesystem` C++ library. Its capacities to implement a virtual file system seem a bit off our goal for this project. # FUSE FUSE is a linux feature allowing for overwriting the filesystem calls. It is a very low level feature that require the implementation of multiple functions to replace the base comportment of the kernel. This feature seem very complex to implement and can only seem to support a single FUSE running at the same time. For future optimisation and multitasking reason, I would prefer a virtual file system that could be instantiated as much as required at the same time. # Custom A custom virtual file system library have instead be implemented for the Atlas launcher : it create a temporary folder on which others directories can be mounted by creating symlinks. Path can be virtual or real : a virtual path being in the virtual file system, and a real one being in the host file system. The script language will only manipulate virtual paths while the engine will resolve them into their real path to use them. It is programmed so that path outside of the virtual file system cannot be accessed, it is not possible to use syntax such as "/", "." or ".." to escape this security. While very rudimentary, this implementation seem incredibly simple and efficient. Further security tests shall be needed to guarantee there is no way to escape the sand-boxing.
faraphel added a new dependency 2024-08-27 12:00:31 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#2 Implement the Core}
Atlas/Atlas-Launcher
Reference: Atlas/Atlas-Launcher#5
No description provided.