kernel: setsid should set pgid=pid

This commit is contained in:
K. Lange 2018-10-30 15:58:15 +09:00
parent 7a935f2834
commit e8ec1cb6c3
3 changed files with 4 additions and 3 deletions

View File

@ -145,6 +145,7 @@ do_fork:
if (getpid() != pid) {
ioctl(STDIN_FILENO, IOCTLTTYLOGIN, &uid);
setuid(uid);
setsid();
toaru_auth_set_vars();
char * args[] = {
getenv("SHELL"),

View File

@ -1553,8 +1553,7 @@ int main(int argc, char ** argv) {
shell_interactive = 1;
setpgid(0,0);
my_pgid = getuid();
my_pgid = getpgid(0);
signal(SIGTTOU, SIG_IGN);
signal(SIGTTIN, SIG_IGN);

View File

@ -940,7 +940,8 @@ static int sys_setsid(void) {
return -EPERM;
}
current_process->session = current_process->group;
return current_process->group;
current_process->job = current_process->group;
return current_process->session;
}
static int sys_setpgid(pid_t pid, pid_t pgid) {