1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:58:12 +00:00

LibDesktop: Make allowlist APIs return ErrorOr<void>

This makes it very smooth to use TRY() when setting up these lists,
as you can see in the rest of this commit. :^)
This commit is contained in:
Andreas Kling 2021-11-24 00:23:00 +01:00
parent 4a64bb80ea
commit b6f49924be
8 changed files with 34 additions and 76 deletions

View file

@ -24,13 +24,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app = TRY(GUI::Application::try_create(arguments));
if (!Desktop::Launcher::add_allowed_handler_with_only_specific_urls(
"/bin/Help",
{ URL::create_with_file_protocol("/usr/share/man/man1/FontEditor.md") })
|| !Desktop::Launcher::seal_allowlist()) {
warnln("Failed to set up allowed launch URLs");
return 1;
}
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man1/FontEditor.md") }));
TRY(Desktop::Launcher::seal_allowlist());
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath cpath wpath", nullptr));