mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
pull in selinux label on local backend runner
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
b13a1b574d
commit
d16f76c9ce
1 changed files with 6 additions and 1 deletions
|
@ -80,7 +80,7 @@ module Vulcano::Backends
|
|||
|
||||
begin
|
||||
file_stat = ::File.lstat(@path)
|
||||
rescue StandardError => err
|
||||
rescue StandardError => _err
|
||||
return @stat = {}
|
||||
end
|
||||
|
||||
|
@ -109,6 +109,11 @@ module Vulcano::Backends
|
|||
@stat[:group] = nil
|
||||
end
|
||||
|
||||
res = @backend.run_command("stat #{@spath} 2>/dev/null --printf '%C'")
|
||||
if res.exit_status == 0 && !res.stdout.empty? && res.stdout != '?'
|
||||
@stat[:selinux_label] = res.stdout.strip
|
||||
end
|
||||
|
||||
@stat
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue