* shared.h (class pinfo): New members root' and
rootlen'.
* syscalls.cc (chroot): Set new root for process. * path.cc (getcwd_inner): Add parameter to force use of new root from chroot() call. (ischrootpath): New macro. (normalize_posix_path): Care for changed root dir. (normalize_win32_path): Ditto. (getcwd_inner): Ditto. (chdir): Eliminate trailing path component consisting entirely of dots. * fork.cc (fork): Copy pinfo members regarding chroot(). * spawn.cc (_spawnve): Ditto. * dir.cc (opendir): Don't use computed win32 path if chroot() took place.
This commit is contained in:
@@ -852,6 +852,8 @@ _spawnve (HANDLE hToken, int mode, const char *path, const char *const *argv,
|
||||
child->psid = child->sidbuf;
|
||||
memcpy (child->logsrv, myself->logsrv, MAX_HOST_NAME);
|
||||
memcpy (child->domain, myself->domain, MAX_COMPUTERNAME_LENGTH+1);
|
||||
memcpy (child->root, myself->root, MAX_PATH+1);
|
||||
child->rootlen = myself->rootlen;
|
||||
subproc_init ();
|
||||
ret = spawn_guts (hToken, path, argv, envp, child, mode);
|
||||
if (ret == -1)
|
||||
|
Reference in New Issue
Block a user