From: Sam Roberts Date: 2005-01-19T13:39:09+09:00 Subject: Re: bug -- resolv.rb dies when "domain" in resolv.conf has no arg Quoteing akr@m17n.org, on Wed, Jan 19, 2005 at 01:29:57AM +0900: > In article <20050117002220.GA1001@ensemble.local>, > Sam Roberts writes: > > > [ensemble] ~/p/ruby/zeroconf $ ruby18 -rresolv -rpp -e '(r=Resolv::DNS::Config.new("./domain.conf")).lazy_initialize; pp r' > > /usr/local/lib/ruby/1.8/resolv.rb:921:in `split': private method `scan' called for nil:NilClass (NoMethodError) > > from /usr/local/lib/ruby/1.8/resolv.rb:788:in `lazy_initialize' > > from /usr/local/lib/ruby/1.8/resolv.rb:788:in `map' > > from /usr/local/lib/ruby/1.8/resolv.rb:788:in `lazy_initialize' > > from /usr/local/lib/ruby/1.8/resolv.rb:761:in `synchronize' > > from /usr/local/lib/ruby/1.8/resolv.rb:761:in `lazy_initialize' > > from -e:1 > > Thank you for the report. Thank you for the fix! > > Note that search (before) and domain (now, instead of dieing) with no > > arguments both surpress the automagical choice of a search path based on > > Socket.hostname. I believe this to be the correct behaviour, because it > > seems reasonable to want to surpress the lookup (as a config option), > > and because this is how the OS X C library resolver behaves. > > bind-9.3.0/lib/bind/resolv/res_init.c seems to ignore domain and > search directive with no arguments. So I modified resolv.rb to ignore > them. This may be incompatible with OS X C library resolver, though. That's OK, it can't be compatible with everybody's resolver libraries, so being compatible with bind9 seems very reasonable. Sam