diff --git a/contain.c b/contain.c index 7a90ea8..54fa2ab 100644 --- a/contain.c +++ b/contain.c @@ -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; diff --git a/subproc.c b/subproc.c index 542ae47..c84d2fe 100644 --- a/subproc.c +++ b/subproc.c @@ -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]); }