summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-04 08:21:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-04 08:21:14 +0000
commit3047144ac275682e9c8b0645fe2afcbf952d9ee4 (patch)
tree2b20a46cf18ce19970a7095d39ae2dd54f65347e /ext
parentaa5ff4a43a5b91135ac723126478215f9ab1966a (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')
-rw-r--r--ext/win32/lib/win32/resolv.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/win32/lib/win32/resolv.rb b/ext/win32/lib/win32/resolv.rb
index 647f144..340a9b9 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