X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57C7F384E783 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1670850608; bh=WQ1uUvGBiKlZ2wE0SLqy78MFl2oKSfu6lq5M9ljjwe4=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=nSbXH27N8x9RhUlMYtsHXFR6kMxgU5Cz4Y9Xv4scS9fEcUmKtTKeZOlioKHy/sG3b yh8QJ32b0FQAAyH2rS2Va7He3XWur+60P6aaNJ4AUPXwAlLGXpOcdNIwwzjZiLdzQO /ngR0FBbEnaBmQgfl1I8LMa1xc/nyAWYi/5Yahgs= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com Date: Mon, 12 Dec 2022 14:09:50 +0100 To: cygwin AT cygwin DOT com Subject: Re: Strange behavior when executing programs Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com, Frank Redeker References: <1031eafe-fc3b-ab5b-6e63-b0f56c038332 AT razorcat DOT com> <71aa7f85-4441-1ef5-dd9f-1c5d09c151d3 AT razorcat DOT com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <71aa7f85-4441-1ef5-dd9f-1c5d09c151d3@razorcat.com> X-Provags-ID: V03:K1:EmDN7o5iWo9wKWfco5L+JAsOCq1XGcOBVXAlXTKicP6CO5/lDhA RpzBy2/v7n+9pnFoya6MQ+1EMuTE7eWkBvm4rAMlXSh1TJsMYaWlIQgwkezPSOuHUIdHcK0 P5KN8uY02FKjDPFgdfeJP9dyPXrZ8bOT8uMEIKbZnOT2rEwB4L4EpcB08NSWm/mlLevBI3N mrJeN18pK78A/CwzOTFAg== UI-OutboundReport: notjunk:1;M01:P0:pCLjGGLcLBU=;k/s2o+j+nZdkFjU8x8Cguk4TmKD xy0Fskr48hePRajo/My4VKdT1rG/3S+3fXRCFXNzGPKlmPxAkZSqMb4h9WbrazE3LoXud8Sat 8rLRDnMzdbR/tZYzYxKF081COItRKB4ytrtlxVHR7ySPI4vSQaBxNrdnTv4Yrzh9yUZ3p7BLi H64CAaI2VXWn21cUkONfu+d99vubt+zAgctRofvU25RdYRK9jhi4We6pvzfcnMMAdFiZtnL14 D5WNCjCGDU2a/8JSWco17WnYQastP+p2npAQJv/dbiLS6h+5FdkCBW2S6VFZWUYlf127QzGnt JBzlrgc+dswXRN/P+7lqUj4Ql7dx0CorCE9fbIo9JgF8H8WxYySJuUoA7Dpsl30LSEmOAQsEb S8qAtF/LvumgeuRYkU9acXgMQa6PG4WZlRcadCU+hWGK1j8jvi/4MqZXKS4lN5TS09UDiJK5/ cF0OIxuUUHMmSO57GlPj8PF+LJjWlPHndAeu2VT4u00QScCW14Qy83UY6pfmsgg6LVT6HQDyt 4pJWu7NVvVOHk63qRkKl8S3PIQCOau6DQPd6C6kDN3CzZZkQp4HAzizVjMFBdkI40ASGTMubG NggJgfYARWRH6JzJs+oSubiWthk+xZqOFfk2L6cGRo2t+d02HMUxAXQW3hUZovEaWiIrgJmsD 7+uLMqvCfSmD5uPJ694yfg/IqZ9Gr6jdUamOUxVD3g== X-Spam-Status: No, score=-101.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen , Frank Redeker Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Dec 12 13:46, Frank Redeker via Cygwin wrote: > Am 12/12/2022 um 1:12 PM schrieb Corinna Vinschen: > > On Dec 12 11:21, Frank Redeker via Cygwin wrote: > > > $ pwd > > > /cygdrive/s/ado > > > > > > $ realpath /cygdrive/s/ado/msadox.dll > > > /cygdrive/s/ado/msadox.dll > > > > > > $ realpath msadox.dll > > > /cygdrive/c/Program Files/Common Files/System/ado/msadox.dll > > > > > > > > > Is there any way to restore the old behavior. Since with the new behavior my > > > tests no longer work. > > > > It's not easy. If we remove the new behaviour entirely, we break > > other scenarios which were broken in the old version. While it > > *seems* easy to fix your specific scenario, it will break again > > as soon as the substitution drive is used inside a native symlink. > > > > Virtual drive letters were always a problem and it doesn't get easier > > with Windows functions not allowing to specify whether one wants to > > follow symlinks or virt drives in inner path components or not. > > > > Let's consider this problem again, but I don't see a quick and easy > > solution. > > > > > > Corinna > Hello Corinna, I am willing to create my own version, tailored to my needs. Before you do that and decouple yourself from development, I'd suggest to look for a workaround in your code, or to see if we can't patch this behaviour in the upstream code. > It would be nice if you could provide me with the commit that was used to > implement the new behavior. (I guess the change is found inside the > *git://sourceware.org/git/newlib-cygwin.git* repository) Yes, but it's a group of patches trying to fix native symlink behaviour, spread over a couple of iterations. If you're looking for an easy workaround for your case, try this: diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index e7619270a269..131c7e88278f 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3492,8 +3492,10 @@ restart: { /* Check if the final path is an UNC path and the incoming path isn't. If so... */ - if (RtlEqualUnicodePathPrefix (&fpath, &ro_u_uncp, TRUE) - && !RtlEqualUnicodePathPrefix (&upath, &ro_u_uncp, TRUE)) + if (!RtlEqualUnicodePathPrefix (&upath, &ro_u_uncp, TRUE) + && (RtlEqualUnicodePathPrefix (&fpath, &ro_u_uncp, TRUE) + || towupper (upath.Buffer[4]) + != towupper (fpath.Buffer[4]))) { /* ...get the remote path, replace remote path with drive letter, check again. */ However, a generic solution would be preferrable, and a local patch to your scripts would be the better workaround for now. Corinna -- 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