utmpupdate: Use pledge() and unveil()

This commit is contained in:
Andreas Kling 2020-09-06 16:14:27 +02:00
commit 171bfcff36
Notes: sideshowbarker 2024-07-19 02:53:21 +09:00

View file

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