summaryrefslogtreecommitdiff
path: root/Userland/dmesg.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <b.gianfo@gmail.com>2020-01-22 02:34:20 -0800
committerAndreas Kling <kling@serenityos.org>2020-01-22 11:40:22 +0100
commit319cb2845250eaead5e4f0fe033b67a51f2c0d1e (patch)
treefe0f78b9c8da88c65edfdb38351ee92255ab0bfe /Userland/dmesg.cpp
parent521c6dbbeea0b8468fa5ed0b9a6ed5d4edc25e5e (diff)
downloadserenity-319cb2845250eaead5e4f0fe033b67a51f2c0d1e.zip
dmesg: Use pledge() and unveil()
Diffstat (limited to 'Userland/dmesg.cpp')
-rw-r--r--Userland/dmesg.cpp12
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");