2015-10-24 09:11:36 +00:00
|
|
|
#
|
|
|
|
# prepares a sample file for verification
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
if node["platform_family"] != "windows"
|
|
|
|
file "/tmp/file" do
|
|
|
|
mode "0765"
|
|
|
|
content "hello world"
|
2015-11-17 21:14:05 +00:00
|
|
|
end
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
file "/tmp/sfile" do
|
|
|
|
mode "7765"
|
|
|
|
content "hello suid/sgid/sticky"
|
2016-07-10 18:40:06 +00:00
|
|
|
end
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
directory "/tmp/folder" do
|
|
|
|
mode "0567"
|
2015-11-17 21:14:05 +00:00
|
|
|
end
|
2015-10-25 20:36:49 +00:00
|
|
|
|
2016-03-18 20:32:43 +00:00
|
|
|
else
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
user "TestUser" do
|
|
|
|
password "p@ssw0rd"
|
2016-10-24 16:06:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
directory 'C:\Test Directory' do
|
2019-06-11 22:24:35 +00:00
|
|
|
rights :read, "Administrators"
|
|
|
|
rights :read_execute, "Administrators"
|
|
|
|
rights :write, "Administrators"
|
|
|
|
rights :modify, "Administrators"
|
|
|
|
rights :full_control, "Administrators", applies_to_children: true
|
|
|
|
deny_rights :read, "TestUser"
|
|
|
|
deny_rights :write, "TestUser"
|
|
|
|
deny_rights :read_execute, "TestUser"
|
2016-10-24 16:06:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
file 'C:\Test Directory\test file.txt' do
|
2019-06-11 22:24:35 +00:00
|
|
|
rights :read, "Administrators"
|
|
|
|
rights :read_execute, "Administrators"
|
|
|
|
rights :write, "Administrators"
|
|
|
|
rights :modify, "Administrators"
|
|
|
|
rights :full_control, "Administrators"
|
|
|
|
deny_rights :read, "TestUser"
|
|
|
|
deny_rights :write, "TestUser"
|
|
|
|
deny_rights :read_execute, "TestUser"
|
2016-10-24 16:06:41 +00:00
|
|
|
end
|
2016-03-18 20:32:43 +00:00
|
|
|
|
2015-10-25 20:36:49 +00:00
|
|
|
end
|