From 7cab86ad2899e528a52c42056f4286be8624e938 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 3 Oct 2022 09:40:37 -0400 Subject: [PATCH] Userland: Unveil /proc/all in applications which require it These were missed in 7af5eef. It is needed for any application using e.g. FileSystemAccessServer. --- Userland/Applications/3DFileViewer/main.cpp | 1 + Userland/Applications/HexEditor/main.cpp | 1 + Userland/Applications/Magnifier/main.cpp | 1 + Userland/Applications/PDFViewer/main.cpp | 1 + Userland/Applications/Spreadsheet/main.cpp | 1 + Userland/Applications/ThemeEditor/main.cpp | 1 + Userland/Demos/Eyes/main.cpp | 1 + Userland/Demos/WidgetGallery/main.cpp | 1 + Userland/Utilities/aplay.cpp | 1 + 9 files changed, 9 insertions(+) diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index b43cf9e413..c11df834d3 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -360,6 +360,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec")); + TRY(Core::System::unveil("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/home/anon/Documents/3D Models", "r")); TRY(Core::System::unveil("/res", "r")); diff --git a/Userland/Applications/HexEditor/main.cpp b/Userland/Applications/HexEditor/main.cpp index a7e4cd1796..f9edd2ea3e 100644 --- a/Userland/Applications/HexEditor/main.cpp +++ b/Userland/Applications/HexEditor/main.cpp @@ -43,6 +43,7 @@ ErrorOr serenity_main(Main::Arguments arguments) return GUI::Window::CloseRequestDecision::StayOpen; }; + TRY(Core::System::unveil("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Applications/Magnifier/main.cpp b/Userland/Applications/Magnifier/main.cpp index cffa99ddbf..e958408fc9 100644 --- a/Userland/Applications/Magnifier/main.cpp +++ b/Userland/Applications/Magnifier/main.cpp @@ -40,6 +40,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix")); auto app = TRY(GUI::Application::try_create(arguments)); + TRY(Core::System::unveil("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Applications/PDFViewer/main.cpp b/Userland/Applications/PDFViewer/main.cpp index 3e3ebaa6b2..4df36af774 100644 --- a/Userland/Applications/PDFViewer/main.cpp +++ b/Userland/Applications/PDFViewer/main.cpp @@ -34,6 +34,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); + TRY(Core::System::unveil("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp index f55ef5f6b1..d958e6da1d 100644 --- a/Userland/Applications/Spreadsheet/main.cpp +++ b/Userland/Applications/Spreadsheet/main.cpp @@ -44,6 +44,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } + TRY(Core::System::unveil("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); // For writing temporary files when exporting. TRY(Core::System::unveil("/tmp", "crw")); diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index 1c814b1109..398971baba 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -39,6 +39,7 @@ ErrorOr serenity_main(Main::Arguments arguments) path = Core::File::absolute_path(file_to_edit); TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix")); + TRY(Core::System::unveil("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Demos/Eyes/main.cpp b/Userland/Demos/Eyes/main.cpp index dccb3c6738..7b7621812c 100644 --- a/Userland/Demos/Eyes/main.cpp +++ b/Userland/Demos/Eyes/main.cpp @@ -40,6 +40,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app = TRY(GUI::Application::try_create(arguments)); + TRY(Core::System::unveil("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Demos/WidgetGallery/main.cpp b/Userland/Demos/WidgetGallery/main.cpp index b0964e1400..7bdfbd96e9 100644 --- a/Userland/Demos/WidgetGallery/main.cpp +++ b/Userland/Demos/WidgetGallery/main.cpp @@ -17,6 +17,7 @@ ErrorOr serenity_main(Main::Arguments arguments) 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("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/etc/FileIconProvider.ini", "r")); diff --git a/Userland/Utilities/aplay.cpp b/Userland/Utilities/aplay.cpp index bffe9387b7..d846fc702b 100644 --- a/Userland/Utilities/aplay.cpp +++ b/Userland/Utilities/aplay.cpp @@ -34,6 +34,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_option(show_sample_progress, "Show playback progress in samples", "sample-progress", 's'); args_parser.parse(arguments); + TRY(Core::System::unveil("/proc/all", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/audio", "rw")); TRY(Core::System::unveil(Core::File::absolute_path(path), "r"sv)); TRY(Core::System::unveil(nullptr, nullptr));