From: Junio C Hamano <gitster@pobox.com>
To: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>,
Patrick Steinhardt <ps@pks.im>,
Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
Jeff King <peff@peff.net>, Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH] fast-import: disallow more path components
Date: Thu, 28 Nov 2024 09:22:32 +0900 [thread overview]
Message-ID: <xmqqldx4qkaf.fsf@gitster.g> (raw)
In-Reply-To: <pull.1832.git.1732740464398.gitgitgadget@gmail.com> (Elijah Newren via GitGitGadget's message of "Wed, 27 Nov 2024 20:47:44 +0000")
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Elijah Newren <newren@gmail.com>
>
> 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.
>
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
> Disallow verify_path() failures from fast-import
>
> Since en/fast-import-path-sanitize has already made it to next, this
> commit is based on that. (See
> https://lore.kernel.org/git/pull.1831.v2.git.1732561248717.gitgitgadget@gmail.com/
> for discussion of that series.)
>
> Changes relative to that commit: this fixes up the error message as
> suggested by Kristoffer, and makes the checks more encompassing as
> suggested by Patrick and Peff -- in particular, using verify_path() as
> suggested by Peff.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1832%2Fnewren%2Fdisallow-verify-path-fast-import-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1832/newren/disallow-verify-path-fast-import-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/1832
Thanks, all. Looking good to me.
Will queue.
next prev parent reply other threads:[~2024-11-28 0:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 20:47 [PATCH] fast-import: disallow more path components Elijah Newren via GitGitGadget
2024-11-28 0:22 ` Junio C Hamano [this message]
2024-11-28 16:12 ` Jeff King
2024-11-30 1:09 ` [PATCH v2] " Elijah Newren via GitGitGadget
2024-12-01 21:40 ` Jeff King
2024-12-03 8:01 ` Elijah Newren
2024-12-03 21:06 ` [PATCH 2/1] t9300: test verification of renamed paths Jeff King
2024-12-03 22:22 ` Elijah Newren
2024-12-04 0:15 ` Junio C Hamano
2024-12-03 22:17 ` [PATCH v2] fast-import: disallow more path components Junio C Hamano
2024-12-02 1:04 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqldx4qkaf.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).