Project

General

Profile

Actions

Bug #14369

closed

Win32::Resolv.get_hosts_path may return nil, causing Resolv to fail

Added by docwhat (Christian Höltje) almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:84907]

Description

Win32::Resolv.get_hosts_path() may return nil.

The Resolv class uses that to get the hosts filename which is used as the default when initializing Hosts as @filename.

However, File.open(@filename, 'rb') is always called, even if @filename is nil.

This causes the error: TypeError: no implicit conversion of nil into String

Updated by nobu (Nobuyoshi Nakada) almost 7 years ago

What configuration causes it?
No TCP/IP stack?

Actions #3

Updated by nobu (Nobuyoshi Nakada) almost 7 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r61898.


resolv.rb: NUL hosts

  • lib/resolv.rb (Resolv::Hosts::DefaultFileName): fallback to NUL
    device when Win32::Resolv.get_hosts_path() returned nil, to get
    rid of TypeError in lazy_initialize.
    [ruby-core:84907] [Bug #14369] [Fix GH-1791]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0