
oss-sec mailing list archives
Re: Trailing dot in Cygwin filenames [was: failed to clone iptables,ipset,nftables]
From: Jan Engelhardt <ej () inai de>
Date: Fri, 25 Apr 2025 09:46:15 +0200 (CEST)
On Friday 2025-04-25 08:22, Florian Westphal wrote:
Sunny73Cr <Sunny73Cr () protonmail com> wrote:error: invalid path 'src/json.'There is indeed a bogus file of that name, no idea why its there or why cygwin git chokes on it.
There is some prior record - https://github.com/libgit2/libgit2/issues/6968 "foo" and "foo." are equivalent in DOS, and there is a normalization phase from "foo." to "foo". This carried forward into contemporary Windows cmd.exe, explorer.exe (File Explorer), the usual file access APIs. echo abc >x echo def >y. creates "y" not "y." in cmd. But Cygwin does something unusual, it *actually* creates a file with the 2-char sequence "y.", through whatever means. Explorer *shows* it with the dot, but practially no application other than Cygwin can open it, because all normal APIs and fs lookup mechanisms are rummaging for "y" as per the earlier equivalance, and either 1. there is no file "y", so some programs can/may/will throw an error 2. or, come to think of it, there is an evil file (hi oss-security) [in cgwin] echo good >y echo evil >y. If you now try to open "y." with notepad.exe from Explorer, you always get the "good" variant. Only inside Cygwin, e.g. with cat.exe, can "y" be distinguished from "y.".
Current thread:
- Re: Trailing dot in Cygwin filenames [was: failed to clone iptables,ipset,nftables] Jan Engelhardt (Apr 25)