mirror of
https://github.com/inspec/inspec
synced 2024-11-26 22:50:36 +00:00
port: Correctly detect FreeBSD (#3579)
* Fixing #3563; freebsd is not a substring of 'bsd' * Actually, this is better. * Change coditional for FreeBSD from a string match to a call to os.bsd? Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
9d4510451e
commit
b12aa82361
1 changed files with 3 additions and 1 deletions
|
@ -63,10 +63,12 @@ module Inspec::Resources
|
||||||
AixPorts.new(inspec)
|
AixPorts.new(inspec)
|
||||||
elsif os.darwin?
|
elsif os.darwin?
|
||||||
# Darwin: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/lsof.8.html
|
# Darwin: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/lsof.8.html
|
||||||
|
# Careful: make sure darwin comes before BSD, below
|
||||||
LsofPorts.new(inspec)
|
LsofPorts.new(inspec)
|
||||||
elsif os.windows?
|
elsif os.windows?
|
||||||
WindowsPorts.new(inspec)
|
WindowsPorts.new(inspec)
|
||||||
elsif ['freebsd'].include?(os[:family])
|
elsif os.bsd?
|
||||||
|
# Relies on sockstat, usually present on FreeBSD and NetBSD (but not MacOS X)
|
||||||
FreeBsdPorts.new(inspec)
|
FreeBsdPorts.new(inspec)
|
||||||
elsif os.solaris?
|
elsif os.solaris?
|
||||||
SolarisPorts.new(inspec)
|
SolarisPorts.new(inspec)
|
||||||
|
|
Loading…
Reference in a new issue