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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 21 Dec 2017 09:22:57 -0800
From:   Joe Perches <joe@...ches.com>
To:     Rob Herring <robh@...nel.org>
Cc:     linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Andy Whitcroft <apw@...onical.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Philippe Ombredanne <pombredanne@...b.com>
Subject: Re: [PATCH v4] checkpatch.pl: Add SPDX license tag check

On Thu, 2017-12-21 at 11:04 -0600, Rob Herring wrote:
> Okay, here's what I've ended up with:
> 
> 		if ($realline == $checklicenseline) {
> 			if ($realfile =~ /\.(?:sh|pl|py)/ && $rawline =~ /\[ \+]\s*\!\#/) {
> 				$checklicenseline = 2;
> 			} elsif ($rawline =~ /^\+/) {
> 				my $comment = "";
> 				if ($realfile =~ /\.(h|s|S)$/) {
> 					$comment = '/\*';
> 				} elsif ($realfile =~ /\.(c|dts|dtsi)$/) {
> 					$comment = '//';
> 				} elsif ($realfile =~ /\.(sh|pl|py)$/) {
> 					$comment = '#';
> 				} elsif ($realfile =~ /\.rst$/) {
> 					$comment = '\.\.';
> 				}
> 
> 				if ($comment !~ /^$/ &&
> 				    $rawline !~ m@^\+$comment SPDX-License-Identifier: @) {
> 					WARN("SPDX_LICENSE_TAG",
> 					     "Missing or malformed SPDX-License-Identifier tag in 1st (or 2nd for scripts) line\n" . 
> $herecurr);
> 				}
> 			}
> 		}

Seems sensible enough.

Maybe it's better to use \Q$comment\E and a consistent
style on comment and rawline

Any checkpatch patch for license style requirements should
not be applied until after Documentation/license-rules.rst
is in -next.

Powered by blists - more mailing lists