summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2020-04-05 16:17:36 +0200
committerCorinna Vinschen <corinna@vinschen.de>2020-04-05 16:18:05 +0200
commitece49e4090564e7ac7b936692e15a78e1a3cb39c (patch)
treeb399413bacd15780759af5e8409b463cd6a1c67e
parent44fe41a766b1f4dbb6d2f16523aea3507d10b6ef (diff)
downloadcygnal-ece49e4090564e7ac7b936692e15a78e1a3cb39c.tar.gz
cygnal-ece49e4090564e7ac7b936692e15a78e1a3cb39c.tar.bz2
cygnal-ece49e4090564e7ac7b936692e15a78e1a3cb39c.zip
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>
-rw-r--r--winsup/cygwin/path.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index e6dc03ffa..f2b5cdbf1 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3115,6 +3115,11 @@ restart:
/* One of the inner path components is invalid, or the path contains
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
STATUS_OBJECT_PATH_SYNTAX_BAD status codes exist. The first one
is seemingly not generated by NtQueryInformationFile, the latter
@@ -3123,6 +3128,7 @@ restart:
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_IO_REPARSE_TAG_NOT_HANDLED
|| status == STATUS_OBJECT_NAME_INVALID
|| status == STATUS_BAD_NETWORK_PATH
|| status == STATUS_BAD_NETWORK_NAME