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

Re: linux-firmware binary corruption with gitweb

From
PRPavel Roskin <proski-mxxj517/zsq@public.gmane.org>
Date
Mar 5, 2009, 17:26 UTC
Message-ID
<1236273981.24072.16.camel@mj>
In-Reply-To
<49AF1429.9080009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Wed, 2009-03-04 at 23:52 +0000, Dave wrote:
Show 6 quoted lines
>         binmode STDOUT, ':raw';
> -        print <$fd>;
> +        #print <$fd>;
> +        $output .= <$fd>;
>         binmode STDOUT, ':utf8'; # as set at the beginning of
> gitweb.cgi
Nice catch!

Looking at the gitweb repository from kernel.org, two instances of circumventing binmode were introduced by this commit:

commit c79ae555fb3c89d91b4cafbfce306e695720507b
Author: John Hawley <warthog9-v8g9t7APwQevveQcA6InS3zaFgp7qdfK@public.gmane.org>
Date:   Thu Dec 28 21:59:43 2006 -0800
    Last of the changes to deal with channeling the text through the caching
    engine.  Wow is this a total hack.

The original behavior was restored in git_snapshot() by the recent commit c15229acd9bedf165f1eb05d99fa989d3b9f3e32, but git_blob_plain() remains broken.

I don't see an easy fix. We cannot manipulate the blob to counteract the encoding, as it may not be valid utf-8, and therefore won't be output in the utf-8 mode.

Maybe binmode should be raw everywhere, and adding to $output should recode data to utf-8 from other encodings where needed, but it would be a massive patch, I'm afraid. Or it would be a small patch requiring massive testing.

Adding John Hawley to cc:
-- 
Regards,
Pavel Roskin

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
Previous: Jakub Narebski
Message 5 of 5 in “Re: [Orinoco-users] linux-firmware binary corruption with gitweb”
  1. DaveMar 3, 2009
  2. Jakub NarebskiMar 4, 2009
  3. DaveMar 4, 2009
  4. Jakub NarebskiMar 6, 2009
  5. Pavel RoskinMar 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.