mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 23:22:52 +00:00
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
39 lines
992 B
C++
39 lines
992 B
C++
/*
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "ClientConnection.h"
|
|
#include <AK/LexicalPath.h>
|
|
#include <LibCore/EventLoop.h>
|
|
#include <LibCore/File.h>
|
|
#include <LibCore/LocalServer.h>
|
|
#include <LibIPC/ClientConnection.h>
|
|
#include <sys/stat.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int, char**)
|
|
{
|
|
Core::EventLoop event_loop;
|
|
if (pledge("stdio unix rpath recvfd", nullptr) < 0) {
|
|
perror("pledge");
|
|
return 1;
|
|
}
|
|
|
|
auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
|
|
IPC::new_client_connection<LanguageServers::Shell::ClientConnection>(socket.release_nonnull(), 1);
|
|
if (pledge("stdio rpath recvfd", nullptr) < 0) {
|
|
perror("pledge");
|
|
return 1;
|
|
}
|
|
if (unveil("/etc/passwd", "r") < 0) {
|
|
perror("unveil");
|
|
return 1;
|
|
}
|
|
if (unveil("/", "b") < 0) {
|
|
perror("unveil");
|
|
return 1;
|
|
}
|
|
return event_loop.exec();
|
|
}
|