ladybird/Userland/Utilities/logout.cpp

22 lines
488 B
C++
Raw Normal View History

/*
* Copyright (c) 2021, Peter Elliott <pelliott@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCore/SessionManagement.h>
2021-11-23 15:07:18 +00:00
#include <LibCore/System.h>
#include <LibMain/Main.h>
#include <signal.h>
2021-11-23 15:07:18 +00:00
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio proc rpath"));
2021-11-23 15:07:18 +00:00
TRY(Core::System::unveil("/etc/passwd", "r"));
TRY(Core::System::unveil(nullptr, nullptr));
TRY(Core::SessionManagement::logout());
return 0;
}