mirror of
https://github.com/inspec/inspec
synced 2024-11-22 20:53:11 +00:00
use FindFiles for postgres conf
Signed-off-by: Dominik Richter <dominik@vulcanosec.com>
This commit is contained in:
parent
c733a577da
commit
93065b9dda
2 changed files with 7 additions and 5 deletions
|
@ -63,7 +63,7 @@ class ApacheConf
|
|||
required = Array.new
|
||||
include_files.each do |f|
|
||||
id = File.join(@conf_dir, f)
|
||||
required.push(FindFiles.find(id))
|
||||
required.push(FindFiles.find(id, depth: 1, type: 'file'))
|
||||
end
|
||||
|
||||
required.flatten!
|
||||
|
@ -74,7 +74,7 @@ class ApacheConf
|
|||
optional = Array.new
|
||||
include_files_optional.each do |f|
|
||||
id = File.join(@conf_dir, f)
|
||||
optional.push(FindFiles.find(id))
|
||||
optional.push(FindFiles.find(id, depth: 1, type: 'file'))
|
||||
end
|
||||
|
||||
optional.flatten!
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# license: All rights reserved
|
||||
|
||||
require 'utils/simpleconfig'
|
||||
require 'utils/find_files'
|
||||
require 'resources/postgres'
|
||||
|
||||
class PostgresConf
|
||||
|
@ -45,9 +46,10 @@ class PostgresConf
|
|||
# see if there is more config files to include
|
||||
include_files = params['include'] || []
|
||||
include_files += params['include_if_exists'] || []
|
||||
(params['include_dir'] || []).each do |id|
|
||||
id = File.join(@conf_dir, id) if id[0] != '/'
|
||||
include_files += Dir.glob(File.join id, '*')
|
||||
dirs = params['include_dir'] || []
|
||||
dirs.each do |dir|
|
||||
dir = File.join(@conf_dir, dir) if dir[0] != '/'
|
||||
include_files += FindFiles.find(dir, depth: 1, type: 'file')
|
||||
end
|
||||
to_read += include_files.find_all do |fp|
|
||||
not @files_contents.key? fp
|
||||
|
|
Loading…
Reference in a new issue