* syscalls.cc (chroot): Disallow chroot into special directories.

Return EPERM instead.
This commit is contained in:
Corinna Vinschen
2006-03-02 18:08:09 +00:00
parent cb1975812d
commit 7b8b467def
2 changed files with 7 additions and 0 deletions

View File

@@ -2359,6 +2359,8 @@ chroot (const char *newroot)
set_errno (ENOENT);
else if (!path.isdir ())
set_errno (ENOTDIR);
else if (path.isspecial ())
set_errno (EPERM);
else
{
getwinenv("PATH="); /* Save the native PATH */