From 6c8c58e7f4296f9a5f99d9aa1c1ecbb6999b5b29 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 18 Sep 2007 11:05:44 +0000 Subject: * path.cc (symlink_info::check): Check for STATUS_OBJECT_NAME_INVALID. Add comment. --- winsup/cygwin/path.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/path.cc') 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; -- cgit v1.2.3