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

Re: Bug: git grep --no-index 123 /dev/stdin crashes with SIGABRT

From
Kristoffer Haugsbakk <code@khaugsbakk.name>
Date
Oct 14, 2023, 19:37 UTC
Message-ID
<6bb48aac-460c-4d7f-9057-40c3df0c807d@app.fastmail.com>
In-Reply-To
<2d8eca81-0415-43bf-b3c4-f1163713422b@app.fastmail.com>
On Sat, Oct 14, 2023, at 20:12, Kristoffer Haugsbakk wrote:
> It looks like `setup.c:verify_filename` fails to deny paths that are not
> transitive children (or whatever the term) of the directory that git(1) is
> running in:

No, that's not it. I don't think that's the responsibility of that function. Compare to a successful run, that is when run in a Git repository:

    $ git grep --no-index dfddf /home
    fatal: /home: '/home' is outside repository at '/home/kristoffer/programming/git'
And that error happens at `pathspec.c:473`.
So going down into that file is not wrong.
Previous: Kristoffer HaugsbakkNext: Kristoffer Haugsbakk
Message 3 of 15 in “Bug: git grep --no-index 123 /dev/stdin crashes with SIGABRT”
  1. ks1322 ks1322Oct 14, 2023
  2. Kristoffer HaugsbakkOct 14, 2023
  3. Kristoffer HaugsbakkOct 14, 2023
  4. grep: die gracefully when outside repositoryKristoffer Haugsbakk, Oct 14, 2023
  5. Jeff KingOct 15, 2023
  6. Kristoffer HaugsbakkOct 15, 2023
  7. Junio C HamanoOct 15, 2023
  8. Junio C HamanoOct 17, 2023
  9. Kristoffer HaugsbakkOct 17, 2023
  10. Junio C HamanoOct 17, 2023
  11. Junio C HamanoOct 17, 2023
  12. grep: die gracefully when outside repositoryKristoffer Haugsbakk, Oct 20, 2023
  13. Eric SunshineOct 20, 2023
  14. Junio C HamanoOct 20, 2023
  15. grep: die gracefully when outside repositoryKristoffer Haugsbakk, Oct 20, 2023

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.