Skip to contentSkip to conversation

checkpatch: make email address check case insensitive

PATCH Applied Mimi Zohar 2 participants 2 messages Aug 16, 2021 Checkpatch

lore
Share & tools
lore

Mimi Zohar

author
#0 lore raw

PATCH 1/1 checkpatch: make email address check case insensitive

Instead of checkpatch requiring the patch author to exactly match the signed-off-by tag, commit 48ca2d8ac8a1 ("checkpatch: add new warnings to author signoff checks.") safely relaxed this requirement.

Although the local-part of an email address (local-part@domain), may be case sensitive, exploiting the case sensitivity of mailbox local-parts impedes interoperability and is discouraged. Mailbox domains follow normal DNS rules and are hence not case sensitive. (Refer to https://datatracker.ietf.org/doc/html/rfc5321#section-2.4.)

Further relax the patch author and signed-off-by tag comparison by making the email address check case insensitive.

---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +2 -2
index 461d4221e4a4..1efa2997df62 100755
@@ -2909,10 +2909,10 @@ sub process {
 					my ($email_name, $email_comment, $email_address, $comment1) = parse_email($ctx);
 					my ($author_name, $author_comment, $author_address, $comment2) = parse_email($author);
 
-					if ($email_address eq $author_address && $email_name eq $author_name) {
+					if (lc $email_address eq lc $author_address && $email_name eq $author_name) {
 						$author_sob = $ctx;
 						$authorsignoff = 2;
-					} elsif ($email_address eq $author_address) {
+					} elsif (lc $email_address eq lc $author_address) {
 						$author_sob = $ctx;
 						$authorsignoff = 3;
 					} elsif ($email_name eq $author_name) {
Signature · 1 line
2.27.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mimi Zohar

Instead of checkpatch requiring the patch author to exactly match the signed-off-by tag, commit 48ca2d8ac8a1 ("checkpatch: add new warnings to author signoff checks.") safely relaxed this requirement.

Although the local-part of an email address (local-part@domain), may be case sensitive, exploiting the case sensitivity of mailbox local-parts impedes interoperability and is discouraged. Mailbox domains follow normal DNS rules and are hence not case sensitive. (Refer to https://datatracker.ietf.org/doc/html/rfc5321#section-2.4.)

Quoted 4 lines

Further relax the patch author and signed-off-by tag comparison by making the email address check case insensitive.

Quoted 22 lines

---
 scripts/checkpatch.pl | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +0 -0
index 461d4221e4a4..1efa2997df62 100755
@@ -2909,10 +2909,10 @@ sub process {
  					my ($email_name, $email_comment, $email_address, $comment1) = parse_email($ctx);
  					my ($author_name, $author_comment, $author_address, $comment2) = parse_email($author);

scripts/checkpatch.pl +1 -1
-					if ($email_address eq $author_address && $email_name eq $author_name) {
+					if (lc $email_address eq lc $author_address && $email_name eq $author_name) {

  $author_sob = $ctx; $authorsignoff = 2;

scripts/checkpatch.pl +1 -1
-					} elsif ($email_address eq $author_address) {
+					} elsif (lc $email_address eq lc $author_address) {

  $author_sob = $ctx; $authorsignoff = 3; } elsif ($email_name eq $author_name) {