Userspace: init now sets user and group ids before running their shell
This commit is contained in:
parent
e9217b3484
commit
f67f8ccbe0
|
@ -131,6 +131,11 @@ int main()
|
|||
{
|
||||
printf("Welcome back %s!\n", user.name.data());
|
||||
|
||||
if (setgid(user.gid) == -1)
|
||||
perror("setgid");
|
||||
if (setuid(user.uid) == -1)
|
||||
perror("setuid");
|
||||
|
||||
execl(user.shell.data(), user.shell.data(), nullptr);
|
||||
perror("execl");
|
||||
|
||||
|
|
Loading…
Reference in New Issue