]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: add flag to indicate reparse points unknown to WinAPI
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 2 Dec 2020 15:12:58 +0000 (16:12 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 2 Dec 2020 15:14:41 +0000 (16:14 +0100)
commitaec6479820fee5f71d50930bf0dde2bbf386bd4b
tree1e152869c24e4280f3bd92d0440a1aace56f5105
parente9bc4cccefbdc989bafb4b6c58c8892eb07ce277
Cygwin: add flag to indicate reparse points unknown to WinAPI

https://cygwin.com/pipermail/cygwin/2020-December/246938.html
reports a problem where, when adding a Cygwin default symlink
to $PATH since Cygwin 3.1.5, $PATH handling appears to be broken.

3.1.5 switched to WSL symlinks as Cygwin default symlinks.

A piece of code in path handling skips resolving reparse points
if they are the last component in the path.  Thus a reparse point
in $PATH is not resolved but converted to Windows path syntax
verbatim.

If you do this with a WSL symlink, certain WinAPI functions fail.
The underlying $PATH handling fails to recognize the reparse
point in $PATH and returns with STATUS_IO_REPARSE_TAG_NOT_HANDLED.
As a result, the calling WinAPI function fails, most prominently
so CreateProcess.

Fix this problem by adding a PATH_REP_NOAPI bit to path_types
and a matching method path_conv::is_winapi_reparse_point().

Right now this flag is set for WSL symlinks and Cygwin AF_UNIX
sockets (new type implemented as reparse points).

The aforementioned code skipping repare point path resolution calls
is_winapi_reparse_point() rather than is_known_reparse_point(),
so now path resolution is only skipped for reparse points known
to WinAPI.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/path.cc
winsup/cygwin/path.h
This page took 0.02912 seconds and 5 git commands to generate.