mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
Base: Launch FileSystemAccessServer at session start-up
This commit is contained in:
parent
e9e94ef3cc
commit
e8115bfdb1
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]
|
[ImageDecoder]
|
||||||
Socket=/tmp/portal/image
|
Socket=/tmp/portal/image
|
||||||
SocketPermissions=600
|
SocketPermissions=600
|
||||||
|
|
|
@ -28,6 +28,15 @@ SystemModes=text,graphical
|
||||||
MultiInstance=true
|
MultiInstance=true
|
||||||
AcceptSocketConnections=true
|
AcceptSocketConnections=true
|
||||||
|
|
||||||
|
[FileSystemAccessServer]
|
||||||
|
Socket=/tmp/user/%uid/portal/filesystemaccess
|
||||||
|
SocketPermissions=660
|
||||||
|
Lazy=true
|
||||||
|
Priority=low
|
||||||
|
SystemModes=text,graphical
|
||||||
|
MultiInstance=true
|
||||||
|
AcceptSocketConnections=true
|
||||||
|
|
||||||
[LaunchServer]
|
[LaunchServer]
|
||||||
Socket=/tmp/user/%uid/portal/launch
|
Socket=/tmp/user/%uid/portal/launch
|
||||||
SocketPermissions=600
|
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::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("/home/anon/Documents/3D Models", "r"));
|
||||||
TRY(Core::System::unveil("/res", "r"));
|
TRY(Core::System::unveil("/res", "r"));
|
||||||
TRY(Core::System::unveil("/usr/lib", "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("/res", "r"));
|
||||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||||
TRY(Core::System::unveil("/etc/timezone", "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/portal/image", "rw"));
|
||||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
|
TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
|
||||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/request", "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("/res", "r"));
|
||||||
TRY(Core::System::unveil("/usr/share/man", "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/launch", "rw"));
|
||||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
|
TRY(Core::System::unveil("/tmp/user/%uid/portal/webcontent", "rw"));
|
||||||
TRY(Core::System::unveil(nullptr, nullptr));
|
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("/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));
|
TRY(Core::System::unveil(nullptr, nullptr));
|
||||||
|
|
||||||
hex_editor_widget->initialize_menubar(*window);
|
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::pledge("stdio recvfd sendfd rpath unix"));
|
||||||
|
|
||||||
TRY(Core::System::unveil("/res", "r"));
|
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));
|
TRY(Core::System::unveil(nullptr, nullptr));
|
||||||
|
|
||||||
auto pdf_viewer_widget = TRY(window->try_set_main_widget<PDFViewerWidget>());
|
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("/res", "r"));
|
||||||
TRY(Core::System::unveil("/tmp/portal/clipboard", "rw"));
|
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("/tmp/portal/image", "rw"));
|
||||||
TRY(Core::System::unveil("/etc/FileIconProvider.ini", "r"));
|
TRY(Core::System::unveil("/etc/FileIconProvider.ini", "r"));
|
||||||
TRY(Core::System::unveil(nullptr, nullptr));
|
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("/res", "r"));
|
||||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/launch", "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("/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));
|
TRY(Core::System::unveil(nullptr, nullptr));
|
||||||
|
|
||||||
auto app_icon = GUI::Icon::default_icon("app-text-editor"sv);
|
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);
|
path = Core::File::absolute_path(file_to_edit);
|
||||||
|
|
||||||
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix"));
|
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("/res", "r"));
|
||||||
TRY(Core::System::unveil(nullptr, nullptr));
|
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("/bin/ChessEngine", "x"));
|
||||||
TRY(Core::System::unveil("/etc/passwd", "r"));
|
TRY(Core::System::unveil("/etc/passwd", "r"));
|
||||||
TRY(Core::System::unveil("/tmp/user/%uid/portal/launch", "rw"));
|
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));
|
TRY(Core::System::unveil(nullptr, nullptr));
|
||||||
|
|
||||||
auto size = Config::read_i32("Chess"sv, "Display"sv, "size"sv, 512);
|
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
|
class Client final
|
||||||
: public IPC::ConnectionToServer<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint>
|
: public IPC::ConnectionToServer<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint>
|
||||||
, public FileSystemAccessClientEndpoint {
|
, public FileSystemAccessClientEndpoint {
|
||||||
IPC_CLIENT_CONNECTION(Client, "/tmp/portal/filesystemaccess"sv)
|
IPC_CLIENT_CONNECTION(Client, "/tmp/user/%uid/portal/filesystemaccess"sv)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Result try_request_file_read_only_approved(GUI::Window* parent_window, String const& path);
|
Result try_request_file_read_only_approved(GUI::Window* parent_window, String const& path);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue