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 | 3047144ac275682e9c8b0645fe2afcbf952d9ee4 (patch) | |
tree | 2b20a46cf18ce19970a7095d39ae2dd54f65347e /ext/win32/lib | |
parent | aa5ff4a43a5b91135ac723126478215f9ab1966a (diff) |
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/win32/lib')
-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 |