summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/path.cc5
2 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 13d79a7ab..9e1f51325 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2002-06-01 Christopher Faylor <cgf@redhat.com>
+
+ * path.cc (chdir): Don't allow cd'ing to a non-directory virtual path.
+
2002-05-31 Christopher Faylor <cgf@redhat.com>
* fhandler_disk_file.cc (readdir): Move inode calculation into caller.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index d4a2f46ce..3b8a2d87a 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3311,6 +3311,11 @@ chdir (const char *in_dir)
set_errno (ENOENT);
return -1;
}
+ else if (!path.isdir ())
+ {
+ set_errno (ENOTDIR);
+ return -1;
+ }
else
{
native_dir = "c:\\";