Terminal: Use unveil()

This app needs ("/bin/Terminal", "x") in order to fork+exec itself when
the user requests a new Terminal window. I really like how this reduces
reduces the impact of pledging "exec". :^)

It also needs ("/res", "r") like all GUI apps. We delay the first call
to unveil until after we've already opened the app's config file, so
there's no need to worry about that.
This commit is contained in:
Andreas Kling 2020-01-21 12:12:15 +01:00
parent 21886ff9e2
commit 3097eb4717

View file

@ -290,6 +290,18 @@ int main(int argc, char** argv)
app.set_menubar(move(menubar));
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
if (unveil("/bin/Terminal", "x") < 0) {
perror("unveil");
return 1;
}
unveil(nullptr, nullptr);
config->sync();
return app.exec();
}