mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scripts/checkpatch.pl: Warn on non-executable files created with non 100644 file permissions
Date: Thu, 7 Oct 2010 08:54:38 +0200	[thread overview]
Message-ID: <20101007065438.GB12741@pengutronix.de> (raw)
In-Reply-To: <1286407891.32241.21.camel@Joe-Laptop>

[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]

On Wed, Oct 06, 2010 at 04:31:31PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  scripts/checkpatch.pl |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2039acd..6f8a1d4 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1346,6 +1346,14 @@ sub process {
>  			}
>  		}
>  
> +		if ($rawline =~ /^ create mode (\d+) ([\w\.\/\-]+)$/) {

Do you really need to escape ./- in the character-class? ISTR this is not
needed.

> +			my $mode = $1;
> +			my $file = $2;
> +			if ($mode ne "100644" && !($file =~ /\.(sh|pl|py|awk)$/)) {
> +				WARN("FILE '$file' should probably use file permission 100644 not $mode\n" . $herecurr);
> +			}

What about checking for no filename extension, too, and changing the message to
something like "use proper file permission or proper extension"?

> +		}
> +
>  # Check for wrappage within a valid hunk of the file
>  		if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
>  			ERROR("patch seems to be corrupt (line wrapped?)\n" .
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2010-10-07  6:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06 23:31 Joe Perches
2010-10-07  6:54 ` Wolfram Sang [this message]
2010-10-11 14:39   ` Michal Marek
2010-10-07 10:48 ` Rabin Vincent

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=20101007065438.GB12741@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®