OSDN Git Service

* syscalls.cc (chroot): Disallow chroot into special directories.
authorcorinna <corinna>
Thu, 2 Mar 2006 18:08:08 +0000 (18:08 +0000)
committercorinna <corinna>
Thu, 2 Mar 2006 18:08:08 +0000 (18:08 +0000)
Return EPERM instead.

winsup/cygwin/ChangeLog
winsup/cygwin/syscalls.cc

index 8c2e24d..1c2506d 100644 (file)
@@ -1,5 +1,10 @@
 2006-03-02  Corinna Vinschen  <corinna@vinschen.de>
 
+       * syscalls.cc (chroot): Disallow chroot into special directories.
+       Return EPERM instead.
+
+2006-03-02  Corinna Vinschen  <corinna@vinschen.de>
+
        * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
        cygdrive string length for those who have cygdrive mapped to "/".
 
index 66c5e38..33eef64 100644 (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 */