diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-12-16 08:13:00 -0500 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-12-21 13:09:49 -0800 |
commit | 10a8b6d4116c6a627a6c189154af032f69b29c21 (patch) | |
tree | cbc7b2ef4f83550c2155111176a2b62d08e1ab96 /Userland/Applications/Spreadsheet/main.cpp | |
parent | 35e5cbe3b3248877c49d046a7f0333f365fb7cd8 (diff) | |
download | serenity-10a8b6d4116c6a627a6c189154af032f69b29c21.zip |
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.
Diffstat (limited to 'Userland/Applications/Spreadsheet/main.cpp')
-rw-r--r-- | Userland/Applications/Spreadsheet/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp index 0ed5a66f22..cc2a54c694 100644 --- a/Userland/Applications/Spreadsheet/main.cpp +++ b/Userland/Applications/Spreadsheet/main.cpp @@ -22,7 +22,7 @@ int main(int argc, char* argv[]) { - if (pledge("stdio recvfd sendfd rpath fattr unix cpath wpath thread", nullptr) < 0) { + if (pledge("stdio recvfd sendfd rpath fattr unix cpath wpath thread prot_exec", nullptr) < 0) { perror("pledge"); return 1; } @@ -69,6 +69,11 @@ int main(int argc, char* argv[]) return 1; } + if (unveil("/usr/lib/libunicodedata.so.serenity", "r") < 0) { + perror("unveil"); + return 1; + } + if (unveil(nullptr, nullptr) < 0) { perror("unveil"); return 1; |