Base: Launch FileSystemAccessServer at session start-up

This commit is contained in:
Lucas CHOLLET 2022-07-24 15:28:42 +02:00 committed by Linus Groh
parent e9e94ef3cc
commit e8115bfdb1
Notes: sideshowbarker 2024-07-17 08:15:25 +09:00
12 changed files with 19 additions and 20 deletions

View file

@ -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

View file

@ -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

View file

@ -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"));

View file

@ -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"));

View file

@ -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));

View file

@ -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);

View file

@ -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>());

View file

@ -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));

View file

@ -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);

View file

@ -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));

View file

@ -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);

View file

@ -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);