aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-11 08:15:53 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-11 08:15:53 +0000
commit64757d284aad769dc16229881822bbbb3a0d7751 (patch)
tree0c8ce316bea5e334debdd311dab176c343a3952a /test
parent5051186a0b1ca74a3fbd82714f93333995ea471e (diff)
downloadruby-64757d284aad769dc16229881822bbbb3a0d7751.tar.gz
glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] [Bug #7312]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_m17n_comb.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb
index d7d3437e08..b275d78356 100644
--- a/test/ruby/test_m17n_comb.rb
+++ b/test/ruby/test_m17n_comb.rb
@@ -720,7 +720,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 = `/lib/libc.so.6`[/\AGNU C Library.*version ([0-9.]+)/, 1].split('.')
+ strict_crypt = (glibcver <=> [2, 16]) > -1
+ rescue
+ end
+
combination(STRINGS, STRINGS) {|str, salt|
+ if strict_crypt
+ next unless /\A[0-9a-zA-Z.\/]+\z/ =~ salt
+ end
if a(salt).length < 2
assert_raise(ArgumentError) { str.crypt(salt) }
next