mirror of
https://github.com/inspec/inspec
synced 2024-11-22 20:53:11 +00:00
configurable limits_conf path
Signed-off-by: Dominik Richter <dominik@vulcanosec.com>
This commit is contained in:
parent
70a6130335
commit
1344fba629
2 changed files with 10 additions and 6 deletions
|
@ -6,9 +6,9 @@ require 'utils/simpleconfig'
|
|||
|
||||
class LimitsConf < Vulcano::Resource
|
||||
|
||||
def initialize
|
||||
def initialize path
|
||||
@runner = Specinfra::Runner
|
||||
@conf_path = '/etc/security/limits.conf'
|
||||
@conf_path = path
|
||||
@files_contents = {}
|
||||
@content = nil
|
||||
@params = nil
|
||||
|
@ -46,3 +46,11 @@ class LimitsConf < Vulcano::Resource
|
|||
@files_contents[path] ||= @runner.get_file_content(path).stdout
|
||||
end
|
||||
end
|
||||
|
||||
module Serverspec::Type
|
||||
def limits_conf(path = nil)
|
||||
@limits_conf ||= {}
|
||||
dpath = path || '/etc/security/limits.conf'
|
||||
@limits_conf[dpath] ||= LimitsConf.new(dpath)
|
||||
end
|
||||
end
|
|
@ -62,10 +62,6 @@ module Serverspec
|
|||
InetdConf.new()
|
||||
end
|
||||
|
||||
def limits_conf()
|
||||
LimitsConf.new()
|
||||
end
|
||||
|
||||
def login_def()
|
||||
LoginDef.new()
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue