Cygwin: symlinks: Allow traversing WSL symlinks

Unfortunately Windows doesn't understand WSL symlinks,
despite being a really easy job.  NT functions trying
to access paths traversing WSL symlinks return the status
code STATUS_IO_REPARSE_TAG_NOT_HANDLED.  Handle this
status code same as STATUS_OBJECT_PATH_NOT_FOUND in
symlink_info::check to align behaviour to traversing
paths with other non-NTFS type symlinks.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2020-04-05 16:17:36 +02:00
parent 44fe41a766
commit ece49e4090
1 changed files with 6 additions and 0 deletions

View File

@ -3115,6 +3115,11 @@ restart:
/* One of the inner path components is invalid, or the path contains /* One of the inner path components is invalid, or the path contains
invalid characters. Bail out with ENOENT. invalid characters. Bail out with ENOENT.
STATUS_IO_REPARSE_TAG_NOT_HANDLED is returned when trying to
traversing a WSL symlink. For all practical purposes it's
equivalent to traversing SYSTEM- or LNK-type symlink returning
STATUS_OBJECT_PATH_NOT_FOUND.
Note that additional STATUS_OBJECT_PATH_INVALID and Note that additional STATUS_OBJECT_PATH_INVALID and
STATUS_OBJECT_PATH_SYNTAX_BAD status codes exist. The first one STATUS_OBJECT_PATH_SYNTAX_BAD status codes exist. The first one
is seemingly not generated by NtQueryInformationFile, the latter is seemingly not generated by NtQueryInformationFile, the latter
@ -3123,6 +3128,7 @@ restart:
error in get_nt_native_path. Both status codes are deliberately error in get_nt_native_path. Both status codes are deliberately
not tested here unless proved necessary. */ not tested here unless proved necessary. */
if (status == STATUS_OBJECT_PATH_NOT_FOUND if (status == STATUS_OBJECT_PATH_NOT_FOUND
|| status == STATUS_IO_REPARSE_TAG_NOT_HANDLED
|| status == STATUS_OBJECT_NAME_INVALID || status == STATUS_OBJECT_NAME_INVALID
|| status == STATUS_BAD_NETWORK_PATH || status == STATUS_BAD_NETWORK_PATH
|| status == STATUS_BAD_NETWORK_NAME || status == STATUS_BAD_NETWORK_NAME