mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Base: Launch FileSystemAccessServer at session start-up
This commit is contained in:
parent
e9e94ef3cc
commit
e8115bfdb1
Notes:
sideshowbarker
2024-07-17 08:15:25 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/e8115bfdb1 Pull-request: https://github.com/SerenityOS/serenity/pull/14673 Reviewed-by: https://github.com/linusg
12 changed files with 19 additions and 20 deletions
|
@ -1,13 +1,3 @@
|
|||
[FileSystemAccessServer]
|
||||
Socket=/tmp/portal/filesystemaccess
|
||||
SocketPermissions=660
|
||||
Lazy=true
|
||||
Priority=low
|
||||
User=anon
|
||||
SystemModes=text,graphical
|
||||
MultiInstance=true
|
||||
AcceptSocketConnections=true
|
||||
|
||||
[ImageDecoder]
|
||||
Socket=/tmp/portal/image
|
||||
SocketPermissions=600
|
||||
|
|
|
@ -28,6 +28,15 @@ SystemModes=text,graphical
|
|||
MultiInstance=true
|
||||
AcceptSocketConnections=true
|
||||
|
||||
[FileSystemAccessServer]
|
||||
Socket=/tmp/user/%uid/portal/filesystemaccess
|
||||
SocketPermissions=660
|
||||
Lazy=true
|
||||
Priority=low
|
||||
SystemModes=text,graphical
|
||||
MultiInstance=true
|
||||
AcceptSocketConnections=true
|
||||
|
||||
[LaunchServer]
|
||||
Socket=/tmp/user/%uid/portal/launch
|
||||
SocketPermissions=600
|
||||
|
|
|
@ -360,7 +360,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec"));
|
||||
|
||||
TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/home/anon/Documents/3D Models", "r"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/usr/lib", "r"));
|
||||
|
|
|
@ -84,7 +84,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||
TRY(Core::System::unveil("/etc/timezone", "r"));
|
||||
TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/portal/image", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/request", "rw"));
|
||||
|
|
|
@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/usr/share/man", "r"));
|
||||
TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
|
|
@ -40,7 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
};
|
||||
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
hex_editor_widget->initialize_menubar(*window);
|
||||
|
|
|
@ -35,7 +35,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
|
||||
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto pdf_viewer_widget = TRY(window->try_set_main_widget<PDFViewerWidget>());
|
||||
|
|
|
@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/tmp/portal/clipboard", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/portal/image", "rw"));
|
||||
TRY(Core::System::unveil("/etc/FileIconProvider.ini", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
|
|
@ -34,7 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto app_icon = GUI::Icon::default_icon("app-text-editor"sv);
|
||||
|
|
|
@ -39,7 +39,7 @@ ErrorOr<int> 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("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/bin/ChessEngine", "x"));
|
||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/launch", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/filesystemaccess", "rw"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto size = Config::read_i32("Chess"sv, "Display"sv, "size"sv, 512);
|
||||
|
|
|
@ -23,7 +23,7 @@ using Result = ErrorOr<NonnullRefPtr<Core::File>>;
|
|||
class Client final
|
||||
: public IPC::ConnectionToServer<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint>
|
||||
, public FileSystemAccessClientEndpoint {
|
||||
IPC_CLIENT_CONNECTION(Client, "/tmp/portal/filesystemaccess"sv)
|
||||
IPC_CLIENT_CONNECTION(Client, "/tmp/user/%uid/portal/filesystemaccess"sv)
|
||||
|
||||
public:
|
||||
Result try_request_file_read_only_approved(GUI::Window* parent_window, String const& path);
|
||||
|
|
Loading…
Reference in a new issue