From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m0.truegem.net (m0.truegem.net [69.55.228.47]) by sourceware.org (Postfix) with ESMTPS id CA9FE384B0C1 for ; Tue, 21 Apr 2020 07:15:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CA9FE384B0C1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maxrnd.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=mark@maxrnd.com Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id 03L7Fqff087687 for ; Tue, 21 Apr 2020 00:15:52 -0700 (PDT) (envelope-from mark@maxrnd.com) Received: from 162-235-43-67.lightspeed.irvnca.sbcglobal.net(162.235.43.67), claiming to be "[192.168.1.100]" via SMTP by m0.truegem.net, id smtpduP7gtD; Tue Apr 21 00:15:44 2020 Subject: Re: Symbolic link bug in recent Cygwin DLL build To: cygwin-developers@cygwin.com References: <20200416085807.GH3943@calimero.vinschen.de> <20200417075016.GI3943@calimero.vinschen.de> From: Mark Geisert Message-ID: <1982edcf-1e01-9e59-7895-f0f4f7c7d058@maxrnd.com> Date: Tue, 21 Apr 2020 00:15:44 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: <20200417075016.GI3943@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 07:15:57 -0000 Corinna Vinschen wrote: > On Apr 16 20:10, Mark Geisert wrote: >> Sorry about the ML flub. Your mention of cygdrive prefix gave me some >> dread. From day 1 I've suppressed the prefix on any Cygwin machine I've >> administered; I use /c or /d etc to refer to drives. That means having this >> line in /etc/fstab: >> none / cygdrive binary,posix=0,user 0 0 >> >> The "/mnt" is being added at path.cc:1892. It's replacing the current >> cygdrive prefix with "/mnt". > > Ok, that explains it. It makes this function exactly this teeny little > bit more complicated :-P > >> I'm unclear why we're in a function named >> symlink_wsl() since I'm not using WSL at all. Maybe it means >> WSL-compatible? OK if so. > > git log --grep symlinks d2e0b65a7fdc..HEAD > >> Does that string replacement need to be skipped in this situation of "empty" >> cygdrive prefix? Or is it something more subtle? > > It's a bit more subtil. The code also tries to convert the cygdrive > prefix to /mnt if no drive letter follows, so you can create a symlink > to the cygdrive directory alone: > > $ ln -s /cygdrive /tmp/cygdrive_symlink > > That also allowed the conversion cygdrive prefix to /mnt without having > to look for the drive letters. Now, with the cygdrive prefix being /, > the first path component has to be checked for being... what? > > - Just check for a single letter from a to z? That would also wrongly > catch /x if /x is a real subdir in the root dir. > > - Check for an existing drive letter from a to z? That would break > the symlink conversion on the WSL side if the symlink was supposed > to be created pointing to, say, an USB thumb drive which was not > plugged in at the time of the symlink creation. > > - Just skip any /mnt prefix if the cygdrive prefix is /? That would > make all drive letter paths incompatible with WSL, and in contrast to > /mnt symlinks, it does not autommagically "fix" drive letter paths > if you ever change your cygdrive prefix, which is a neat side-effect > of the new symlinks, IMHO. > > I'm leaning towards solution 3. That seems OK to me but I don't have much depth of experience about possible downsides. If it was instead decided that we need to require a "/path" for a cygdrive prefix in /etc/fstab I would just go back to creating symlinks like /c -> /cygdrive/c like I did long ago. You want I should submit a patch for solution 3? ..mark