diff options
author | Brian Gianforcaro <b.gianfo@gmail.com> | 2020-01-22 02:34:20 -0800 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-22 11:40:22 +0100 |
commit | 319cb2845250eaead5e4f0fe033b67a51f2c0d1e (patch) | |
tree | fe0f78b9c8da88c65edfdb38351ee92255ab0bfe /Userland/dmesg.cpp | |
parent | 521c6dbbeea0b8468fa5ed0b9a6ed5d4edc25e5e (diff) | |
download | serenity-319cb2845250eaead5e4f0fe033b67a51f2c0d1e.zip |
dmesg: Use pledge() and unveil()
Diffstat (limited to 'Userland/dmesg.cpp')
-rw-r--r-- | Userland/dmesg.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/dmesg.cpp b/Userland/dmesg.cpp index 34218c3ac7..4e7492bd5e 100644 --- a/Userland/dmesg.cpp +++ b/Userland/dmesg.cpp @@ -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"); |