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

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

From
Chris Torek <chris.torek@gmail.com>
Date
Mar 23, 2025, 15:12 UTC
Message-ID
<CAPx1GvfPUqHkT8MewXyAS5ptO2Cz+Jn1+1w9wa5j-WfO68dfYg@mail.gmail.com>
In-Reply-To
<11DFC309-0D48-42C8-A683-F5D0C30810D3@gmail.com>
On Sun, Mar 23, 2025 at 8:05 AM Ayman Bagabas <ayman.bagabas@gmail.com> wrote:
> Shouldn't we also check [access()] for both F_OK?
Any success for R_OK, W_OK, or X_OK implies F_OK.

I'm not a fan of access() calls in general for multiple reasons (they get suggested for security tests in setuid programs, but you race from "access seems OK" to "actually try to access" against anyone who modifies the name-to-underlying-entity binding, so in general the "right" test is "do the operation with the appropriate permissions in place, then see if it actually worked", which is atomic). But in this particular case it's probably not that important (we seem to make a lot of assumptions about security, or perhaps lack of its importance, in git-shell).

Chris
Previous: Ayman BagabasNext: Ayman Bagabas via GitGitGadget
Message 8 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.