DHCP client should not create temporary files in /etc

Bug #251632 reported by Mikael Ståldal
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DHCP
Fix Released
Unknown
dhcp3 (Debian)
Fix Released
Unknown
dhcp3 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

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 (e.g. /tmp/resolv.conf).

1)
Description: Ubuntu 8.04.1
Release: 8.04

2)
dhcp3-client 3.0.6.dfsg-1ubuntu9

Revision history for this message
Mikael Ståldal (mikaelstaldal) wrote :
nfm (nfm)
Changed in dhcp3 (Ubuntu):
status: New → Confirmed
Revision history for this message
nfm (nfm) wrote :

/etc/resolv.conf should symlink to somewhere in /var/ for persistence, such as /var/lib/dhcp3/resolv.conf.

Temporary files used by /sbin/dhclient-script should be created using mktemp.

Revision history for this message
Mikael Ståldal (mikaelstaldal) wrote :

OK, I have made a new patch according to what nfm says, for the new version of dhclient-script in 9.10.

Could someone please apply this now, so I don't have to do this again for 10.04?

Revision history for this message
Mikael Ståldal (mikaelstaldal) wrote :
Revision history for this message
Mathias Gug (mathiaz) wrote :

I'd suggest to forward this patch to the Debian maintainer in order to get it included in Debian as well.

tags: added: patch patch-forwarded-debian
Revision history for this message
Mathias Gug (mathiaz) wrote :

The issue you are reporting is an upstream one and it would be nice if somebody having it could send the bug to the developers of the software by following the instructions at https://wiki.ubuntu.com/Bugs/Upstream/Debian.

If you have done so, please tell us the number of the upstream bug (or the link), so we can add a bugwatch that will inform us about its status. Thanks in advance.

Revision history for this message
Mikael Ståldal (mikaelstaldal) wrote :

I have now reported this to Debian, and it got #587955 there.

Changed in dhcp:
status: Unknown → New
Changed in dhcp3 (Debian):
importance: Undecided → Unknown
status: New → Unknown
Changed in dhcp3 (Debian):
status: Unknown → New
Revision history for this message
Rob van der Linde (robvdl) wrote :

I noticed that this is fixed in Ubuntu 12.04, /etc/resolv.conf is now a symlink to /run/resolvconf/resolv.conf and /run is mounted as tmpfs so it now works if /etc is mounted as readonly.

Maybe this bug can be closed now?

Revision history for this message
Mikael Ståldal (mikaelstaldal) wrote :

The bug is not actually fixed, it is only worked around by installing the "resolvconf" package by default. If you uninstall the "resolvconf" package, the bug will reappear.

However, the buggy package is now "isc-dhcp-client".

Changed in dhcp:
status: New → Fix Released
Changed in dhcp3 (Debian):
status: New → Fix Released
Revision history for this message
Robie Basak (racb) wrote :

> The bug is not actually fixed, it is only worked around by installing the "resolvconf" package by default.

Debian consider this bug fixed, and this issue originates from Debian. So there is no action to take in Ubuntu unless someone wants to take it up in Debian by re-opening the bug there or filing a new bug there as appropriate.

I'm going to mark this Fix Released in dhcp3 (Ubuntu) to represent that we consider it resolved by installing resolvconf, so as not to mislead others into thinking that there is outstanding work to be done in Ubuntu here. If you want to get this addressed further, then please take action to have this addressed in Debian and then we can mirror their bug status for Ubuntu instead. Otherwise, we'll follow Debian and consider this bug fixed.

Changed in dhcp3 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.