Fix difference between PGID and GID. Correctly set UID and GID of new processes. Implement set/get PGID and GID.

This commit is contained in:
Enrico Fraccaroli
2021-12-27 00:49:28 +01:00
parent 2226eebdc8
commit 7c4a4ac0ba
20 changed files with 216 additions and 92 deletions
+3
View File
@@ -183,6 +183,9 @@ int main(int argc, char **argv)
return 1;
}
setgid(pwd->pw_gid);
setuid(pwd->pw_uid);
char *_argv[] = { pwd->pw_shell, (char *)NULL };
if (execv(pwd->pw_shell, _argv) == -1) {
printf("%s: Failed to execute the shell.\n", argv[0]);