Bug 15046

Summary: /sbin/dhclient-script ignores resolv.conf hooks
Product: Base System Reporter: barry <barry>
Component: binAssignee: David E. O'Brien <obrien>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   

Description barry 1999-11-22 15:20:00 UTC
	/sbin/dhclient-script ignores the make_resolv_conf hooks during
	processing.

Here is the first instance from /sbin/dhclient-script:

	echo search $new_domain_name >/etc/resolv.conf
	for nameserver in $new_domain_name_servers; do
	  echo nameserver $nameserver >>/etc/resolv.conf
	done

And here is the second:

        echo search $new_domain_name >/etc/resolv.conf.std
        for nameserver in $new_domain_name_servers; do
	  echo nameserver $nameserver >>/etc/resolv.conf.std
        done
        if [ -f /etc/resolv.conf ]; then
	  rm -f /etc/resolv.conf
        fi
        mv /etc/resolv.conf.std /etc/resolv.conf

How-To-Repeat: 
	Run dhclient and see /etc/resolv.conf get overwritten even
	though there is a make_resolv_conf hook defined
Comment 1 mikko 1999-11-25 14:13:41 UTC
I ran into the same thing.  Fixed by:

--- /sbin/dhclient-script       Mon Nov 22 14:52:11 1999
+++ dhclient-script     Thu Nov 25 14:05:49 1999
@@ -129,10 +129,7 @@
     ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
     route add $alias_ip_address 127.0.0.1
   fi
-  echo search $new_domain_name >/etc/resolv.conf
-  for nameserver in $new_domain_name_servers; do
-    echo nameserver $nameserver >>/etc/resolv.conf
-  done
+  make_resolv_conf
   exit_with_hooks 0
 fi
 
@@ -190,14 +187,7 @@
        route add $0 $1
        shift; shift
       done
-      echo search $new_domain_name >/etc/resolv.conf.std
-      for nameserver in $new_domain_name_servers; do
-       echo nameserver $nameserver >>/etc/resolv.conf.std
-      done
-      if [ -f /etc/resolv.conf ]; then
-       rm -f /etc/resolv.conf
-      fi
-      mv /etc/resolv.conf.std /etc/resolv.conf
+      make_resolv_conf
       exit_with_hooks 0
     fi
   fi



 Mikko Tyo"la"ja"rvi_____________________________________mikko@rsasecurity.com
 RSA Security
Comment 2 patrick 1999-12-09 06:40:32 UTC
Hi,

The dhclient-script replacement submitted in PR bin/15342 fixes that
problem.

Patrick.

--
www.mindstep.com
Comment 3 David E. O'Brien freebsd_committer freebsd_triage 2000-07-14 06:52:06 UTC
Responsible Changed
From-To: freebsd-bugs->obrien

all the other DHCP ones are assigned to me.
Comment 4 David E. O'Brien freebsd_committer freebsd_triage 2000-11-10 17:21:38 UTC
State Changed
From-To: open->closed

A change simular to this was committed, but I forgot to close the PR.