dmesg: Use pledge() and unveil()

This commit is contained in:
Brian Gianforcaro 2020-01-22 02:34:20 -08:00 committed by Andreas Kling
parent 521c6dbbee
commit 319cb28452

View file

@ -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");