2020-01-18 08:38:21 +00:00
|
|
|
/*
|
2021-11-29 20:16:35 +00:00
|
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
2020-01-18 08:38:21 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 08:38:21 +00:00
|
|
|
*/
|
|
|
|
|
2021-11-29 20:16:35 +00:00
|
|
|
#include <LibCore/System.h>
|
|
|
|
#include <LibMain/Main.h>
|
2019-05-16 18:18:17 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2021-11-29 20:16:35 +00:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments)
|
2019-05-16 18:18:17 +00:00
|
|
|
{
|
2021-11-29 20:16:35 +00:00
|
|
|
TRY(Core::System::pledge("stdio rpath"));
|
|
|
|
TRY(Core::System::unveil("/etc/passwd", "r"));
|
|
|
|
TRY(Core::System::unveil(nullptr, nullptr));
|
2020-02-18 10:01:31 +00:00
|
|
|
|
2019-05-16 18:18:17 +00:00
|
|
|
puts(getlogin());
|
|
|
|
return 0;
|
|
|
|
}
|