mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
use freebsd file permission checks for solaris
This commit is contained in:
parent
2fd6aea357
commit
a5f526b368
1 changed files with 5 additions and 1 deletions
|
@ -110,7 +110,7 @@ module Inspec::Resources
|
|||
def check_file_permission_by_user(user, flag)
|
||||
if linux?
|
||||
perm_cmd = "su -s /bin/sh -c \"test -#{flag} #{path}\" #{user}"
|
||||
elsif family == 'freebsd'
|
||||
elsif family == 'freebsd' || solaris?
|
||||
perm_cmd = "sudo -u #{user} test -#{flag} #{path}"
|
||||
elsif family == 'aix'
|
||||
perm_cmd = "su #{user} -c test -#{flag} #{path}"
|
||||
|
@ -140,6 +140,10 @@ module Inspec::Resources
|
|||
inspec.os.linux?
|
||||
end
|
||||
|
||||
def solaris?
|
||||
inspec.os.solaris?
|
||||
end
|
||||
|
||||
def family
|
||||
inspec.os[:family]
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue