From 5549952dba88d506b8b28425f8dcb8348446905d Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Fri, 25 Sep 2020 08:30:26 -0400 Subject: [PATCH] Cygwin: recognize native Windows AF_UNIX sockets These are represented by reparse points with reparse tag IO_REPARSE_TAG_AF_UNIX. check_reparse_point_target now returns PATH_REP on files of this type, so that they are treated as known reparse points (but not as sockets). This allows tools like 'rm', 'ls', etc. to operate on these files. Also fix the comment preceding check_reparse_point_target to more accurately describe the return value. Addresses: https://cygwin.com/pipermail/cygwin/2020-September/246362.html --- winsup/cygwin/path.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 1d0c38a20..dd33e2847 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2475,8 +2475,8 @@ check_reparse_point_string (PUNICODE_STRING subst) /* Return values: <0: Negative errno. - 0: No symlink. - 1: Symlink. + 0: Not a recognized reparse point. + >0: path_flags for known reparse point. */ int check_reparse_point_target (HANDLE h, bool remote, PREPARSE_DATA_BUFFER rp, @@ -2617,6 +2617,9 @@ check_reparse_point_target (HANDLE h, bool remote, PREPARSE_DATA_BUFFER rp, } return -EIO; } + else if (rp->ReparseTag == IO_REPARSE_TAG_AF_UNIX) + /* Native Windows AF_UNIX socket; treat as ordinary file. */ + return PATH_REP; #ifdef __WITH_AF_UNIX else if (rp->ReparseTag == IO_REPARSE_TAG_CYGUNIX) { -- 2.28.0