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