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-next>] [day] [month] [year] [list]
Message-Id: <c5b2c9b85c9c955208c5d4ca10f257496315e389.1392587681.git.joe@perches.com>
Date:	Sun, 16 Feb 2014 13:57:26 -0800
From:	Joe Perches <joe@...ches.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Andy Whitcroft <apw@...onical.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] checkpatch: Update octal permissions warning

When checking permissions, make sure 4 octal digits are used,
but allow a single 0 too.

Signed-off-by: Joe Perches <joe@...ches.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ