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: <1512608376-4234-1-git-send-email-me@tobin.cc>
Date:   Thu,  7 Dec 2017 11:59:36 +1100
From:   "Tobin C. Harding" <me@...in.cc>
To:     Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>
Cc:     "Tobin C. Harding" <me@...in.cc>, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH] checkpatch: add check for tag Co-Developed-by

Recently signature tag Co-Developed-by was added to the
kernel (Documentation/process/5.Posting.rst). checkpatch.pl doesn't know
about it yet. All prior tags used all lowercase characters except for first
character. Checks for this format had to be re-worked to allow for the
new tag.

Add checkpatch checks for Co-Developed-by tag.

Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Tobin C. Harding <me@...in.cc>
---
 scripts/checkpatch.pl | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 040aa79e1d9d..a7d2cdcec6a6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -468,6 +468,7 @@ our $signature_tags = qr{(?xi:
 	Reviewed-by:|
 	Reported-by:|
 	Suggested-by:|
+	Co-Developed-by:|
 	To:|
 	Cc:
 )};
@@ -2468,6 +2469,8 @@ sub process {
 			my $space_after = $3;
 			my $email = $4;
 			my $ucfirst_sign_off = ucfirst(lc($sign_off));
+			my $preferred_signature = "";
+			my $co_dev_by_tag = 'Co-Developed-by:';
 
 			if ($sign_off !~ /$signature_tags/) {
 				WARN("BAD_SIGN_OFF",
@@ -2481,15 +2484,22 @@ sub process {
 					    "$ucfirst_sign_off $email";
 				}
 			}
-			if ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) {
-				if (WARN("BAD_SIGN_OFF",
-					 "'$ucfirst_sign_off' is the preferred signature form\n" . $herecurr) &&
-				    $fix) {
-					$fixed[$fixlinenr] =
-					    "$ucfirst_sign_off $email";
+			if ($sign_off =~ /$co_dev_by_tag$/i) {
+				if ($sign_off ne $co_dev_by_tag) {
+					$preferred_signature = $co_dev_by_tag;
 				}
+			} elsif ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) {
+				$preferred_signature = $ucfirst_sign_off;
 
 			}
+
+			if ($preferred_signature ne "") {
+				my $prefix = "'$preferred_signature' is the preferred signature form\n";
+				if (WARN("BAD_SIGN_OFF", $prefix . $herecurr) && $fix) {
+					$fixed[$fixlinenr] = "$ucfirst_sign_off $email";
+				}
+			}
+
 			if (!defined $space_after || $space_after ne " ") {
 				if (WARN("BAD_SIGN_OFF",
 					 "Use a single space after $ucfirst_sign_off\n" . $herecurr) &&
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ