diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_m17n_comb.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index 79016afc07..6eec6a6bea 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -777,7 +777,17 @@ class TestM17NComb < Test::Unit::TestCase end def test_str_crypt + begin + # glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] #7312 + glibcver = `#{RbConfig::CONFIG["libdir"]}/libc.so.6`[/\AGNU C Library.*version ([0-9.]+)/, 1].split('.').map(&:to_i) + strict_crypt = (glibcver <=> [2, 16]) > -1 + rescue + end + combination(STRINGS, STRINGS) {|str, salt| + if strict_crypt + next unless salt.ascii_only? && /\A[0-9a-zA-Z.\/]+\z/ =~ salt + end if a(salt).length < 2 assert_raise(ArgumentError) { str.crypt(salt) } next |