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

ruby-changes:25565

From: naruse <ko1@a...>
Date: Sun, 11 Nov 2012 17:16:04 +0900 (JST)
Subject: [ruby-changes:25565] naruse:r37622 (trunk): glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] [Bug #7312]

naruse	2012-11-11 17:15:53 +0900 (Sun, 11 Nov 2012)

  New Revision: 37622

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

  Log:
    glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] [Bug #7312]

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

Index: test/ruby/test_m17n_comb.rb
===================================================================
--- test/ruby/test_m17n_comb.rb	(revision 37621)
+++ test/ruby/test_m17n_comb.rb	(revision 37622)
@@ -720,7 +720,17 @@
   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

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

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