From b1fb6dee8afb43c7917231afee65fdeeb731eca5 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 2 Aug 2023 14:47:13 +0200 Subject: [PATCH] login: Create a new process group to log in --- apps/login.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/login.cpp b/apps/login.cpp index e5d80eb4..8c6b3d61 100644 --- a/apps/login.cpp +++ b/apps/login.cpp @@ -26,11 +26,12 @@ Result luna_main(int argc, char** argv) String name; + setpgid(0, 0); + signal(SIGTTOU, SIG_IGN); + if (isatty(STDIN_FILENO)) tcsetpgrp(STDIN_FILENO, getpgid(0)); + if (username.is_empty()) { - signal(SIGTTOU, SIG_IGN); - - if (isatty(STDIN_FILENO)) tcsetpgrp(STDIN_FILENO, getpgid(0)); auto input = os::File::standard_input();