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

Re: [Orinoco-users] linux-firmware binary corruption with gitweb

From
DDave <kilroyd@googlemail.com>
Date
Mar 4, 2009, 23:52 UTC
Message-ID
<49AF1429.9080009@gmail.com>
In-Reply-To
<m3iqmqt9ox.fsf@localhost.localdomain>
Jakub Narebski wrote:
Show 12 quoted lines
> Dave <kilroyd@googlemail.com> writes:
>>> My strong impression is that the recoding takes place on the server.  I
>>> think the bug should be reported to the gitweb maintainers unless it a
>>> local breakage on the kernel.org site.
>> Thanks Pavel.
>>
>> I just did a quick scan of the gitweb README - is this an issue with the
>> $mimetypes_file or $fallback_encoding configurations variables?
> 
> First, what version of gitweb do you use? It should be in 'Generator'
> meta header, or (in older gitweb) in comments in HTML source at the
> top of the page.
Not sure where I'd find the meta header, but at the top of the HTML:

<!-- git web interface version 1.4.5-rc0.GIT-dirty, (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>, Christian Gierke --> <!-- git core binaries version 1.6.1.1 -->

Show 5 quoted lines
> Second, the file is actually sent to browser 'as is', using binmode :raw
> (or at least should be according to my understanding of Perl). And *.bin
> binary file gets application/octet-stream mimetype, and doesn't send any
> charset info. git.kernel.org should have modern enough gitweb to use this.
> Strange...

Dug around gitweb.perl in the main git repo. Then looked at the git/warthog9/gitweb.git repo (after noting the Git Wiki says kernel.org is running John Hawley's branch).

One notable change to git_blob_plain:
        undef $/;
        binmode STDOUT, ':raw';
-        print <$fd>;
+        #print <$fd>;
+        $output .= <$fd>;
        binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
        $/ = "\n";
        close $fd;
+
+        return $output;

If that's the code that's running, doesn't that mean the output mode change doesn't impact the concatenation to $output? So the blob gets utf encoding when actually printed.

Regards,
Dave.
Previous: Jakub NarebskiNext: Jakub Narebski
Message 3 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.