diff --git a/lib/vulcano/backend/local.rb b/lib/vulcano/backend/local.rb index 56a972ee9..d766cb4e2 100644 --- a/lib/vulcano/backend/local.rb +++ b/lib/vulcano/backend/local.rb @@ -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