From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 6121D3896C3C; Wed, 19 May 2021 12:41:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6121D3896C3C 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] 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: 7b8edba6259fd8439fada6a2aaf1ecdef7b509d8 X-Git-Newrev: c8949d04001e3dbc03651475b6cd1c5623400835 Message-Id: <20210519124118.6121D3896C3C@sourceware.org> Date: Wed, 19 May 2021 12:41:18 +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: Wed, 19 May 2021 12:41:18 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c8949d04001e3dbc03651475b6cd1c5623400835 commit c8949d04001e3dbc03651475b6cd1c5623400835 Author: Jeremy Drake Date: Wed May 19 14:40:23 2021 +0200 Cygwin: Handle virtual drives as non-symlinks This avoids MAX_PATH-related problems in native tools in case the virtual drive points to a deep directory Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/path.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index dd7048486..637c32348 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3495,14 +3495,9 @@ restart: subst X: C:\foo\bar - 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. */ + Treat it as a normal file. */ if (upath.Length == 14) /* \??\X:\ */ - { - fileattr &= ~FILE_ATTRIBUTE_DIRECTORY; - path_flags |= PATH_SYMLINK; - } + goto file_not_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. */