summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-03-29 17:15:51 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-03-29 17:15:51 +0000
commitb3cbb06c9d85490321f058b5114a5c21c9385f58 (patch)
tree2d4ade3926b96541e254e602a7a9906d7e5791b7
parent3f4a0c963ab2f5bf07084175be834b03ec8bc472 (diff)
downloadcygnal-b3cbb06c9d85490321f058b5114a5c21c9385f58.tar.gz
cygnal-b3cbb06c9d85490321f058b5114a5c21c9385f58.tar.bz2
cygnal-b3cbb06c9d85490321f058b5114a5c21c9385f58.zip
* spawn.cc (find_exec): Enable finding paths in backslash notation,
especially for the exec[vl]p functions. * path.cc (symlink_info::check): Disable returning directories with suffix appended here.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/path.cc10
-rw-r--r--winsup/cygwin/spawn.cc4
3 files changed, 20 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7a4388cda..c5e314280 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2010-03-29 Corinna Vinschen <corinna@vinschen.de>
+ * spawn.cc (find_exec): Enable finding paths in backslash notation,
+ especially for the exec[vl]p functions.
+
+ * path.cc (symlink_info::check): Disable returning directories with
+ suffix appended here.
+
+2010-03-29 Corinna Vinschen <corinna@vinschen.de>
+
* include/cygwin/version.h: Bump DLL minor version number to 3.
2010-03-29 Corinna Vinschen <corinna@vinschen.de>
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index d12998071..dba96a624 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2197,6 +2197,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt,
PVOID eabuf = &nfs_aol_ffei;
ULONG easize = sizeof nfs_aol_ffei;
+ bool had_ext = !!*ext_here;
while (suffix.next ())
{
FILE_BASIC_INFORMATION fbi;
@@ -2380,6 +2381,15 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt,
}
ext_tacked_on = !!*ext_here;
+ /* Don't allow to returns directories with appended suffix. If we found
+ a directory with a suffix which has been appended here, then this
+ directory doesn't match the request. So, just do as usual if file
+ hasn't been found. */
+ if (ext_tacked_on && !had_ext && (fileattr & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ set_error (ENOENT);
+ continue;
+ }
res = -1;
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index c1033376c..c8b2fcf5a 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -1,7 +1,7 @@
/* spawn.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
This file is part of Cygwin.
@@ -111,7 +111,7 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv,
tmp_pathbuf tp;
char *tmp = tp.c_get ();
const char *posix = (opt & FE_NATIVE) ? NULL : name;
- bool has_slash = strchr (name, '/');
+ bool has_slash = !!strpbrk (name, "/\\");
int err;
/* Check to see if file can be opened as is first.