mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
FileSystemAccessServer: Add service for accessing veiled files nicely
Adds new service FileSystemAccessServer which allows programs to request a file descriptor for any file on the file system. The user can be prompted to choose the path with a FilePicker, or the path can be provided by the application which will show a MessageBox showing the pid and name of the calling process and allows the user to approve or deny the request.
This commit is contained in:
parent
5e823d3de0
commit
41ce2debda
8 changed files with 246 additions and 0 deletions
26
Userland/Services/FileSystemAccessServer/main.cpp
Normal file
26
Userland/Services/FileSystemAccessServer/main.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2021, timmot <tiwwot@protonmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <FileSystemAccessServer/ClientConnection.h>
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/LocalServer.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibIPC/ClientConnection.h>
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
if (pledge("stdio recvfd sendfd rpath cpath wpath unix thread", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto app = GUI::Application::construct(0, nullptr);
|
||||
app->set_quit_when_last_window_deleted(false);
|
||||
|
||||
auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
|
||||
IPC::new_client_connection<FileSystemAccessServer::ClientConnection>(socket.release_nonnull(), 1);
|
||||
return app->exec();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue