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

Re: [PATCH 1/4] sha1-lookup: add new "sha1_pos" function to efficiently lookup sha1

From
Jeff King <peff@peff.net>
Date
Apr 5, 2009, 20:17 UTC
Message-ID
<20090405201700.GC4716@coredump.intra.peff.net>
In-Reply-To
<3f4fd2640904051231x17117a4g3efe38067c8d3359@mail.gmail.com>
On Sun, Apr 05, 2009 at 08:31:06PM +0100, Reece Dunn wrote:
Show 6 quoted lines
> This is what `base64 -d` gives:
> [...]
> It's not "going to be", but "has been so for the last two years since
> 5d23e13".
> 
> It is an assert, and I think Peff's die("BUG: ...") would be a good idea.

Interestingly, I get a bunch of unprintable crap at the end. The culprit seems to be that vger stupidly adds:

    --
    To unsubscribe from this list: send the line "unsubscribe git" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html

to the bottom, regardless of transfer-encoding. At best, this is pointless and invisible, as the reader will just show the base64 content. But some decoders (like mutt) actually treat non-base64 characters not as "end of base64" but as "ignore and keep looking for more base64". So this decodes into a bunch of random characters. And to make it even more fun, it only happens if the message is a certain length; otherwise, it needs "=" fill characters at the end, which unambiguously signal the end.

"openssl base64 -d" stops decoding at the cruft. But I think what mutt is doing is right. According to RFC 2045:

     The encoded output stream must be represented in lines of no more
     than 76 characters each.  All line breaks or other characters not
     found in Table 1 must be ignored by decoding software.  In base64
     data, characters other than those in Table 1, line breaks, and
     other white space probably indicate a transmission error, about
     which a warning message or even a message rejection might be
     appropriate under some circumstances.

I don't know if it is worth trying to get vger to be smarter. According to this, they consider base64 text parts not worth handling:

  http://lkml.indiana.edu/hypermail/linux/kernel/0304.0/0901.html
So maybe it is worth trying to get Junio not to send base64 mail. ;)
-Peff
Previous: Reece DunnNext: Jay Soffian
Message 17 of 20 in “sha1-lookup: add new "sha1_pos" function to efficiently lookup sha1”
  1. 1/4 sha1-lookup: add new "sha1_pos" function to efficiently lookup sha1Christian Couder, Apr 4, 2009
  2. Sverre RabbelierApr 5, 2009
  3. Jeff KingApr 5, 2009
  4. Sverre RabbelierApr 5, 2009
  5. Junio C HamanoApr 5, 2009
  6. Sverre RabbelierApr 5, 2009
  7. Jeff KingApr 5, 2009
  8. Sverre RabbelierApr 5, 2009
  9. Felipe ContrerasApr 5, 2009
  10. Reece DunnApr 5, 2009
  11. Junio C HamanoApr 5, 2009
  12. Jeff KingApr 5, 2009
  13. Sverre RabbelierApr 5, 2009
  14. Gnus content transfer encoding (was: [PATCH 1/4] sha1-lookup: add new "sha1_pos" function to efficiently lookup sha1)Teemu Likonen, Apr 5, 2009
  15. Junio C HamanoApr 6, 2009
  16. Reece DunnApr 5, 2009
  17. Jeff KingApr 5, 2009
  18. Jay SoffianApr 5, 2009
  19. Johannes SchindelinApr 5, 2009
  20. Felipe ContrerasApr 5, 2009

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.