1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

Userland: Add unveil/pledge requisites for dynamic Unicode data loading

Loading libunicodedata.so will require dlopen(), which in turn requires
mmap(). The 'prot_exec' pledge is needed for this.

Further, the .so itself must be unveiled for reading. The "real" path is
unveiled (libunicodedata.so.serenity) as the symlink (libunicodedata.so)
itself cannot be unveiled.
This commit is contained in:
Timothy Flynn 2021-12-16 08:13:00 -05:00 committed by Brian Gianforcaro
parent 35e5cbe3b3
commit 10a8b6d411
7 changed files with 16 additions and 8 deletions

View file

@ -20,14 +20,14 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix cpath wpath"));
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix cpath wpath prot_exec"));
auto app = TRY(GUI::Application::try_create(arguments));
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"));
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath cpath wpath prot_exec"));
char const* path = nullptr;
Core::ArgsParser args_parser;