All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Dave <kilroyd@googlemail.com>
Cc: Jakub Narebski <jnareb@gmail.com>,
	git@vger.kernel.org, linux-kernel@vger.kernel.org,
	orinoco-users@lists.sourceforge.net, dwmw2@infradead.org,
	"John 'Warthog9' Hawley" <warthog9@eaglescrag.net>
Subject: Re: [Orinoco-users] linux-firmware binary corruption with gitweb
Date: Thu, 05 Mar 2009 12:26:21 -0500	[thread overview]
Message-ID: <1236273981.24072.16.camel@mj> (raw)
In-Reply-To: <49AF1429.9080009@gmail.com>

On Wed, 2009-03-04 at 23:52 +0000, Dave wrote:
>         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@voot-cruiser.localdomain>
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

WARNING: multiple messages have this Message-ID (diff)
From: Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>
To: Dave <kilroyd-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
Cc: orinoco-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	John 'Warthog9' Hawley
	<warthog9-a9bfEDSFcqP30BxdvE/MCQ@public.gmane.org>,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jakub Narebski <jnareb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: linux-firmware binary corruption with gitweb
Date: Thu, 05 Mar 2009 12:26:21 -0500	[thread overview]
Message-ID: <1236273981.24072.16.camel@mj> (raw)
In-Reply-To: <49AF1429.9080009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Wed, 2009-03-04 at 23:52 +0000, Dave wrote:
>         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

  reply	other threads:[~2009-03-05 17:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28 19:24 linux-firmware binary corruption with gitweb Dave
2009-03-01  5:47 ` [Orinoco-users] " Pavel Roskin
2009-03-03 18:59   ` Dave
2009-03-04  0:26     ` Jakub Narebski
2009-03-04 23:52       ` Dave
2009-03-05 17:26         ` Pavel Roskin [this message]
2009-03-05 17:26           ` Pavel Roskin
2009-03-06  0:03         ` [Orinoco-users] " Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1236273981.24072.16.camel@mj \
    --to=proski@gnu.org \
    --cc=dwmw2@infradead.org \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=kilroyd@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orinoco-users@lists.sourceforge.net \
    --cc=warthog9@eaglescrag.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.