login: Create a new process group to log in

This commit is contained in:
apio 2023-08-02 14:47:13 +02:00
parent aac8280e8a
commit b1fb6dee8a
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -26,11 +26,12 @@ Result<int> 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();