From 8395eb16f69c63830836f0a40140328796832584 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 29 Oct 2022 10:18:39 +0200 Subject: [PATCH] session: endpwent on exit --- apps/src/session.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/src/session.c b/apps/src/session.c index abcc707e..58ea1afb 100644 --- a/apps/src/session.c +++ b/apps/src/session.c @@ -110,6 +110,8 @@ static int login() int main(int argc, char** argv) { + (void)argc; + if (getuid() != 0) { fprintf(stderr, @@ -121,8 +123,10 @@ int main(int argc, char** argv) for (;;) { - if (login()) return EXIT_SUCCESS; + if (login()) break; } - (void)argc; + endpwent(); + + return EXIT_SUCCESS; } \ No newline at end of file