* syscalls.cc (chroot): Disallow chroot into special directories.
Return EPERM instead.
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user