summaryrefslogtreecommitdiff
path: root/Userland/utmpupdate.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-06 16:14:27 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-06 16:14:27 +0200
commit171bfcff3609ff74a33b669fc110651c6e1b95a0 (patch)
treed5ad4f9a6a4fc18b5d6107c1231ba2be4b1f1bd6 /Userland/utmpupdate.cpp
parentdcd47655d0a970daaf336a343dca1863e2389b40 (diff)
downloadserenity-171bfcff3609ff74a33b669fc110651c6e1b95a0.zip
utmpupdate: Use pledge() and unveil()
Diffstat (limited to 'Userland/utmpupdate.cpp')
-rw-r--r--Userland/utmpupdate.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/utmpupdate.cpp b/Userland/utmpupdate.cpp
index ad02768834..3fa31c8dd0 100644
--- a/Userland/utmpupdate.cpp
+++ b/Userland/utmpupdate.cpp
@@ -9,6 +9,18 @@
int main(int argc, char** argv)
{
+ if (pledge("stdio wpath cpath", nullptr) < 0) {
+ perror("pledge");
+ return 1;
+ }
+
+ if (unveil("/var/run/utmp", "rwc") < 0) {
+ perror("unveil");
+ return 1;
+ }
+
+ unveil(nullptr, nullptr);
+
pid_t pid = 0;
bool flag_create = false;
bool flag_delete = false;