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
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-09-18 15:05:44 +0400
committerCorinna Vinschen <corinna@vinschen.de>2007-09-18 15:05:44 +0400
commit6c8c58e7f4296f9a5f99d9aa1c1ecbb6999b5b29 (patch)
tree8cee27128ebf426fd8ac9557bc3d7edc9c79102c /winsup
parent668b4a951964031208a700ef7bc017f608ef16db (diff)
* path.cc (symlink_info::check): Check for STATUS_OBJECT_NAME_INVALID.
Add comment.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/path.cc14
2 files changed, 17 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 0d533c222..5e28004bb 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2007-09-17 Corinna Vinschen <corinna@vinschen.de>
+ * path.cc (symlink_info::check): Check for STATUS_OBJECT_NAME_INVALID.
+ Add comment.
+
+2007-09-17 Corinna Vinschen <corinna@vinschen.de>
+
* fhandler.cc (fhandler_base::open): Partly revert change from
2007-08-24: Call has_acls to avoid permission problems getting
a handle to a file on a remote share. Add comment.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 9934fa4fe..88add9a10 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3535,8 +3535,18 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
debug_printf ("%p = NtQueryAttributesFile (%S)", status, &upath);
fileattr = INVALID_FILE_ATTRIBUTES;
- /* One of the inner path components is invalid. Bail out. */
- if (status == STATUS_OBJECT_PATH_NOT_FOUND)
+ /* One of the inner path components is invalid, or the path contains
+ invalid characters. Bail out with ENOENT.
+
+ Note that additional STATUS_OBJECT_PATH_INVALID and
+ STATUS_OBJECT_PATH_SYNTAX_BAD status codes exist. The first one
+ is seemingly not generated by NtQueryAttributesFile, the latter
+ is only generated if the path is no absolute path within the
+ NT name space, which should not happen and would point to an
+ error in get_nt_native_path. Both status codes are deliberately
+ not tested here unless proved necessary. */
+ if (status == STATUS_OBJECT_PATH_NOT_FOUND
+ || status == STATUS_OBJECT_NAME_INVALID)
{
set_error (ENOENT);
break;