Sha256: 7e7d99b57862d619e131989a6361c0cd29d28f4c89f17ba680c138ea817c417d
Contents?: true
Size: 539 Bytes
Versions: 53
Compression:
Stored size: 539 Bytes
Contents
class Specinfra::Command::Linux::Base::File < Specinfra::Command::Base::File class << self def check_is_accessible_by_user(file, user, access) "sudo -u #{user} test -#{access} #{file}" end def check_is_immutable(file) check_attribute(file, 'i') end def check_attribute(file, attribute) "lsattr -d #{escape(file)} 2>&1 | " + "awk '$1~/^[A-Za-z-]+$/ && $1~/#{escape(attribute)}/ {exit 0} {exit 1}'" end def get_selinuxlabel(file) "stat -c %C #{escape(file)}" end end end
Version data entries
53 entries across 53 versions & 1 rubygems