linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
From: Ujjwal Kumar <ujjwalkumar0501@gmail.com>
To: lukas.bulwahn@gmail.com
Cc: linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [RFC PATCH] checkpatch: add shebang check to EXECUTE_PERMISSIONS
Date: Sun, 11 Oct 2020 22:10:07 +0530	[thread overview]
Message-ID: <cbd50f33-9584-6751-80bd-f2c66b8f14b9@gmail.com> (raw)
In-Reply-To: <20201011162123.1151215-1-ujjwalkumar0501@gmail.com>

On 11/10/20 9:51 pm, Ujjwal Kumar wrote:
> checkpatch script checks for invalid EXECUTE_PERMISSIONS on source
> files. The script leverages filename extensions and its path in
> the repository to decide whether to allow execute permissions on
> the file or not.
> 
> Based on current check conditions, a perl script file without
> '.pl' extension in its filename and not belonging to 'scripts/'
> directory is reported as ERROR which is a false-positive.
> 
> The script can correctly handle patches with mode changes and
> shebang line if shebang is taken into account. So, along with
> the current check conditions, adding the shebang check in the
> check conditions can improve the reports of the script.
> 
> Signed-off-by: Ujjwal Kumar <ujjwalkumar0501@gmail.com>
> ---
>  scripts/checkpatch.pl | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

To test the changes, I used the following scripts:

for i in $(find -executable -type f | grep "\.[a-z]" -v | grep "scripts/" -v); \
do \
hs=$(git log --reverse --format=%H $i | head -1); \
echo $hs; \
done | sort | uniq | \
xargs -n1 -P7 scripts/checkpatch.pl --show-types --types EXECUTE_PERMISSIONS --terse -g

Before patching, the script shows 21 false-positives.
After applying the patch, the ERRORS are gone.

Thanks
Ujjwal Kumar
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2020-10-11 16:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 16:21 [Linux-kernel-mentees] [RFC PATCH] checkpatch: add shebang check to EXECUTE_PERMISSIONS Ujjwal Kumar
2020-10-11 16:40 ` Ujjwal Kumar [this message]
2020-10-11 17:50 ` Lukas Bulwahn
2020-10-11 18:14   ` Ujjwal Kumar
2020-10-11 18:19     ` Lukas Bulwahn
2020-10-11 18:32       ` Ujjwal Kumar
2020-10-11 18:35         ` Lukas Bulwahn
2020-10-12  4:36 Ujjwal Kumar
2020-10-12  5:25 ` Lukas Bulwahn
2020-10-12  5:49 Ujjwal Kumar
2020-10-12  6:17 ` Joe Perches
2020-10-12 13:52   ` Ujjwal Kumar
2020-10-12 14:16     ` Lukas Bulwahn
2020-10-12 15:23       ` Joe Perches
2020-10-12 15:08     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cbd50f33-9584-6751-80bd-f2c66b8f14b9@gmail.com \
    --to=ujjwalkumar0501@gmail.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=lukas.bulwahn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).