git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] [RFC] shell: allow overriding built-in commands

From
Elijah Newren <newren@gmail.com>
Date
Mar 22, 2025, 18:26 UTC
Message-ID
<CABPp-BHDF9ufzP6e-YfFbom6XG_QUxr5s=ZGVS-6+zSYm0bBFQ@mail.gmail.com>
In-Reply-To
<9A950A71-8847-4F1C-A691-5A9CD461FE6C@gmail.com>
On Sat, Mar 22, 2025 at 11:02 AM Ayman Bagabas <ayman.bagabas@gmail.com> wrote:
Show 30 quoted lines
>
> > On Mar 22, 2025, at 8:39 PM, Elijah Newren <newren@gmail.com> wrote:
> >
> > On Sat, Mar 22, 2025 at 3:02 AM Ayman Bagabas via GitGitGadget
> > <gitgitgadget@gmail.com> wrote:
> >>
> >> From: Ayman Bagabas <ayman.bagabas@gmail.com>
> >>
> >> This patch allows overriding built-in commands by placing a script
> >> with the same name under git-shell-commands directory.
> >>
> >> This is useful for users who want to extend the built-in commands
> >> without replacing the original command binary. For instance, a user
> >> wanting to allow only a subset of users to run the git-receive-pack
> >> can override the command with a script that checks the user and
> >> calls the original command if the user is allowed.
> >
> > Sounds like it'd open a window to generating numerous security
> > vulnerabilities, break git's own commands that exec another git
> > subprocess (e.g. git-stash), make debugging git bug reports harder,
> > and likely break programs that use plumbing commands.
>
> How so? The security implications are the same as any script
> defined under git-shell-commands. Git does not handle authentication
> nor authorization and it shouldn't do so, and this can allow repository
> based authorization to happen using git-shell.
>
> Forgive my limited knowledge about git internals but how would this
> break git's own commands that exec another git subprocess and
> plumbing commands?

Sorry, I wasn't reading closely enough and missed the part where this was specific to `git shell` as opposed to a general ability to override built-ins.

Previous: Ayman BagabasNext: Ayman Bagabas via GitGitGadget
Message 4 of 13 in “[RFC] shell: allow overriding built-in commands”
  1. [RFC] shell: allow overriding built-in commandsAyman Bagabas via GitGitGadget, Mar 22, 2025
  2. Elijah NewrenMar 22, 2025
  3. Ayman BagabasMar 22, 2025
  4. Elijah NewrenMar 22, 2025
  5. shell: allow overriding built-in commandsAyman Bagabas via GitGitGadget, Mar 23, 2025
  6. Chris TorekMar 23, 2025
  7. Ayman BagabasMar 23, 2025
  8. Chris TorekMar 23, 2025
  9. shell: allow overriding built-in commandsAyman Bagabas via GitGitGadget, Mar 23, 2025
  10. Jeff KingMar 24, 2025
  11. Junio C HamanoMar 24, 2025
  12. Jeff KingMar 24, 2025
  13. Ayman BagabasMar 25, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.