aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@users.noreply.github.com>2018-04-18 18:29:27 -0300
committerJose Luis Duran <jlduran@users.noreply.github.com>2018-04-19 08:44:08 -0300
commit4c6c3575c66ce10043c9ea04023788890a228de8 (patch)
tree01640e7a1e40ce32b0aa60314f241ec7e0f85bdf /railties/test/generators
parent185fce159721b331cc9a0ae17b662373ee0fc95f (diff)
downloadrails-4c6c3575c66ce10043c9ea04023788890a228de8.tar.gz
rails-4c6c3575c66ce10043c9ea04023788890a228de8.tar.bz2
rails-4c6c3575c66ce10043c9ea04023788890a228de8.zip
Make the master.key readable only by the owner
This change may only apply to POSIX-compliant systems. Previously: $ ls -l config/master.key -rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key Now: $ ls -l config/master.key -rw------- 1 owner group 32 Jan 1 00:00 master.key
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 294fdcd6a1..c3809a912b 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -941,6 +941,15 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_directory("test/system")
end
+ unless Gem.win_platform?
+ def test_master_key_is_only_readable_by_the_owner
+ run_generator
+
+ stat = File.stat("config/master.key")
+ assert_equal "100600", sprintf("%o", stat.mode)
+ end
+ end
+
private
def stub_rails_application(root)
Rails.application.config.root = root