* 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:
Corinna Vinschen
2000-07-19 20:14:24 +00:00
parent 7a2fc2a415
commit a67f4165ae
7 changed files with 148 additions and 16 deletions

View File

@ -437,6 +437,8 @@ fork ()
child->orig_gid = myself->orig_gid;
child->real_uid = myself->real_uid;
child->real_gid = myself->real_gid;
memcpy (child->root, myself->root, MAX_PATH+1);
child->rootlen = myself->rootlen;
set_child_mmap_ptr (child);
/* Wait for subproc to initialize itself. */