Skip to content

Commit ffa3269

Browse files
authored
Fixes (#207)
* require Ruby > 2.7.0 * Use Timeout::Error not TimeoutError for ResolvTimeout * untaint * remove untaint calls and timeout::Error * Up oldest supported Ruby to 2.8.0 * Fix Timeout::Error
1 parent 5ede48c commit ffa3269

3 files changed

Lines changed: 4 additions & 13 deletions

File tree

dnsruby.gemspec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ SPEC = Gem::Specification.new do |s|
1515
stub resolver. It aims to comply with all DNS RFCs, including
1616
DNSSEC NSEC3 support.'
1717
s.license = "Apache License, Version 2.0"
18-
18+
19+
# Add explicit Ruby version requirement
20+
s.required_ruby_version = '>= 2.8.0'
21+
1922
s.files = `git ls-files -z`.split("\x0")
2023

2124
s.post_install_message = \

lib/dnsruby/config.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,6 @@ def Config.parse_resolv_conf(filename) #:nodoc: all
318318
f.each {|line|
319319
line.sub!(/[#;].*/, '')
320320
keyword, *args = line.split(/\s+/)
321-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.8")
322-
args.each { |arg|
323-
arg.untaint
324-
}
325-
end
326321
next unless keyword
327322
case keyword
328323
when 'port'

lib/dnsruby/hosts.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,12 @@ def lazy_initialize# :nodoc:
5757
line.sub!(/#.*/, '')
5858
addr, hostname, *aliases = line.split(/\s+/)
5959
next unless addr
60-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.8")
61-
addr.untaint
62-
hostname.untaint
63-
end
6460
@addr2name[addr] = [] unless @addr2name.include? addr
6561
@addr2name[addr] << hostname
6662
@addr2name[addr] += aliases
6763
@name2addr[hostname] = [] unless @name2addr.include? hostname
6864
@name2addr[hostname] << addr
6965
aliases.each {|n|
70-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.8")
71-
n.untaint
72-
end
7366
@name2addr[n] = [] unless @name2addr.include? n
7467
@name2addr[n] << addr
7568
}

0 commit comments

Comments
 (0)