mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +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)
|
def check_file_permission_by_user(user, flag)
|
||||||
if linux?
|
if linux?
|
||||||
perm_cmd = "su -s /bin/sh -c \"test -#{flag} #{path}\" #{user}"
|
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}"
|
perm_cmd = "sudo -u #{user} test -#{flag} #{path}"
|
||||||
elsif family == 'aix'
|
elsif family == 'aix'
|
||||||
perm_cmd = "su #{user} -c test -#{flag} #{path}"
|
perm_cmd = "su #{user} -c test -#{flag} #{path}"
|
||||||
|
@ -140,6 +140,10 @@ module Inspec::Resources
|
||||||
inspec.os.linux?
|
inspec.os.linux?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def solaris?
|
||||||
|
inspec.os.solaris?
|
||||||
|
end
|
||||||
|
|
||||||
def family
|
def family
|
||||||
inspec.os[:family]
|
inspec.os[:family]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue