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

Re: git archive generates tar with malformed pax extended attribute

From
Jeff King <peff@peff.net>
Date
May 28, 2019, 05:58 UTC
Message-ID
<20190528055805.GB7946@sigill.intra.peff.net>
In-Reply-To
<b4aaff4b-eaf7-9eaf-063f-42c073078060@web.de>
On Sat, May 25, 2019 at 03:26:53PM +0200, René Scharfe wrote:
> We could truncate symlink targets at the first NUL as well in git
> archive -- but that would be a bit sad, as the archive formats allow
> storing the "real" target from the repo, with NUL and all.  We could
> make git fsck report such symlinks.

This is a little tricky, because fsck generally looks at individual objects, and the bad pattern is a combination of a tree and a blob together. I think you could make it work by reusing some of the code and patterns from 9e84a6d758 (Merge branch 'jk/submodule-fsck-loose' into maint, 2018-05-22).

> Can Unicode symlink targets contain NULs?  We wouldn't want to damage
> them even if we decide to truncate.

On Windows, I suppose, where pathnames can be UTF-16? I don't know how any of that works with Git. I guess we'd always have to assume the filenames in Git are UTF-8 or at least some ASCII-superset, since we cannot encode NULs; and presumably that would extend to link destinations, too. So I doubt it's a problem in practice. Personally, I'd wait until somebody with such a system cares enough to suggest a new behavior, rather than trying to guess. :)

Likewise, I think at this point with Keegan's original report that Git is doing something reasonable with a lousy input. Unless something interesting comes out of the golang/go bug report discussion (thank you for opening that!), it's probably not worth chasing hypotheticals.

-Peff
Previous: Jeff KingNext: René Scharfe
Message 10 of 21 in “git archive generates tar with malformed pax extended attribute”
  1. Keegan Carruthers-SmithMay 24, 2019
  2. Jeff KingMay 24, 2019
  3. Keegan Carruthers-SmithMay 24, 2019
  4. Jeff KingMay 24, 2019
  5. René ScharfeMay 25, 2019
  6. Andreas SchwabMay 25, 2019
  7. Ævar Arnfjörð BjarmasonMay 25, 2019
  8. René ScharfeMay 26, 2019
  9. Jeff KingMay 28, 2019
  10. Jeff KingMay 28, 2019
  11. René ScharfeMay 28, 2019
  12. Jeff KingMay 28, 2019
  13. René ScharfeMay 28, 2019
  14. Jeff KingMay 29, 2019
  15. René ScharfeMay 29, 2019
  16. Jeff KingMay 30, 2019
  17. René ScharfeJun 2, 2019
  18. Jeff KingJun 4, 2019
  19. Keegan Carruthers-SmithMay 27, 2019
  20. Ævar Arnfjörð BjarmasonMay 25, 2019
  21. brian m. carlsonMay 25, 2019

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.