Skip to content

Commit 8f763e5

Browse files
Properly verify the kernel dump setting
0 and 2 are the allowed options
1 parent 58810fe commit 8f763e5

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

controls/sysctl_spec.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -323,20 +323,11 @@
323323
desc 'Ensure that core dumps can never be made by setuid programs or with fully qualified path'
324324

325325
describe kernel_parameter('fs.suid_dumpable') do
326-
## those are not valid. how to?
327-
# its(:value) { should eq 0 or should eq 2 }
328-
# its(:value) { should match /[02]/ }
329-
# its(:value) { should match /0|2/ }
330-
its(:value) { should eq 2 }
326+
its(:value) { should cmp(/(0|2)/) }
331327
end
332-
# unless kernel_parameter('fs.suid_dumpable') == 2
333-
# describe kernel_parameter('fs.suid_dumpable') do
334-
# its(:value) { should eq 2 }
335-
# end
336328
describe kernel_parameter('kernel.core_pattern') do
337329
its(:value) { should match %r{^/.*} }
338330
end
339-
# end
340331
end
341332

342333
control 'sysctl-32' do

0 commit comments

Comments
 (0)