lkml.org 
[lkml]   [2014]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] checkpatch: Update octal permissions warning
Date
When checking permissions, make sure 4 octal digits are used,
but allow a single 0 too.

Signed-off-by: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1054283..9f12213 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4512,9 +4512,11 @@ sub process {
my $val = $1;
$val = $6 if ($skip_args ne "");

- if ($val =~ /^$Int$/ && $val !~ /^$Octal$/) {
+ if ($val !~ /^0$/ &&
+ (($val =~ /^$Int$/ && $val !~ /^$Octal$/) ||
+ length($val) ne 4)) {
ERROR("NON_OCTAL_PERMISSIONS",
- "Use octal not decimal permissions\n" . $herecurr);
+ "Use 4 digit octal (0777) not decimal permissions\n" . $herecurr);
}
}
}
--
1.8.1.2.459.gbcd45b4.dirty


\
 
 \ /
  Last update: 2014-02-16 23:41    [W:0.028 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site