From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id D7A1F388CC13; Tue, 6 Jul 2021 14:57:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7A1F388CC13 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Revert "Cygwin: Handle virtual drives as non-symlinks" X-Act-Checkin: newlib-cygwin X-Git-Author: Jeremy Drake X-Git-Refname: refs/heads/master X-Git-Oldrev: c01f603df9a30cc88f838da3226625506bfdde4f X-Git-Newrev: d0e42141b80739213be1c3c397edcce191e5b56e Message-Id: <20210706145712.D7A1F388CC13@sourceware.org> Date: Tue, 6 Jul 2021 14:57:12 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2021 14:57:13 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d0e42141b80739213be1c3c397edcce191e5b56e commit d0e42141b80739213be1c3c397edcce191e5b56e Author: Jeremy Drake Date: Sat May 29 13:17:08 2021 -0700 Revert "Cygwin: Handle virtual drives as non-symlinks" This reverts commit c8949d04001e3dbc03651475b6cd1c5623400835. Diff: --- winsup/cygwin/path.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 6a07f0d06..e62f8fe2b 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3505,9 +3505,14 @@ restart: subst X: C:\foo\bar - Treat it as a normal file. */ + Treat it like a symlink. This is required to tell an + lstat caller that the "drive" is actually pointing + somewhere else, thus, it's a symlink in POSIX speak. */ if (upath.Length == 14) /* \??\X:\ */ - goto file_not_symlink; + { + fileattr &= ~FILE_ATTRIBUTE_DIRECTORY; + path_flags |= PATH_SYMLINK; + } /* For final paths differing in inner path components return length as negative value. This informs path_conv::check to skip realpath handling on the last path component. */