mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-17 21:32:48 +00:00
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:
parent
21886ff9e2
commit
3097eb4717
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue