lib/iron/settings/static_store.rb
# Implements :secure test for settings files.  Verifies that the specified file is:
#
# * Owned by the same user ID that is running the current process
# * Not world-writable
#
Implements :secure test for settings files.  Verifies that the specified file is:
Owned by the same user ID that is running the current process
Not world-writable
Implements : secure test for settings files . Verifies that the specified file is : Owned by the same user ID that is running the current process Not world - writable
def verify_file_security(path)
      return unless (File.exists?(path) && @secure)
      return if Process.uid == 0
      stat = File::Stat.new(path)
      raise RuntimeError.new("Cannot load settings file #{path} - file must be owned by the user this program is running as (UID #{Process.uid})") unless stat.owned?
      raise RuntimeError.new("Cannot load settings file #{path} - file cannot be world-writable") if stat.world_writable?
    end
def verify_file_security ( path ) return unless ( File . exists? ( path ) && @secure ) return if Process . uid == 0 stat = File :: Stat . new ( path ) raise RuntimeError . new ( "Cannot load settings file #{path} - file must be owned by the user this program is running as (UID #{Process.uid})" ) unless stat . owned? raise RuntimeError . new ( "Cannot load settings file #{path} - file cannot be world-writable" ) if stat . world_writable? end
Implements :secure test for settings files.
Implements : secure test for settings files .
# Not requiring security?  File doesn't exist?  Then everything is fine... # Root can read all files, useful for backups and of course no security lost # Check file ownership
path
<not_specific>