1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 17:37:47 +00:00

Everywhere: Use default execpromises argument for Core::System::pledge

This commit is contained in:
Brian Gianforcaro 2021-11-27 14:26:34 -08:00 committed by Andreas Kling
parent 44ffe3e5bb
commit cf4fa936be
87 changed files with 132 additions and 132 deletions

View file

@ -14,7 +14,7 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd accept", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd accept"));
Core::EventLoop event_loop;
TRY(Core::System::unveil(nullptr, nullptr));

View file

@ -12,7 +12,7 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio accept rpath wpath cpath", nullptr));
TRY(Core::System::pledge("stdio accept rpath wpath cpath"));
TRY(Core::System::unveil(Core::StandardPaths::config_directory(), "rwc"));
TRY(Core::System::unveil(nullptr, nullptr));

View file

@ -53,7 +53,7 @@ static void launch_crash_reporter(const String& coredump_path, bool unlink_on_ex
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio rpath wpath cpath proc exec", nullptr));
TRY(Core::System::pledge("stdio rpath wpath cpath proc exec"));
Core::BlockingFileWatcher watcher;
TRY(watcher.add_watch("/tmp/coredump", Core::FileWatcherEvent::Type::ChildCreated));

View file

@ -13,7 +13,7 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath cpath wpath unix thread", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd rpath cpath wpath unix thread"));
auto app = GUI::Application::construct(0, nullptr);
app->set_quit_when_last_window_deleted(false);

View file

@ -14,11 +14,11 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
Core::EventLoop event_loop;
TRY(Core::System::pledge("stdio recvfd sendfd unix", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd unix"));
TRY(Core::System::unveil(nullptr, nullptr));
auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server());
IPC::new_client_connection<ImageDecoder::ClientConnection>(move(socket), 1);
TRY(Core::System::pledge("stdio recvfd sendfd", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd"));
return event_loop.exec();
}

View file

@ -55,7 +55,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
auto app = GUI::Application::construct(arguments);
TRY(Core::System::pledge("stdio recvfd sendfd rpath exec proc id", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd rpath exec proc id"));
TRY(Core::System::unveil("/home", "r"));
TRY(Core::System::unveil("/etc/passwd", "r"));
TRY(Core::System::unveil("/etc/shadow", "r"));

View file

@ -12,11 +12,11 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio accept unix inet rpath", nullptr));
TRY(Core::System::pledge("stdio accept unix inet rpath"));
Core::EventLoop event_loop;
auto server = TRY(LookupServer::LookupServer::try_create());
TRY(Core::System::pledge("stdio accept inet rpath", nullptr));
TRY(Core::System::pledge("stdio accept inet rpath"));
TRY(Core::System::unveil("/proc/net/adapters", "r"));
TRY(Core::System::unveil("/etc/hosts", "r"));
TRY(Core::System::unveil(nullptr, nullptr));

View file

@ -13,7 +13,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd accept rpath unix", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd accept rpath unix"));
auto app = TRY(GUI::Application::try_create(arguments));
auto server = TRY(Core::LocalServer::try_create());
@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil(nullptr, nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd accept rpath", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd accept rpath"));
return app->exec();
}

View file

@ -19,7 +19,7 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio inet accept unix rpath sendfd recvfd sigaction", nullptr));
TRY(Core::System::pledge("stdio inet accept unix rpath sendfd recvfd sigaction"));
signal(SIGINFO, [](int) { RequestServer::ConnectionCache::dump_jobs(); });
@ -28,7 +28,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
Core::EventLoop event_loop;
// FIXME: Establish a connection to LookupServer and then drop "unix"?
TRY(Core::System::pledge("stdio inet accept unix sendfd recvfd", nullptr));
TRY(Core::System::pledge("stdio inet accept unix sendfd recvfd"));
TRY(Core::System::unveil("/tmp/portal/lookup", "rw"));
TRY(Core::System::unveil(nullptr, nullptr));

View file

@ -36,7 +36,7 @@ static ErrorOr<NonnullRefPtr<GUI::Menu>> build_system_menu();
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath unix sigaction", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath unix sigaction"));
auto app = TRY(GUI::Application::try_create(arguments));
Config::pledge_domains("Taskbar");
Config::monitor_domain("Taskbar");
@ -49,7 +49,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
// We need to obtain the WM connection here as well before the pledge shortening.
GUI::WindowManagerServerConnection::the();
TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath"));
auto menu = TRY(build_system_menu());
menu->realize_menu_if_needed();

View file

@ -14,7 +14,7 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
Core::EventLoop event_loop;
TRY(Core::System::pledge("stdio recvfd sendfd accept unix rpath", nullptr));
TRY(Core::System::pledge("stdio recvfd sendfd accept unix rpath"));
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil("/tmp/portal/request", "rw"));
TRY(Core::System::unveil("/tmp/portal/image", "rw"));

View file

@ -60,7 +60,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 1;
}
TRY(Core::System::pledge("stdio accept rpath inet unix", nullptr));
TRY(Core::System::pledge("stdio accept rpath inet unix"));
WebServer::Configuration configuration(real_root_path);
@ -89,6 +89,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil(real_root_path.characters(), "r"));
TRY(Core::System::unveil(nullptr, nullptr));
TRY(Core::System::pledge("stdio accept rpath", nullptr));
TRY(Core::System::pledge("stdio accept rpath"));
return loop.exec();
}

View file

@ -14,14 +14,14 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio inet unix rpath sendfd recvfd", nullptr));
TRY(Core::System::pledge("stdio inet unix rpath sendfd recvfd"));
// Ensure the certificates are read out here.
[[maybe_unused]] auto& certs = DefaultRootCACertificates::the();
Core::EventLoop event_loop;
// FIXME: Establish a connection to LookupServer and then drop "unix"?
TRY(Core::System::pledge("stdio inet unix sendfd recvfd", nullptr));
TRY(Core::System::pledge("stdio inet unix sendfd recvfd"));
TRY(Core::System::unveil("/tmp/portal/lookup", "rw"));
TRY(Core::System::unveil(nullptr, nullptr));

View file

@ -21,7 +21,7 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath unix proc sigaction", nullptr));
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath unix proc sigaction"));
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil("/tmp", "cw"));
TRY(Core::System::unveil("/etc/WindowServer.ini", "rwc"));
@ -48,7 +48,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
WindowServer::EventLoop loop;
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath proc", nullptr));
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath proc"));
// First check which screens are explicitly configured
{