mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 23:42:53 +03:00
top: Use pledge() and unveil()
This commit is contained in:
parent
a7dbb3cf96
commit
16d5b1d4ca
Notes:
sideshowbarker
2024-07-19 09:14:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/16d5b1d4ca8
@ -133,6 +133,23 @@ static Snapshot get_snapshot()
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
if (pledge("stdio rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/proc/all", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/etc/passwd", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
unveil(nullptr, nullptr);
|
||||
|
||||
Vector<ThreadData*> threads;
|
||||
auto prev = get_snapshot();
|
||||
usleep(10000);
|
||||
|
Loading…
Reference in New Issue
Block a user