X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD937385DC2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1647252034; bh=Y+pFc5186YUIYV5Ci2mD5bxlQgcpRD/jXGvJY+RGVCM=; h=Date:From:To:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To:From; b=B0RN2Av/yg1JiO0CeHqp9/qGp4+TJBbA3G+W6ly0kCmm1bnLDClDZDuBtY4AFjE/l QpxKIo8e4vsGuXzigTe47/jimL8kZOj/jiYGkPQppl71OWgJHeSYDz9JEPgYvm+s2r TF8durAvH1ganNSSbeCsBbmOUFZsUcrlV0id9i58= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 92966385C40C Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Date: Mon, 14 Mar 2022 10:49:22 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Too many level of symbolic links (still have problem with sbmfs network drives) Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <21ce8733-b5b9-4f04-516a-c674b3cf1162 AT polymtl DOT ca> <20220305112326 DOT 8d07e89f03eb382f58023055 AT nifty DOT ne DOT jp> <20220308001455 DOT 9da9b8e10b76e9350c22520a AT nifty DOT ne DOT jp> <03fc13d6-55c0-3fd3-87c0-857d026a1d1a AT polymtl DOT ca> <20220309085213 DOT 6e6a2cf2bf842eb51e9dd0d5 AT nifty DOT ne DOT jp> <4bf8ea5a-4afb-e3ee-e177-5dc3053340a4 AT polymtl DOT ca> <20220309095840 DOT 2a1d82b207922c9a4c8badab AT nifty DOT ne DOT jp> <20220311180930 DOT e0ca6a9bf1b9f0f5c7f9fb5e AT nifty DOT ne DOT jp> <20220312113648 DOT 9a2c2d9da7bb678978e71c9e AT nifty DOT ne DOT jp> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220312113648.9a2c2d9da7bb678978e71c9e@nifty.ne.jp> X-Provags-ID: V03:K1:HJx84hnU6uFq5CONSJ7u1RsndD7jCs8GjD5k1sVIx5t0mA9Hm+y RKzUr8KgMG6rssy1fWExSA6ajSmAe8CXUx0gjFjh7EyzsEcJXOmwI1WCjvS/SIq9psOTt8w zUbwORFUBIrMqCrUCAu8X5aw8FpI9NJ9WlGfc1Gt7+SwTCYEtcyJAmjpzvYFhcSiUjONWRy QIJcWX1fMR39O5zEp/Y9g== X-UI-Out-Filterresults: notjunk:1;V03:K0:03OIRbm2SC8=:GUTOeoeOXMwasBlLoRLk6A BiW7SrEB79RHF7f2pvwCBsf+xDLzgpDBgW/Mqb5/7261KseDh4dh7pU5R2RJ5BTxWK7Mw39CH 1M+jZTsVRcDbj2taCXkoLD5k14Sn+AcCKIK0GMuBoevYG/f6kDUbUtvJ3bSLUixJ2ZRc6f2Pb FgIQZcffBG2u08MI/jYU/blLz0NjCLvSwkYnY1Eu8+lJPXGQoI29vfFT5qWxcAWRIIkg+2Ns5 I+FT0OiHewBgwMMwOI4pObaM//lzhYm1mBGGvHd+NvsPgXbzGWqClIwOqsJSmpflw40DogeqW +aOZco5uI4FKftaAXlH5muwzjj2A4D2O5rvbgRbhUrl8hnVus2BFekfyN8NGGijapcrYcpovc uSyMFeM2KQmoWk1yz9sebMoDI+Th0J42YIfxsyRMGwzws/E+kfNliZFuYCH0AOebi3Rgbtg7C 6syLNjXsrqA4mzzvqMG6opyOpYrXfAsP5i53T54kJDnsEL7ydsaI+f4RUT6H2nPYly0vJA/nD CnN9j85j/aNvQYYpgsma4ZS63s0XJjFeYKXDTCArz11QNDi2B2zMMJoO/8oulNLbyKJTg8D0V dftaYcwXzL6V1oEV6vdjoE4WRX7DQAHoJSqTkxmTV1CGyjfc6DlI16NLUR9RZBgO7VBeyuX// ZPcIBOhT74fWuoFE6tfQgIJ03Yzz0rVgv0+Qu2U8r5zmiQJ3v47BAALqNlO5nF3CTtYkt/5px +2lsIVfveK/zMtbJ X-Spam-Status: No, score=-96.8 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_FAIL, SPF_HELO_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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com 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" Hi Takashi, On Mar 12 11:36, Takashi Yano wrote: > The problem was that GetDosDeviceW() returns unexpected string such as > "\Device\Mup\DfsClient\;Z:000000000003fb89\dfsserver\dfs\linkname" > for the mounted UNC path: > "\??\UNC\fileserver\share" > > This happens when UNC path for DFS is mounted to a drive with drive letter. > > Therefore, I would like to propose a workaround patch attached. > I will appreciate any comments for the patch. > - goto file_not_symlink; /* fallback */ > - remlen -= 2; > + goto file_not_symlink; /* fallback (not expected) */ Why do you add this "not expected:? It doesn't add any info, afaics, and just makes the patch bigger. > + remlen -= 2; /* Two L'\0' */ > > if (remote[remlen - 1] == L'\\') > remlen--; > @@ -3535,20 +3535,26 @@ restart: > UNICODE_STRING rpath; > RtlInitCountedUnicodeString (&rpath, remote, > remlen * sizeof (WCHAR)); > + int uncp_len = wcslen (ro_u_uncp.Buffer) - 1; You don't have to call wcslen, you already have the length in the UNICODE_STRING. I'd also constify this: const USHORT uncp_len = ro_u_uncp.Length / sizeof (WCHAR) - 1; Other than that, looks good to me. Thanks, 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