[前][次][番号順一覧][スレッド一覧]

ruby-changes:25709

From: naruse <ko1@a...>
Date: Tue, 20 Nov 2012 22:09:24 +0900 (JST)
Subject: [ruby-changes:25709] naruse:r37766 (trunk): fix guards for glibc crypt(3) see #7312

naruse	2012-11-20 22:09:15 +0900 (Tue, 20 Nov 2012)

  New Revision: 37766

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37766

  Log:
    fix guards for glibc crypt(3) see #7312

  Modified files:
    trunk/test/ruby/test_m17n_comb.rb

Index: test/ruby/test_m17n_comb.rb
===================================================================
--- test/ruby/test_m17n_comb.rb	(revision 37765)
+++ test/ruby/test_m17n_comb.rb	(revision 37766)
@@ -722,14 +722,14 @@
   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('.')
+      glibcver = `/lib/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 /\A[0-9a-zA-Z.\/]+\z/ =~ salt
+        next unless salt.ascii_only? && /\A[0-9a-zA-Z.\/]+\z/ =~ salt
       end
       if a(salt).length < 2
         assert_raise(ArgumentError) { str.crypt(salt) }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]