dmesg: Use pledge() and unveil()
This commit is contained in:
parent
521c6dbbee
commit
319cb28452
Notes:
sideshowbarker
2024-07-19 09:54:15 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/319cb284525 Pull-request: https://github.com/SerenityOS/serenity/pull/1108
1 changed files with 12 additions and 0 deletions
|
@ -32,6 +32,18 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/proc/dmesg", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
unveil(nullptr, nullptr);
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
auto f = CFile::construct("/proc/dmesg");
|
||||
|
|
Loading…
Add table
Reference in a new issue