diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-04 08:21:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-04 08:21:14 +0000 |
commit | baebdfa60108bf9f54db7c2920f205817fb32f06 (patch) | |
tree | 2b20a46cf18ce19970a7095d39ae2dd54f65347e /ext | |
parent | b1ccd936eb40729b1b6c851fac082226b5d38a0f (diff) | |
download | ruby-baebdfa60108bf9f54db7c2920f205817fb32f06.tar.gz |
win32/resolv.rb: ad hoc workaround
* ext/win32/lib/win32/resolv.rb (Win32::Resolv::SZ): an ad hoc
workaround for broken registry. SearchList and other registry
values must be REG_SZ, or Windows ignores anything in those
values otherwise. [ruby-dev:49924] [Bug #13081]
https://github.com/rubygems/rubygems/issues/1700
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/win32/lib/win32/resolv.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/win32/lib/win32/resolv.rb b/ext/win32/lib/win32/resolv.rb index 647f1446fc..340a9b9d2b 100644 --- a/ext/win32/lib/win32/resolv.rb +++ b/ext/win32/lib/win32/resolv.rb @@ -60,6 +60,21 @@ module Win32 # Windows NT #==================================================================== module Resolv + module SZ + refine Registry do + # ad hoc workaround for broken registry + def read_s(key) + type, str = read(key) + unless type == Registry::REG_SZ + warn "Broken registry, #{name}\\#{key} was #{Registry.type2name(type)}, ignored" + return String.new + end + str + end + end + end + using SZ + TCPIP_NT = 'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' class << self |