pull in selinux label on local backend runner

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-16 02:10:06 +02:00
parent b13a1b574d
commit d16f76c9ce

View file

@ -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