From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id AAFE81F62D; Sun, 8 Jul 2018 00:07:16 +0000 (UTC) Date: Sun, 8 Jul 2018 00:07:16 +0000 From: Eric Wong To: "Eric W. Biederman" Cc: meta@public-inbox.org Subject: Re: [PATCH] Import: Don't copy nulls from emails into git Message-ID: <20180708000716.GA2550@dcvr> References: <87a7r6z1cy.fsf@xmission.com> <20180705231346.GA6524@dcvr> <87601turnf.fsf@xmission.com> <87o9flt496.fsf@xmission.com> <87efggt5i8.fsf_-_@xmission.com> <20180706222251.GA14747@dcvr> <87d0vysy6z.fsf_-_@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d0vysy6z.fsf_-_@xmission.com> List-Id: "Eric W. Biederman" wrote: > > Recently I ran git --git-dir=lkml/git/1.git fsck > and it reported: > > warning in commit 299dbd50b6995c6debe2275f0df984ce697fb4cc: nulInCommit: NULL byte inthe commit object body > > Which I found quite scary. Nulls in the wrong place have a bad tendency > to make programs misbehave. Thanks. In this case, it's a bit weird for fast-import to accept this... > + # Mime decoding can create nulls replace them with spaces to protect git > + $subject =~ s/\0/ /; \0 could appear more than once, so it needs a 'g', at least. I squashed in a change to use "tr/\0/ /" instead (tr// should be faster)