From df5f382b502fe18dd7762bd8ab830833bd22a5f6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 20 May 2021 17:30:00 +0200 Subject: [PATCH] 3DFileViewer: Remove unveil() calls and add "thread" pledge An application that allows opening arbitrary files from the filesystem needs to allow itself to access the filesystem, otherwise there's no point in supporting the feature. :^) And the "thread" pledge is needed for background thumbnail generation. --- Userland/Applications/3DFileViewer/main.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index eca71032eb..b06bb91b8c 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -124,26 +124,11 @@ int main(int argc, char** argv) { auto app = GUI::Application::construct(argc, argv); - if (pledge("stdio recvfd sendfd rpath", nullptr) < 0) { + if (pledge("stdio thread recvfd sendfd rpath", nullptr) < 0) { perror("pledge"); return 1; } - if (unveil("/res", "r") < 0) { - perror("unveil"); - return 1; - } - - if (unveil("/home", "r") < 0) { - perror("unveil"); - return 1; - } - - if (unveil(nullptr, nullptr) < 0) { - perror("unveil"); - return 1; - } - // Construct the main window auto window = GUI::Window::construct(); auto app_icon = GUI::Icon::default_icon("app-3d-file-viewer");