2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2019-11-26 19:38:24 +03:00
|
|
|
#include "LookupServer.h"
|
2020-02-06 17:04:03 +03:00
|
|
|
#include <LibCore/EventLoop.h>
|
2020-02-15 00:29:06 +03:00
|
|
|
#include <LibCore/LocalServer.h>
|
2020-01-13 03:46:03 +03:00
|
|
|
#include <stdio.h>
|
2021-03-12 19:29:37 +03:00
|
|
|
#include <unistd.h>
|
2019-06-20 22:48:33 +03:00
|
|
|
|
2020-12-21 02:09:48 +03:00
|
|
|
int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
|
2019-06-20 22:48:33 +03:00
|
|
|
{
|
2020-01-17 13:12:06 +03:00
|
|
|
if (pledge("stdio accept unix inet cpath rpath fattr", nullptr) < 0) {
|
2020-01-13 03:46:03 +03:00
|
|
|
perror("pledge");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2020-02-02 14:34:39 +03:00
|
|
|
Core::EventLoop event_loop;
|
2021-02-04 19:07:45 +03:00
|
|
|
auto server = LookupServer::LookupServer::construct();
|
2019-03-19 18:29:06 +03:00
|
|
|
|
2021-05-04 14:47:42 +03:00
|
|
|
if (pledge("stdio accept inet rpath", nullptr) < 0) {
|
2020-01-13 03:46:03 +03:00
|
|
|
perror("pledge");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2021-05-04 14:47:42 +03:00
|
|
|
unveil("/proc/net/adapters", "r");
|
2020-01-22 13:13:52 +03:00
|
|
|
unveil(nullptr, nullptr);
|
|
|
|
|
2019-11-26 19:38:24 +03:00
|
|
|
return event_loop.exec();
|
2019-03-19 18:29:06 +03:00
|
|
|
}
|