From 78f959483913964bfaad8ceb069c44083c251934 Mon Sep 17 00:00:00 2001 From: Collin McNeese Date: Thu, 2 Jan 2020 08:29:26 -0600 Subject: [PATCH] updates file resource doc to add example for sticky bit with leading zero Signed-off-by: Collin McNeese --- docs/resources/file.md.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/resources/file.md.erb b/docs/resources/file.md.erb index ce8f82b3c..6c050ac95 100644 --- a/docs/resources/file.md.erb +++ b/docs/resources/file.md.erb @@ -117,6 +117,14 @@ not { should cmp '644' } +or: + + { should cmp '01775' } + +not + + { should cmp '1775' } + Without the zero prefix for the octal value, Chef InSpec will interpret it as the _decimal_ value 644, which is octal 1024 or `-----w-r-T`, and any test for a file that is `-rw-r--r--` will fail. Note: see the [`be_more_permissive_than(mode)`](#be_more_permissive_than?(mode)) matcher for upper and lower bounds on file mode.