| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-Original-To: | cygwin AT cygwin DOT com |
| Delivered-To: | cygwin AT cygwin DOT com |
| DMARC-Filter: | OpenDMARC Filter v1.4.1 sourceware.org 474203858425 |
| Authentication-Results: | sourceware.org; |
| dmarc=none (p=none dis=none) header.from=towo.net | |
| Authentication-Results: | sourceware.org; spf=none smtp.mailfrom=towo.net |
| Message-ID: | <4ff0ff80-c024-e8b3-c6d0-b8cc789f6b08@towo.net> |
| Date: | Mon, 21 Feb 2022 01:05:32 +0100 |
| MIME-Version: | 1.0 |
| User-Agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 |
| Thunderbird/91.6.0 | |
| Subject: | Re: bash from local mounted drive with subst command |
| To: | cygwin AT cygwin DOT com |
| References: | <CACR4mKVj1SAO04iFOukMKEkD0YNUUD=x3Gh4Ypz8TQaPYx=6TA AT mail DOT gmail DOT com> |
| <20220221084152 DOT d4ffc040ec085f001f1fad0d AT nifty DOT ne DOT jp> | |
| <20220221085629 DOT db8678da50910b5255981705 AT nifty DOT ne DOT jp> | |
| From: | Thomas Wolff <towo AT towo DOT net> |
| In-Reply-To: | <20220221085629.db8678da50910b5255981705@nifty.ne.jp> |
| X-Provags-ID: | V03:K1:iTUJy/9Iu0dMI1uacAiDiHcWJ1dSndRMdipXyzJ6dd2RfxWkDme |
| sxTo7AlQcGWn+EjpdRpPfUM/6ODzMc6TuS1OuAsJ6d/9Tp5KtfC65f9YzbcCPZPoKmBl1p5 | |
| TvjR8x66pCW5zcFS8KbELdoQKXyqpc+mt4vrFFPgEla8s2Ep2SdXf6DvYUnRIGceLZab9yW | |
| ESMJpEREC2Mh1LOX+3I5w== | |
| X-UI-Out-Filterresults: | notjunk:1;V03:K0:XAmCmPYIRxw=:MbI2vZWHAJ+qU7pzQKleUk |
| 78HxalzoyNAt1T4rg0YciTskQ+5He7FFoxGBYoXzZmGjs1h+pzFNWHJ25gWE1dirGKLqocztU | |
| 796+o4Sd2KeXy8dk0apAFyE/XtGVZWIcrx0IN6mtjCfmzMqSV0czj8hjNz5Ma/cUf1SpvxPi1 | |
| pw9+lPY6q0X0//+r3BiCx3qBYS/P0jN2TisucpEeVtCUBIlwMuYCL582tRKkIiVpbOGETLpwt | |
| 6eiCokkLLNEepxUDqm1HG22CFKeV588tD8bZc0UrXejStvMmtMBrRSdWZfEYgPrOR2r73oGl0 | |
| osNBghR3o1BNZoJYI/hAgsXEPwSCduiIYK5gRV/88i410NMadg9hH7XkauhyiCWIoZ3qmWhls | |
| tsf+cRxREYYgPCuHMVjjoRnE/gBHISsAZO+E9+n/KU4IcR1EPozo1fbzI3Hu8V5ht6ytw/eDK | |
| EkjcZa08NZ2cACHBpSK6FvL2nB2Co0fuZYImWS3GfAvX3pRjratb7UaoDlKXM3xpWHQhThmhw | |
| ZyptisjUWEqAivPGAkXrcnx8uPzzzgM0f9LRcoqmR2BxxbJwx/+8tOgwnKNx8Mi99SAcpmpv6 | |
| /JA9mYPxWEm2vll9XgFk9WO2hm0gbZuA1aHtNUXHVXSwgVWJJgTQJ4L+oHRbNNwQAh6hj+PXp | |
| SD8qVco+MjDFm1V5IaTDd02a+YwDzg7dqSjm8MSahKibF0Pno7xtjBjIdy7DHxWsg/YE= | |
| X-Spam-Status: | No, score=-2.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, |
| KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, | |
| RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, | |
| T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 | |
| X-Spam-Checker-Version: | SpamAssassin 3.4.4 (2020-01-24) on |
| server2.sourceware.org | |
| X-BeenThere: | cygwin AT cygwin DOT com |
| X-Mailman-Version: | 2.1.29 |
| List-Id: | General Cygwin discussions and problem reports <cygwin.cygwin.com> |
| List-Unsubscribe: | <https://cygwin.com/mailman/options/cygwin>, |
| <mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe> | |
| List-Archive: | <https://cygwin.com/pipermail/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-request AT cygwin DOT com?subject=help> |
| List-Subscribe: | <https://cygwin.com/mailman/listinfo/cygwin>, |
| <mailto:cygwin-request AT cygwin DOT com?subject=subscribe> | |
| Errors-To: | cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com |
| Sender: | "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com> |
Am 21.02.2022 um 00:56 schrieb Takashi Yano:
> On Mon, 21 Feb 2022 08:41:52 +0900
> Takashi Yano wrote:
>> On Sun, 20 Feb 2022 22:38:53 +0100
>> Claude TETE wrote:
>>> A bash in a local mounted drive, use realpath instead of mounted one
>>> for all child processes.
>>>
>>> Example, mount a local folder on Z: drive, go in there and run any
>>> external command:
>>> $ subst Z: C:\\Users
>>> $ cd /cygdrive/z/
>>> $ /bin/pwd
>>> /cygdrive/c/Users
>>>
>>> Expected
>>> /cygdrive/w
>> This is since:
>>
>> commit 19d59ce75d5301ae167b421111d77615eb307aa7
>> Author: Corinna Vinschen <corinna AT vinschen DOT de>
>> Date: Fri May 7 16:07:03 2021 +0200
>>
>> Cygwin: path_conv: Rework handling native symlinks as inner path components
>>
>> commit 456c3a46386f was only going half-way. It handled symlinks and
>> junction points as inner path components and made realpath return the
>> correct path, but it ignored drive letter substitution, i. e., virtual
>> drives created with, e. g.
>>
>> subst X: C:\foo\bar
>>
>> It was also too simple. Just returning an error code from
>> symlink_info::check puts an unnecessary onus on the symlink evaluation
>> loop in path_conv::check.
>>
>> Rework the code to use GetFinalPathNameByHandle, and only do this after
>> checking the current file for being a symlink failed.
>>
>> If the final path returned by GetFinalPathNameByHandle is not the same
>> as the incoming path, replace the incoming path with the POSIXified
>> final path. This also short-circuits path evaluation, because
>> path_conv::check doesn't have to recurse over the inner path components
>> multiple times if all symlinks are of a native type, while still getting
>> the final path as end result.
>>
>> Virtual drives are now handled like symlinks. This is a necessary change
>> from before to make sure virtual drives are handled identically across
>> different access methods. An example is realpath(1) from coreutils. It
>> doesn't call readlink(2), but iterates over all path components using
>> lstat/readlink calls. Both methods should result in the same real path.
>>
>> Fixes: 456c3a46386f ("path_conv: Try to handle native symlinks more sanely")
>> Signed-off-by: Corinna Vinschen <corinna AT vinschen DOT de>
>>
>>
>> The behaviour is by design. Does this cause any practical issue?
> The similar happens also in Linux.
>
> In Debuan GNU/Linux 11.2:
> yano AT debian:~$ mkdir -p a/b/c
> yano AT debian:~$ ln -s a/b/c c
> yano AT debian:~$ cd c
> yano AT debian:~/c$ pwd
> /home/yano/c
> yano AT debian:~/c$ /bin/pwd
> /home/yano/a/b/c
>
> In cygwin 3.3.4:
> yano AT cygwin:~$ mkdir -p a/b/c
> yano AT cygwin:~$ ln -s a/b/c c
> yano AT cygwin:~$ cd c
> yano AT cygwin:~/c$ pwd
> /home/yano/c
> yano AT cygwin:~/c$ /bin/pwd
> /home/yano/a/b/c
pwd -P will also work like /bin/pwd - but: subst is more comparable to
mount than to ln -s
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |