public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: symlinks: Allow traversing WSL symlinks
@ 2020-04-05 15:02 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-04-05 15:02 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ece49e4090564e7ac7b936692e15a78e1a3cb39c

commit ece49e4090564e7ac7b936692e15a78e1a3cb39c
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Sun Apr 5 16:17:36 2020 +0200

    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>

Diff:
---
 winsup/cygwin/path.cc | 6 ++++++
 1 file changed, 6 insertions(+)

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-05 15:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-05 15:02 [newlib-cygwin] Cygwin: symlinks: Allow traversing WSL symlinks Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).