Bug #13081
closedresolv.rb may be the cause of the rubygems bug on Windows
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
Seems the registry is broken.
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
s/repository/registry/
Updated by kou (Kouhei Sutou) almost 10 years ago
How about ignoring the registry value if its type is not expected type?
Index: resolv.rb
===================================================================
--- resolv.rb (revision 57233)
+++ resolv.rb (working copy)
@@ -75,8 +75,10 @@
nameserver = get_dns_server_list
Registry::HKEY_LOCAL_MACHINE.open(TCPIP_NT) do |reg|
begin
- slist = reg.read_s('SearchList')
- search = slist.split(/,\s*/) unless slist.empty?
+ type, slist = reg.read('SearchList')
+ if type == Registory::REG_SZ
+ search = slist.split(/,\s*/) unless slist.empty?
+ end
rescue Registry::Error
end
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
Yes, Windows seems to ignore the value when it is not REG_SZ, too.
But I wonder if it is desirable to ignore such broken registry silently.
Updated by usa (Usaku NAKAMURA) over 9 years ago
I think that to warn and ignore is nice.
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
- Status changed from Open to Closed
Applied in changeset r57265.
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
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
All registry read operations should warn and return an empty string, instead of TypeError?
Updated by usa (Usaku NAKAMURA) over 9 years ago
Of course, only for this case.
We can not assume the use case of a registry value generally, as you know.
Updated by kozo2 (Kozo Nishida) over 9 years ago
Nobuyoshi Nakada wrote:
Applied in changeset r57265.
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
How can I reflect this update to our local Ruby+Windows environment?
(of course this fails.)
Updated by usa (Usaku NAKAMURA) over 9 years ago
- Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED
Updated by usa (Usaku NAKAMURA) over 9 years ago
- Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: DONE, 2.3: REQUIRED, 2.4: REQUIRED
ruby_2_2 r58119 merged revision(s) 57265,57266.
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Backport changed from 2.2: DONE, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: DONE, 2.3: DONE, 2.4: REQUIRED
ruby_2_3 r58172 merged revision(s) 57265,57266.
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Backport changed from 2.2: DONE, 2.3: DONE, 2.4: REQUIRED to 2.2: DONE, 2.3: DONE, 2.4: DONE
ruby_2_4 r58630 merged revision(s) 57265,57266.