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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210804160949.592227-1-kai.heng.feng@canonical.com>
Date:   Thu,  5 Aug 2021 00:09:48 +0800
From:   Kai-Heng Feng <kai.heng.feng@...onical.com>
To:     joe@...ches.com
Cc:     Kai-Heng Feng <kai.heng.feng@...onical.com>,
        linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] get_maintainer: Append parenthesis back to trimmed subsystem name

When a closing parenthesis gets trimmed, there can be unmatched
parenthesis in the subsystem name. This doesn't play well with
git-send-email:
(cc-cmd) Adding cc: intel-gfx@...ts.freedesktop.org (open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...) from: 'scripts/get_maintainer.pl'
Unmatched () '(open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...)' '' at /usr/lib/git-core/git-send-email line 554.
error: unable to extract a valid address from: intel-gfx@...ts.freedesktop.org (open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...)

So append parenthesis back if it was trimmed to make git-send-email
work again:
(cc-cmd) Adding cc: intel-gfx@...ts.freedesktop.org (open list:INTEL DRM DRIVERS (excluding Poulsbo, Mooresto...)) from: 'scripts/get_maintainer.pl'

Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
---
 scripts/get_maintainer.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 2075db0c08b8e..5ebe6dfe250c9 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -1252,9 +1252,10 @@ sub get_subsystem_name {
 
     my $subsystem = $typevalue[$start];
     if ($output_section_maxlen && length($subsystem) > $output_section_maxlen) {
-	$subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
+	my $parenthesis = substr($subsystem, -1) eq ")";
+	$subsystem = substr($subsystem, 0, $output_section_maxlen - ($parenthesis ? 4 : 3));
 	$subsystem =~ s/\s*$//;
-	$subsystem = $subsystem . "...";
+	$subsystem = $subsystem . "..." . ($parenthesis ? ")" : "");
     }
     return $subsystem;
 }
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ