lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1235757920-20474-1-git-send-email-broonie@sirena.org.uk>
Date:	Fri, 27 Feb 2009 18:05:20 +0000
From:	Mark Brown <broonie@...ena.org.uk>
To:	Andy Whitcroft <apw@...onical.com>
Cc:	linux-kernel@...r.kernel.org, Mark Brown <broonie@...ena.org.uk>
Subject: [PATCH] checkpatch: Warn on empty commit log bodies

Try to help ensure that e-mailed patches have some commit log text in
the body of the e-mail by warning if we can't find any lines that look
like a header of some kind prior to the Signed-off-by.

Signed-off-by: Mark Brown <broonie@...ena.org.uk>
---
 scripts/checkpatch.pl |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 45eb0ae..d162421 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1072,6 +1072,7 @@ sub process {
 
 	our $clean = 1;
 	my $signoff = 0;
+	my $headers = 0;
 	my $is_patch = 0;
 
 	our @report = ();
@@ -1258,6 +1259,11 @@ sub process {
 
 		$cnt_lines++ if ($realcnt != 0);
 
+		# Check for a RFC822 style header
+		if ($line =~ /^([a-z0-9-]+:|From )/i) {
+			$headers++;
+		}
+
 #check the patch for a signoff:
 		if ($line =~ /^\s*signed-off-by:/i) {
 			# This is a signoff, if ugly, so do not double report.
@@ -1270,6 +1276,14 @@ sub process {
 				WARN("space required after Signed-off-by:\n" .
 					$herecurr);
 			}
+
+			# There should be at least 1 line of ordinary
+			# text for the body of the commit log prior to
+			# the signoff.
+			if ($linenr - $headers < 2) {
+				print $headers . $linenr . "\n";
+				WARN("no body for commit log");
+			}
 		}
 
 # Check for wrappage within a valid hunk of the file
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ