mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
Userland: Tighten promises by removing 'proc' where it isn't used
This is a partial revert of commit7af5eef
. After97d15e9
, the 'proc' promise is not needed for operations using getsid(). This also fixes launching several applications in which7af5eef
added the 'proc' promise only in the second call to pledge().
This commit is contained in:
parent
0455af4441
commit
25e0ab3ee4
|
@ -237,7 +237,7 @@ private:
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath wpath cpath unix thread proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath wpath cpath unix thread"));
|
||||
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
Config::pledge_domain("AudioApplet");
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
Config::pledge_domain("ClipboardHistory");
|
||||
|
|
|
@ -358,7 +358,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
{
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec proc"));
|
||||
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/home/anon/Documents/3D Models", "r"));
|
||||
|
|
|
@ -28,7 +28,7 @@ static String parse_input(StringView input)
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
TRY(Core::System::unveil("/proc/all", "r"));
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix cpath wpath thread proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix cpath wpath thread"));
|
||||
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ static ErrorOr<ByteBuffer> dump_bitmap(RefPtr<Gfx::Bitmap> bitmap, AK::StringVie
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix proc"));
|
||||
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix"));
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix inet proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix inet"));
|
||||
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->set_title("PDF Viewer");
|
||||
window->resize(640, 400);
|
||||
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix wpath cpath proc"));
|
||||
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix wpath cpath"));
|
||||
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
Config::pledge_domain("PixelPaint");
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath fattr unix cpath wpath thread proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath fattr unix cpath wpath thread"));
|
||||
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ using namespace TextEditor;
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath cpath wpath unix proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath cpath wpath unix"));
|
||||
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (!file_to_edit.is_empty())
|
||||
path = Core::File::absolute_path(file_to_edit);
|
||||
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix"));
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
|
|
@ -36,7 +36,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
args_parser.add_option(hide_window_frame, "Hide window frame", "hide-window", 'h');
|
||||
args_parser.parse(arguments);
|
||||
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix cpath wpath thread proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix cpath wpath thread"));
|
||||
|
||||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix thread proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix thread"));
|
||||
auto app = TRY(GUI::Application::try_create(arguments, Core::EventLoop::MakeInspectable::Yes));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix proc"));
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
|
||||
|
||||
srand(time(nullptr));
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/FlappyBug.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd proc"));
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
|
|
|
@ -34,7 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/GameOfLife.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd proc"));
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
|
|
|
@ -40,7 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/Hearts.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
|
|
|
@ -30,7 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/MasterWord.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd proc"));
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
|
|
|
@ -36,7 +36,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/Minesweeper.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd proc"));
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
|
|
|
@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/Snake.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd proc"));
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
|
|
|
@ -17,7 +17,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|||
{
|
||||
Core::EventLoop event_loop;
|
||||
|
||||
TRY(Core::System::pledge("stdio unix accept rpath proc"));
|
||||
TRY(Core::System::pledge("stdio unix accept rpath"));
|
||||
|
||||
auto server = TRY(IPC::MultiServer<InspectorServer::ConnectionFromClient>::try_create("/tmp/session/%sid/portal/inspector"));
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
ErrorOr<int> serenity_main(Main::Arguments)
|
||||
{
|
||||
Core::EventLoop event_loop;
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd accept unix rpath proc"));
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd accept unix rpath"));
|
||||
TRY(Core::System::unveil("/proc/all", "r"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/etc/timezone", "r"));
|
||||
|
|
|
@ -22,7 +22,7 @@ constexpr size_t LOAD_CHUNK_SIZE = 128 * KiB;
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
TRY(Core::System::pledge("stdio rpath sendfd unix thread proc"));
|
||||
TRY(Core::System::pledge("stdio rpath sendfd unix thread"));
|
||||
|
||||
StringView path {};
|
||||
bool should_loop = false;
|
||||
|
|
Loading…
Reference in a new issue