mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_m17n_comb.rb (test_str_crypt): Use Etc.confstr to
detect the glibc version. libc.so is not an executable on Debian GNU/kFreeBSD 7.0 (wheezy). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f4f71d6e6b
commit
778fd51482
2 changed files with 12 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sun May 18 16:42:08 2014 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* test/ruby/test_m17n_comb.rb (test_str_crypt): Use Etc.confstr to
|
||||||
|
detect the glibc version.
|
||||||
|
libc.so is not an executable on Debian GNU/kFreeBSD 7.0 (wheezy).
|
||||||
|
|
||||||
Sun May 18 12:15:54 2014 Jonathan Mukai-Heidt <johnnymukai@gmail.com>
|
Sun May 18 12:15:54 2014 Jonathan Mukai-Heidt <johnnymukai@gmail.com>
|
||||||
|
|
||||||
* io.c (argf_each_line, argf_inplace_mode_set): [DOC] Update ARGF
|
* io.c (argf_each_line, argf_inplace_mode_set): [DOC] Update ARGF
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
require 'etc'
|
||||||
require_relative 'allpairs'
|
require_relative 'allpairs'
|
||||||
|
|
||||||
class TestM17NComb < Test::Unit::TestCase
|
class TestM17NComb < Test::Unit::TestCase
|
||||||
|
@ -724,12 +725,11 @@ class TestM17NComb < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_str_crypt
|
def test_str_crypt
|
||||||
begin
|
strict_crypt = nil
|
||||||
# glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] #7312
|
# glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] #7312
|
||||||
glibcpath = `ldd #{RbConfig.ruby}`[/\S+\/libc.so\S+/]
|
if defined? Etc::Etc::CS_GNU_LIBC_VERSION
|
||||||
glibcver = `#{glibcpath}`[/\AGNU C Library.*version ([0-9.]+)/, 1].split('.').map(&:to_i)
|
glibcver = Etc.confstr(Etc::CS_GNU_LIBC_VERSION).scan(/\d+/).map(&:to_i)
|
||||||
strict_crypt = (glibcver <=> [2, 16]) > -1
|
strict_crypt = (glibcver <=> [2, 16]) >= 0
|
||||||
rescue
|
|
||||||
end
|
end
|
||||||
|
|
||||||
combination(STRINGS, STRINGS) {|str, salt|
|
combination(STRINGS, STRINGS) {|str, salt|
|
||||||
|
|
Loading…
Reference in a new issue