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>] [day] [month] [year] [list]
Message-ID: <20241001193347.1743238-1-eleanor15x@gmail.com>
Date: Wed,  2 Oct 2024 03:33:47 +0800
From: Yu-Chun Lin <eleanor15x@...il.com>
To: apw@...onical.com,
	joe@...ches.com,
	dwaipayanray1@...il.com,
	lukas.bulwahn@...il.com,
	linux-kernel@...r.kernel.org
Cc: Yu-Chun Lin <eleanor15x@...il.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>
Subject: [PATCH] checkpatch: handle sha1 of at least 12 hex digits

Modify the regular expression to set $id_length to 0 if the commit hash
is 12 characters or longer, which allows the script to properly handle
longer commit hashes.

Link: https://lore.kernel.org/lkml/20240921151642.60b89e86@canb.auug.org.au/
Suggested-by: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: Yu-Chun Lin <eleanor15x@...il.com>
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 39032224d504..71900eaffa06 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3228,7 +3228,7 @@ sub process {
 				$tag_case = 0 if $tag eq "Fixes:";
 				$tag_space = 0 if ($line =~ /^fixes:? [0-9a-f]{5,} ($balanced_parens)/i);
 
-				$id_length = 0 if ($orig_commit =~ /^[0-9a-f]{12}$/i);
+				$id_length = 0 if ($orig_commit =~ /^[0-9a-f]{12,}$/i);
 				$id_case = 0 if ($orig_commit !~ /[A-F]/);
 
 				# Always strip leading/trailing parens then double quotes if existing
@@ -3245,7 +3245,7 @@ sub process {
 			if ($ctitle ne $title || $tag_case || $tag_space ||
 			    $id_length || $id_case || !$title_has_quotes) {
 				if (WARN("BAD_FIXES_TAG",
-				     "Please use correct Fixes: style 'Fixes: <12 chars of sha1> (\"<title line>\")' - ie: 'Fixes: $cid (\"$ctitle\")'\n" . $herecurr) &&
+				     "Please use correct Fixes: style 'Fixes: <12+ chars of sha1> (\"<title line>\")' - ie: 'Fixes: $cid (\"$ctitle\")'\n" . $herecurr) &&
 				    $fix) {
 					$fixed[$fixlinenr] = "Fixes: $cid (\"$ctitle\")";
 				}
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ