mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
GMLPlayground: Restrict filesystem access using unveil()
This commit is contained in:
parent
25104a30c1
commit
37729f5b91
Notes:
sideshowbarker
2024-07-17 05:08:18 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/37729f5b91 Pull-request: https://github.com/SerenityOS/serenity/pull/15784
1 changed files with 6 additions and 0 deletions
|
@ -67,6 +67,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::pledge("stdio thread recvfd sendfd cpath rpath wpath unix"));
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
TRY(Core::System::unveil("/proc/all", "r"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/GMLPlayground.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
|
|
Loading…
Reference in a new issue