Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-01 22:20:51 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-01 22:20:51 +0400
commit60abf1c4b875c2d7f82fd31579f351be3a619820 (patch)
treea897707c43a57a248f5f9b05729b31d5d439d999 /winsup/cygwin/path.cc
parent84c32f59067b5ea18f2a11ee2e0598503e5e1c7e (diff)
* path.cc (chdir): Don't allow cd'ing to a non-directory virtual path.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc5
1 files changed, 5 insertions, 0 deletions
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:\\";