Package: dhcp3-client
Version: 3.1.1-6+lenny4
Severity: minor
Tags: patch

Binary package hint: dhcp3-client

When /sbin/dhclient-script updates /etc/resolv.conf, it creates a temporary 
file /etc/resolv.conf.dhclient-new.

It's not a good idea to create temporary files in /etc, they should be created 
in /tmp instead.

/etc might be mounted read-only, and then /sbin/dhclient-script fails. Or /etc 
might be on a device you 
don't want unnecessary write access on (e.g. flash disk).

I have made a patch to fix the problem. Now it's possible to have /etc 
read-only if it contains 
resolv.conf as a symlink to some writeable filesystem.

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dhcp3-client depends on:
ii  debconf [debconf-2.0]     1.5.24         Debian configuration management sy
ii  debianutils               2.30           Miscellaneous utilities specific t
ii  dhcp3-common              3.1.1-6+lenny4 common files used by all the dhcp3
ii  libc6                     2.7-18lenny4   GNU C Library: Shared libraries

dhcp3-client recommends no packages.

Versions of packages dhcp3-client suggests:
pn  avahi-autoipd                 <none>     (no description available)
pn  resolvconf                    <none>     (no description available)

-- debconf information excluded
17,18c17
<         local new_resolv_conf=/etc/resolv.conf.dhclient-new
<         rm -f $new_resolv_conf
---
>         local new_resolv_conf=`mktemp`
46,48c45,46
<         chown --reference=/etc/resolv.conf $new_resolv_conf
<         chmod --reference=/etc/resolv.conf $new_resolv_conf
<         mv -f $new_resolv_conf /etc/resolv.conf
---
>       cat $new_resolv_conf >/etc/resolv.conf
>       rm -f $new_resolv_conf

Reply via email to