Malformed 'search' entry in /etc/resolv.conf on network install
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
casper (Ubuntu) |
Fix Released
|
High
|
Stéphane Graber |
Bug Description
Package: casper 1.312, also this is present in lp:ubuntu/casper as of rev 1010.
Steps to reproduce:
- Do a netboot of the Ubuntu desktop CD on a network that hands out configuration via DHCP.
- Switch to a console once the installer has booted (ctrl-alt-f1)
- Look in /etc/resolv.conf.
What I expected to happen: valid entries in /etc/resolv.conf.
What happened instead: the search entry in /etc/resolv.conf has two values and a stray single-quote at the end, which looks wrong and may cause problems while installing some other packages.
More details about this problem:
In a testing environment, we do network installs using the daily and Precise milestone images. On these, due to a "manual" entry created by 23networking in /etc/interfaces, NetworkManager is disabled.
23networking parses the /tmp/net-
DEVICE='eth0'
IPV4ADDR=
IPV4BROADCAST=
IPV4NETMASK=
IPV4GATEWAY=
IPV4DNS0=
IPV4DNS1='0.0.0.0'
HOSTNAME=''
DNSDOMAIN=
NISDOMAIN=''
ROOTSERVER=
ROOTPATH=''
filename=
23networking tries to strip away the quotes using regexes, but doesn't do so correctly, and thus generates a file in /run/resolvconf
# /etc/resolv.conf
# Autogenerated by casper
search canonical.com
domain canonical.com'
nameserver 10.153.104.60
This is then processed by resolvconf (changes introduced in casper rev 990), and ends up generating a /etc/resolv.conf file that looks like this:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.153.104.60
search canonical.com canonical.com'
This bug is not usually apparent because most installations use NetworkManager, which invokes resolvconf with DHCP information, which it doesn't quote, unlike ipconfig.
This is similar to bugs 809885 and 709364, which generated invalid resolv.conf due to mishandling of the quotes around domain names. This new failure may have been exposed/triggered when Ubuntu started using resolvconf by default / on the Live CD environment.
A possible solution for this is to correctly strip away the single quotes by some means.
Bug 809885 has a patch based on a suggestion by Colin Watson, involving sourcing the /tmp/net-
Related branches
- Ubuntu branches: Pending requested
-
Diff: 48 lines (+13/-8)2 files modifieddebian/changelog (+6/-0)
scripts/casper-bottom/23networking (+7/-8)
Changed in casper (Ubuntu): | |
importance: | Undecided → High |
I'll have a look, the bug is pretty clear but completely changing the handling doesn't seem appropriate at this point. I'd rather we fix the sed call.