All of lore.kernel.org
 help / color / mirror / Atom feed
* Fail to clone iptables,ipset,nftables
@ 2025-04-25  5:30 Sunny73Cr
  2025-04-25  6:22 ` Florian Westphal
  0 siblings, 1 reply; 5+ messages in thread
From: Sunny73Cr @ 2025-04-25  5:30 UTC (permalink / raw)
  To: netfilter-devel@vger.kernel.org

Hi,

I have run the following command in 'Git Bash' under MINGW64 Windows 11:
`git clone git://git.netfilter.org/nftables 'C:/local/path'`

Output is:
Cloning into 'C:/local/path'...
remote: Enumerating objects: 32813, done.
remote: Counting objects: 100% (32813/32813), done.
remote: Compressing objects: 100% (8468/8468), done.
remote: Total 32813 (delta 26246), reused 30199 (delta 24215), pack-reused 0
Receiving objects: 100% (32813/32813), 5.34 MiB | 2.08 MiB/s, done.
Resolving deltas: 100% (26246/26246), done.
error: invalid path 'src/json.'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

I then tried:
`cd 'C:/local/path'`
`git restore --source=HEAD :/`

Output is:
error: invalid path 'src/json.'

I can see '/src/json.' in https://git.netfilter.org/nftables/tree/src?h=master

Is there a way to force this clone in this Windows/MINGW64/Git Bash environment; or should I retry on a *NIX system?

sunny

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fail to clone iptables,ipset,nftables
  2025-04-25  5:30 Fail to clone iptables,ipset,nftables Sunny73Cr
@ 2025-04-25  6:22 ` Florian Westphal
  2025-04-25  7:46   ` Trailing dot in Cygwin filenames [was: failed to clone iptables,ipset,nftables] Jan Engelhardt
  2025-04-25 11:17   ` Fail to clone iptables,ipset,nftables Sunny73Cr
  0 siblings, 2 replies; 5+ messages in thread
From: Florian Westphal @ 2025-04-25  6:22 UTC (permalink / raw)
  To: Sunny73Cr; +Cc: netfilter-devel@vger.kernel.org

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.

I removed the file, can you try to pull again?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trailing dot in Cygwin filenames [was: failed to clone iptables,ipset,nftables]
  2025-04-25  6:22 ` Florian Westphal
@ 2025-04-25  7:46   ` Jan Engelhardt
  2025-04-28  9:38     ` [oss-security] " Werner Koch
  2025-04-25 11:17   ` Fail to clone iptables,ipset,nftables Sunny73Cr
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2025-04-25  7:46 UTC (permalink / raw)
  To: Florian Westphal; +Cc: Sunny73Cr, netfilter-devel@vger.kernel.org, oss-security

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.".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fail to clone iptables,ipset,nftables
  2025-04-25  6:22 ` Florian Westphal
  2025-04-25  7:46   ` Trailing dot in Cygwin filenames [was: failed to clone iptables,ipset,nftables] Jan Engelhardt
@ 2025-04-25 11:17   ` Sunny73Cr
  1 sibling, 0 replies; 5+ messages in thread
From: Sunny73Cr @ 2025-04-25 11:17 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel@vger.kernel.org

> I removed the file, can you try to pull again?

Working fine, since deletion of the file; thank you!

sunny

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [oss-security] Re: Trailing dot in Cygwin filenames [was: failed to clone iptables,ipset,nftables]
  2025-04-25  7:46   ` Trailing dot in Cygwin filenames [was: failed to clone iptables,ipset,nftables] Jan Engelhardt
@ 2025-04-28  9:38     ` Werner Koch
  0 siblings, 0 replies; 5+ messages in thread
From: Werner Koch @ 2025-04-28  9:38 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: Florian Westphal, oss-security, Sunny73Cr,
	netfilter-devel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

Hi!

> But Cygwin does something unusual, it *actually* creates a file with
> the 2-char sequence "y.", through whatever means. Explorer *shows* it

  C:\Users\dd9jn\test>echo foo >x.
  
  C:\Users\dd9jn\test>dir
  [...]
  28.04.2025  11:30                 6 x
                 1 Datei(en),              6 Bytes
  
  C:\Users\dd9jn\test>echo foo >\\?\\c:\users\dd9jn\test\x.
  
  C:\Users\dd9jn\test>dir
  [...]
  28.04.2025  11:30                 6 x
  28.04.2025  11:30                 6 x.
                 2 Datei(en),             12 Bytes
  
Thus you can create such a file using the Extended Path Length Prefix
which bypasses the mapping used by CreateFile.  For detailed info see
also

https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide-on-win32-to-nt.html



Salam-Shalom,

   Werner

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein

[-- Attachment #2: openpgp-digital-signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-28 10:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25  5:30 Fail to clone iptables,ipset,nftables Sunny73Cr
2025-04-25  6:22 ` Florian Westphal
2025-04-25  7:46   ` Trailing dot in Cygwin filenames [was: failed to clone iptables,ipset,nftables] Jan Engelhardt
2025-04-28  9:38     ` [oss-security] " Werner Koch
2025-04-25 11:17   ` Fail to clone iptables,ipset,nftables Sunny73Cr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.