iron-settings 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 1.0.2 / 2013-12-16
2
+
3
+ * Tweak settings file security check in StaticStore to allow reading files if running as root
4
+
1
5
  == 1.0.1 / 2013-09-09
2
6
 
3
7
  * Clarify that <owner>.group.entry? returns true if any non-nil value is present, default or explicitly set
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -33,7 +33,7 @@ class Settings #:nodoc:
33
33
  Settings::DbStore.new(@settings_class_root, @settings_class_options)
34
34
  end
35
35
 
36
- # Force a settings reload (from db or file(s) depending on settings) regarless
36
+ # Force a settings reload (from db or file(s) depending on settings) regardless
37
37
  # of need to reload automatically. Useful for testing, but not generally needed in production use
38
38
  def reload_settings
39
39
  @settings_values.load
@@ -43,7 +43,6 @@ class Settings
43
43
  end
44
44
 
45
45
  # Loads a single settings file, verifying its existence, ownership/security, etc.
46
- #
47
46
  def load_file(path)
48
47
  # Ensure we have the file, if so required
49
48
  raise RuntimeError.new("Missing settings file #{path} - this file is required") unless @ignore_missing || File.exists?(path)
@@ -75,6 +74,10 @@ class Settings
75
74
  # Not requiring security? File doesn't exist? Then everything is fine...
76
75
  return unless (File.exists?(path) && @secure)
77
76
 
77
+ # Root can read all files, useful for backups and of course no security lost
78
+ return if Process.uid == 0
79
+
80
+ # Check file ownership
78
81
  stat = File::Stat.new(path)
79
82
  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?
80
83
  raise RuntimeError.new("Cannot load settings file #{path} - file cannot be world-writable") if stat.world_writable?
@@ -37,7 +37,7 @@ end
37
37
  RSpec.configure do |config|
38
38
  config.color = true
39
39
  config.add_formatter 'documentation'
40
- config.backtrace_clean_patterns = [/rspec/]
40
+ config.backtrace_exclusion_patterns = [/rspec/]
41
41
  end
42
42
 
43
43
  module SpecHelper
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-09 00:00:00.000000000 Z
12
+ date: 2013-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: iron-extensions