提交 1727cc70 编写于 作者: J Joe Perches 提交者: Linus Torvalds

checkpatch: update octal permissions warning

When checking permissions, make sure 4 octal digits are used, but allow
a single 0 too.
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fbdb8138
......@@ -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);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册