From: Corinna Vinschen Date: Thu, 2 Mar 2006 18:08:09 +0000 (+0000) Subject: * syscalls.cc (chroot): Disallow chroot into special directories. X-Git-Tag: newlib-csl-20060320-branchpoint~57 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=7b8b467defe138fefee0fd468c89d006ceab2c7f;p=newlib-cygwin.git * syscalls.cc (chroot): Disallow chroot into special directories. Return EPERM instead. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8c2e24ded..1c2506d78 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2006-03-02 Corinna Vinschen + + * syscalls.cc (chroot): Disallow chroot into special directories. + Return EPERM instead. + 2006-03-02 Corinna Vinschen * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 66c5e38c4..33eef64d3 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -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 */