aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-01 18:20:51 +0000
committerChristopher Faylor <me@cgf.cx>2002-06-01 18:20:51 +0000
commit60abf1c4b875c2d7f82fd31579f351be3a619820 (patch)
treea897707c43a57a248f5f9b05729b31d5d439d999 /winsup/cygwin
parent84c32f59067b5ea18f2a11ee2e0598503e5e1c7e (diff)
downloadnewlib-60abf1c4b875c2d7f82fd31579f351be3a619820.zip
newlib-60abf1c4b875c2d7f82fd31579f351be3a619820.tar.gz
newlib-60abf1c4b875c2d7f82fd31579f351be3a619820.tar.bz2
* path.cc (chdir): Don't allow cd'ing to a non-directory virtual path.
Diffstat (limited to 'winsup/cygwin')
-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 13d79a7..9e1f513 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 d4a2f46..3b8a2d8 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:\\";