Set a separate session/process_group

This commit is contained in:
Robert Swiecki 2015-11-24 18:34:05 +01:00
parent da133a6d11
commit 88e796e004
2 changed files with 3 additions and 2 deletions

View File

@ -179,6 +179,7 @@ bool containPrepareEnv(struct nsjconf_t * nsjconf)
if (setpriority(PRIO_PROCESS, 0, 19) == -1 && errno != 0) {
PLOG_W("setpriority(19)");
}
setsid();
return true;
}
@ -267,7 +268,7 @@ bool containMountFS(struct nsjconf_t * nsjconf)
PLOG_E("CHROOT('/new_root')");
return false;
}
if (chdir(nsjconf->cwd) == -1) {
PLOG_E("chdir('%s')", nsjconf->cwd);
return false;

View File

@ -238,7 +238,7 @@ void subprocRunChild(struct nsjconf_t *nsjconf, int fd_in, int fd_out, int fd_er
return;
}
pid_t pid = syscall(__NR_clone, (uintptr_t)flags, NULL, NULL, NULL, (uintptr_t)0);
pid_t pid = syscall(__NR_clone, (uintptr_t) flags, NULL, NULL, NULL, (uintptr_t) 0);
if (pid == 0) {
subprocNewProc(nsjconf, fd_in, fd_out, fd_err, pipefd[1]);
}