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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190905055614.7958918b@coco.lan>
Date:   Thu, 5 Sep 2019 05:56:14 -0300
From:   Mauro Carvalho Chehab <mchehab@...nel.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Nishad Kamdar <nishadkamdar@...il.com>,
        Joe Perches <joe@...ches.com>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: siano: Use the correct style for SPDX License
 Identifier

Em Thu, 5 Sep 2019 07:54:30 +0200
Greg Kroah-Hartman <gregkh@...uxfoundation.org> escreveu:

> On Wed, Sep 04, 2019 at 04:00:10PM -0300, Mauro Carvalho Chehab wrote:
> > Em Wed, 4 Sep 2019 20:36:08 +0200
> > Greg Kroah-Hartman <gregkh@...uxfoundation.org> escreveu:
> >   
> > > On Wed, Sep 04, 2019 at 03:34:32PM -0300, Mauro Carvalho Chehab wrote:  
> > > > Em Sat, 31 Aug 2019 20:41:51 +0530
> > > > Nishad Kamdar <nishadkamdar@...il.com> escreveu:
> > > >     
> > > > > This patch corrects the SPDX License Identifier style
> > > > > in header file related to Siano Mobile Silicon Digital TV.
> > > > > For C header files Documentation/process/license-rules.rst
> > > > > mandates C-like comments (opposed to C source files where
> > > > > C++ style should be used)
> > > > > 
> > > > > Changes made by using a script provided by Joe Perches here:
> > > > > https://lkml.org/lkml/2019/2/7/46
> > > > > 
> > > > > Suggested-by: Joe Perches <joe@...ches.com>
> > > > > Signed-off-by: Nishad Kamdar <nishadkamdar@...il.com>
> > > > > ---
> > > > >  drivers/media/common/siano/smsir.h | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/drivers/media/common/siano/smsir.h b/drivers/media/common/siano/smsir.h
> > > > > index b2c54c256e86..ada41d5c4e83 100644
> > > > > --- a/drivers/media/common/siano/smsir.h
> > > > > +++ b/drivers/media/common/siano/smsir.h
> > > > > @@ -1,5 +1,5 @@
> > > > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > > >  /*
> > > > > - * SPDX-License-Identifier: GPL-2.0+
> > > > >   *
> > > > >   * Siano Mobile Silicon, Inc.
> > > > >   * MDTV receiver kernel modules.    
> > > > 
> > > > What's wrong with that? The above is a perfectly fine SPDX header.    
> > > 
> > > It is not the first line of the file :(
> > >   
> > 
> > A requirement for having it at the first line is not realistic.  
> 
> But it is "the rule" as Joe points out.
> 
> > I'd say more: some script that would check for SPDX only at the 
> > first line won't work.
> > 
> > The reason is simple: we have some scripts at the Kernel tree.  
> 
> This is not a script, for those, it is fine to use the second line,
> again, this is documented.
> 
> This isn't new at all, been that way since December of 2017, see commit
> aa19a176df95 ("Documentation: Add license-rules.rst to describe how to
> properly identify file licenses")

It sounds that I somehow misinterpreted this. Ok, be it. I'll accept
this patch and keep such rule in mind for next SPDX changes.

Anyway, with regards to script, we need to change the rules in order to
allow adding SPDX for python scripts, as otherwise the addition of SPDX
headers may cause regressions.

As mentioned on
	https://stackoverflow.com/questions/728891/correct-way-to-define-python-source-code-encoding
Python's PEP-263 [1] dictates that an script that needs to default to UTF-8 
encoding has to follow this rule:

	'Python will default to ASCII as standard encoding if no other
	 encoding hints are given.

	 To define a source code encoding, a magic comment must be placed
	 into the source files either as first or second line in the file'

And:
	'More precisely, the first or second line must match the following
	 regular expression:

	 ^[ \t\f]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)'

[1] https://www.python.org/dev/peps/pep-0263/

If a script has both shebang and the charset encoding line, we can't place 
a SPDX tag without either violating license-rules.rst or breaking the script
by making it crash with non-ASCII characters.

I'll submit a separate patch in order to address such issue at
license-rules.txt.

Thanks,
Mauro

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ