mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 17:16:04 +00:00
whoami: Use pledge() and unveil()
This commit is contained in:
parent
0b44f9d600
commit
4f7081289c
Notes:
sideshowbarker
2024-07-19 09:14:34 +09:00
Author: https://github.com/awesomekling
Commit: 4f7081289c
1 changed files with 12 additions and 0 deletions
|
@ -29,6 +29,18 @@
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
|
if (pledge("stdio rpath", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unveil("/etc/passwd", "r") < 0) {
|
||||||
|
perror("unveil");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unveil(nullptr, nullptr);
|
||||||
|
|
||||||
puts(getlogin());
|
puts(getlogin());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue