misc/93940: [patch] dhclient-script writes in /etc which should be in /tmp

Nick Hibma nick at anywi.com
Tue Feb 28 05:30:04 PST 2006


>Number:         93940
>Category:       misc
>Synopsis:       [patch] dhclient-script writes in /etc which should be in /tmp
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 28 13:30:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Nick Hibma
>Release:        6-RELEASE (I think, but userland might be 5.x)
>Organization:
AnyWi Technologies
>Environment:
FreeBSD hind.van-laarhoven.org 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov  3 09:36:13 UTC 2005     root at x64.samsco.home:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
dhclient-script writes into /etc/resolve.conf.std instead of in /tmp. If you mount the root partition read-only on a soekris (embedded system) you cannot do this and the script will (silently) fail and not set resolv.conf at all.


>How-To-Repeat:

>Fix:
This patch is in use.

% diff /sbin/dhclient-script /sbin/dhclient-script~
137c137
<       rm -f /tmp/resolv.conf.std
---
>       rm -f /etc/resolv.conf.std
140c140
<               echo "search $new_domain_name" >>/tmp/resolv.conf.std
---
>               echo "search $new_domain_name" >>/etc/resolv.conf.std
145c145
<                       echo "nameserver $nameserver" >>/tmp/resolv.conf.std
---
>                       echo "nameserver $nameserver" >>/etc/resolv.conf.std
149,151c149,151
<       if [ -f /tmp/resolv.conf.std ]; then
<               if [ -f /tmp/resolv.conf.tail ]; then
<                       cat /tmp/resolv.conf.tail >>/tmp/resolv.conf.std
---
>       if [ -f /etc/resolv.conf.std ]; then
>               if [ -f /etc/resolv.conf.tail ]; then
>                       cat /etc/resolv.conf.tail >>/etc/resolv.conf.std
159,160c159,160
<               if cmp -s /tmp/resolv.conf.std /etc/resolv.conf; then
<                       rm -f /tmp/resolv.conf.std
---
>               if cmp -s /etc/resolv.conf.std /etc/resolv.conf; then
>                       rm -f /etc/resolv.conf.std
171,172c171,172
<               cat /tmp/resolv.conf.std > /etc/resolv.conf
<               rm -f /tmp/resolv.conf.std
---
>               cat /etc/resolv.conf.std > /etc/resolv.conf
>               rm -f /etc/resolv.conf.std

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list