1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

Userland: Tighten a *lot* of pledges! :^)

Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
This commit is contained in:
Andreas Kling 2021-05-13 23:20:26 +02:00
parent 04d78adaf7
commit 31d4bcf5bf
59 changed files with 97 additions and 163 deletions

View file

@ -17,7 +17,7 @@
int main(int argc, char** argv)
{
if (pledge("stdio recvfd sendfd rpath wpath cpath accept unix fattr", nullptr) < 0) {
if (pledge("stdio recvfd sendfd rpath wpath cpath unix", nullptr) < 0) {
perror("pledge");
return 1;
}

View file

@ -30,14 +30,14 @@ int main(int argc, char* argv[])
args_parser.add_option(grid_columns, "Number of columns in grid (incompatible with --number)", "grid-cols", 'c', "number");
args_parser.parse(argc, argv);
if (pledge("stdio recvfd sendfd accept rpath unix cpath wpath fattr thread", nullptr) < 0) {
if (pledge("stdio recvfd sendfd rpath unix cpath wpath thread", nullptr) < 0) {
perror("pledge");
return 1;
}
auto app = GUI::Application::construct(argc, argv);
if (pledge("stdio recvfd sendfd accept rpath cpath wpath thread", nullptr) < 0) {
if (pledge("stdio recvfd sendfd rpath cpath wpath thread", nullptr) < 0) {
perror("pledge");
return 1;
}

View file

@ -112,7 +112,7 @@ void Screensaver::draw()
int main(int argc, char** argv)
{
if (pledge("stdio rpath wpath cpath recvfd sendfd cpath unix fattr", nullptr) < 0) {
if (pledge("stdio rpath recvfd sendfd unix", nullptr) < 0) {
perror("pledge");
return 1;
}

View file

@ -129,7 +129,7 @@ void Starfield::draw()
int main(int argc, char** argv)
{
if (pledge("stdio recvfd sendfd rpath wpath cpath accept unix fattr", nullptr) < 0) {
if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) {
perror("pledge");
return 1;
}
@ -151,6 +151,11 @@ int main(int argc, char** argv)
auto app = GUI::Application::construct(argc, argv);
if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) {
perror("pledge");
return 1;
}
auto app_icon = GUI::Icon::default_icon("app-screensaver");
auto window = GUI::Window::construct();

View file

@ -15,14 +15,14 @@
int main(int argc, char** argv)
{
if (pledge("stdio recvfd sendfd rpath accept unix fattr", nullptr) < 0) {
if (pledge("stdio recvfd sendfd rpath unix", nullptr) < 0) {
perror("pledge");
return 1;
}
auto app = GUI::Application::construct(argc, argv);
if (pledge("stdio recvfd sendfd rpath accept", nullptr) < 0) {
if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) {
perror("pledge");
return 1;
}