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] [day] [month] [year] [list]
Message-ID: <CAAj6DX3aZ+_q1Vi7A+fyje9-s27dYO5_MEhZ_EU-DEVSXwNzkw@mail.gmail.com>
Date:   Thu, 9 May 2019 11:26:50 +0200
From:   Antonio Borneo <borneo.antonio@...il.com>
To:     Joe Perches <joe@...ches.com>
Cc:     Andy Whitcroft <apw@...onical.com>,
        "Elliott, Robert (Servers)" <elliott@....com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] checkpatch: add command-line option for TAB size

On Thu, May 9, 2019 at 10:03 AM Joe Perches <joe@...ches.com> wrote:
>
> On Thu, 2019-05-09 at 09:21 +0200, Antonio Borneo wrote:
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -2224,7 +2229,7 @@ sub string_find_replace {
> >  sub tabify {
> >       my ($leading) = @_;
> >
> > -     my $source_indent = 8;
> > +     my $source_indent = $tabsize;
> >       my $max_spaces_before_tab = $source_indent - 1;
>
> I didn't test this.
>
> Does this work properly if --tab-size=1 ?
> Maybe die if ($tabsize < 2); is necessary?

I have tested it and it works fine, but now that you point it, I
rechecked the code. There is already this in checkpatch
sub tabify {
...
        my $source_indent = $tabsize;
        my $max_spaces_before_tab = $source_indent - 1;
...
        #Remove spaces before a tab
        1 while $leading =~ s@^([\t]*)( {1,$max_spaces_before_tab})\t@$1\t@g;
that works fine.
But we could have in the future some other test in checkpatch that
uses "$tabsize - 1" and does not get the proper validation for
--tab-size=1
Maybe it's safer to put die if ($tabsize < 2) right now, and avoid
future headaches. With a comment to explains this choice.

Antonio

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ