From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64CA0C43463 for ; Sun, 20 Sep 2020 17:39:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1ACD820789 for ; Sun, 20 Sep 2020 17:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726151AbgITRjx (ORCPT ); Sun, 20 Sep 2020 13:39:53 -0400 Received: from smtprelay0006.hostedemail.com ([216.40.44.6]:51076 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726043AbgITRjw (ORCPT ); Sun, 20 Sep 2020 13:39:52 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id BBEF0180A7FDD; Sun, 20 Sep 2020 17:39:51 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: shame47_050a3db2713e X-Filterd-Recvd-Size: 2993 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Sun, 20 Sep 2020 17:39:50 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2] checkpatch: extend author Signed-off-by check for split From: header From: Joe Perches To: Dwaipayan Ray , Andrew Morton Cc: lukas.bulwahn@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, apw@canonical.com, linux-kernel@vger.kernel.org Date: Sun, 20 Sep 2020 10:39:49 -0700 In-Reply-To: <20200920091706.56276-1-dwaipayanray1@gmail.com> References: <20200920091706.56276-1-dwaipayanray1@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-09-20 at 14:47 +0530, Dwaipayan Ray wrote: > Checkpatch did not handle cases where the author From: header > was split into multiple lines. The author identity could not > be resolved and checkpatch generated a false NO_AUTHOR_SIGN_OFF > warning. > > A typical example is Commit e33bcbab16d1 ("tee: add support for > session's client UUID generation"). When checkpatch was run on > this commit, it displayed: > > "WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal > patch author ''" > > This was due to split header lines not being handled properly and > the author himself wrote in Commit cd2614967d8b ("checkpatch: warn > if missing author Signed-off-by"): > > "Split From: headers are not fully handled: only the first part > is compared." > > Support split From: headers by correctly parsing the header > extension lines. RFC 2822, Section-2.2.3 stated that each extended > line must start with a WSP character (a space or htab). The solution > was therefore to concatenate the lines which start with a WSP to > get the correct long header. > > Suggested-by: Joe Perches > Link: https://lore.kernel.org/linux-kernel-mentees/f5d8124e54a50480b0a9fa638787bc29b6e09854.camel@perches.com/ > Signed-off-by: Dwaipayan Ray Acked-by: Joe Perches > --- > scripts/checkpatch.pl | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 504d2e431c60..9e65d21456f1 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -2661,6 +2661,10 @@ sub process { > # Check the patch for a From: > if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) { > $author = $1; > + my $curline = $linenr; > + while(defined($rawlines[$curline]) && ($rawlines[$curline++] =~ /^[ \t]\s*(.*)/)) { > + $author .= $1; > + } > $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i); > $author =~ s/"//g; > $author = reformat_email($author);