Subject: bin/7715: dhclient-script modify request
To: None <gnats-bugs@gnats.netbsd.org>
From: None <seirios@matrix.iri.co.jp>
List: netbsd-bugs
Date: 06/05/1999 19:21:04
>Number:         7715
>Category:       bin
>Synopsis:       dhclient always make resolv.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jun  5 19:20:00 1999
>Last-Modified:
>Originator:     HEO SeonMeyong
>Organization:
>Release:        NetBSD-current 1999-06-06
>Environment:
System: NetBSD laysner.grid.iri.co.jp 1.4C NetBSD 1.4C (LAYSNER) #2: Sun Jun 6 03:34:19 JST 1999 seirios@laysner.grid.iri.co.jp:/usr/src/sys/arch/i386/compile/LAYSNER i386

>Description:
	dhclient always make resolv.conf in any situation.
	dhcp server *may* announce resolver information, then some server not announce
	resolver information.
	If resolver information is none, then not change resolv.conf.
>How-To-Repeat:
	use dhclient w/ /etc/dhclient-script.
>Fix:
	attach this patch file.
----- cut here -----

--- dhclient-script	1999/06/06 01:28:11	1.3
+++ dhclient-script	1999/06/06 01:34:24	1.4
@@ -3,10 +3,14 @@
 # $NetBSD: netbsd,v 1.8 1999/06/04 20:40:50 thorpej Exp $
 
 make_resolv_conf() {
-  echo search $new_domain_name >/etc/resolv.conf
-  for nameserver in $new_domain_name_servers; do
-    echo nameserver $nameserver >>/etc/resolv.conf
-  done
+  if [ x$new_domain_name != x ]; then
+    echo search $new_domain_name >/etc/resolv.conf
+  fi
+  if [ x$new_domain_name_servers != x ]; then
+    for nameserver in $new_domain_name_servers; do
+      echo nameserver $nameserver >>/etc/resolv.conf
+    done
+  fi
 }
 
 # Must be used on exit.   Invokes the local dhcp client exit hooks, if any.
>Audit-Trail:
>Unformatted: