]> git.ipfire.org Git - thirdparty/git.git/commit
fast-import: disallow more path components
authorElijah Newren <newren@gmail.com>
Sat, 30 Nov 2024 01:09:29 +0000 (01:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Dec 2024 01:09:48 +0000 (10:09 +0900)
commitda91a90c2f42f4b4e1fffa916a51e0e7ecb86ed9
treebd84a2a92a86c4a449263c5239c622d0cd034bd8
parent4a2790a257b314ab59f6f2e25f3d7ca120219922
fast-import: disallow more path components

Instead of just disallowing '.' and '..', make use of verify_path() to
ensure that fast-import will disallow anything we wouldn't allow into
the index, such as anything under .git/, .gitmodules as a symlink, or
a dos drive prefix on Windows.

Since a few fast-export and fast-import tests that tried to stress-test
the correct handling of quoting relied on filenames that fail
is_valid_win32_path(), such as spaces or periods at the end of filenames
or backslashes within the filename, turn off core.protectNTFS for those
tests to ensure they keep passing.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fast-import.c
t/t9300-fast-import.sh
t/t9350-fast-export.sh