diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-08-26 15:13:49 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-08-26 15:13:49 +0000 |
commit | 7cdacb99ad17c859dc701843bd37d49412305716 (patch) | |
tree | 67c23dfa591deacc2ab840ba251c6805e7469645 | |
parent | 6e5e5df1bfd971687cb370c4f42226a5fc255dfc (diff) |
merge revision(s) 5bab1304af25a843728dbcd2f3594913740aecb0: [Backport #15847]
fix visibility of SecureRandom.gen_random
Aliasing a method preserves its visibility. These aliases turn
formerly-public methods into private. Should make them public
again. [Bug #15847]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/securerandom.rb | 2 | ||||
-rw-r--r-- | test/test_securerandom.rb | 7 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/securerandom.rb b/lib/securerandom.rb index 6d5520f605..e2632457ff 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -63,6 +63,7 @@ module SecureRandom class << self remove_method :gen_random alias gen_random gen_random_openssl + public :gen_random end end return gen_random(n) @@ -72,6 +73,7 @@ module SecureRandom class << self remove_method :gen_random alias gen_random gen_random_urandom + public :gen_random end end return gen_random(n) diff --git a/test/test_securerandom.rb b/test/test_securerandom.rb index 69d24c0417..1bc35f91f8 100644 --- a/test/test_securerandom.rb +++ b/test/test_securerandom.rb @@ -184,4 +184,11 @@ end assert_equal(idx, @it.send(:gen_random_openssl, idx).size) end end + + def test_repeated_gen_random + assert_nothing_raised NoMethodError, '[ruby-core:92633] [Bug #15847]' do + @it.gen_random(1) + @it.gen_random(1) + end + end end @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.5.6" #define RUBY_RELEASE_DATE "2019-08-27" -#define RUBY_PATCHLEVEL 180 +#define RUBY_PATCHLEVEL 181 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 8 |