Kernel/LibC/Userspace: Implement chown and set tty owner on login

This commit is contained in:
2024-01-02 22:19:38 +02:00
parent 07d5d3f936
commit 96d831c31a
12 changed files with 62 additions and 2 deletions

View File

@@ -63,6 +63,18 @@ int main()
if (pwd == nullptr)
continue;
if (chown("/dev/tty", pwd->pw_uid, pwd->pw_gid) == -1)
{
perror("chown");
continue;
}
if (chmod("/dev/tty", 0600) == -1)
{
perror("chmod");
continue;
}
pid_t pid = fork();
if (pid == 0)
{