Invalid domain in /etc/resolv.conf on network install with NetworkManager disabled

Bug #709364 reported by Daniel Manrique
This bug affects 2 people
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
Fix Released
Canonical Foundations Team

Bug Description

Binary package hint: casper

Ubuntu release: Natty (LiveCD daily image from 2011-01-27).
Package: this is present in Casper 1.254.
What I expected to happen: a domain entry in /etc/resolv.conf without quotes.
What happened instead: /etc/resolv.conf has quotes in the domain entry, causing problems while installing some other packages.

More details about this problem:

In a testing environment, we do network installs using the daily Natty images. One particularity is that we disable NetworkManager by creating an interface entry in /etc/interfaces prior to booting. Thus, scripts/casper-bottom/23networking is the sole responsible for creation of /etc/resolv.conf.

23networking parses the /tmp/net-${DEVICE}.conf file and takes the DNSDOMAIN value to fill up both the domain and search entries in resolv.conf. The domain entry should contain only a single unquoted domain name. However, the ipconfig utility, which generates /tmp/net-${DEVICE}.conf files based on DHCP information, adds quotes around the value for DNSDOMAIN. 23networking takes this value verbatim, including the quotes, and thus generates a resolv.conf that gives problems later on: while installing postfix, it constructs the hostname by taking the domain name from resolv.conf, coming up with things like host."" which are invalid and cause postfix to fail.

This bug is not usually apparent because most installations use NetworkManager, which takes over resolv.conf, rebuilding it from DHCP information, which it doesn't quote, unlike ipconfig.

Tags: pcert

Related branches

Revision history for this message
Daniel Manrique (roadmr) wrote :

I've looked into this a bit more and found out that the quotes make the resolver misbehave, so they should be stripped, even for the search entry in /etc/resolv.conf.

The proposed fix sanitizes both the search entry, by removing the quotes, and the domain entry, by removing quotes and stripping all but the first domain - at least that's my interpretation of how it should be, from reading resolv.conf(5). I tested it with quoted and unquoted DNSDOMAIN values, and also with multiple domain entries and a single entry (which is the case for most networks).

Daniel Manrique (roadmr)
description: updated
Revision history for this message
Ara Pulido (ara) wrote :

Can you guys please have a look to this bug?

Changed in casper (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
importance: Undecided → High
status: New → Triaged
importance: High → Medium
Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks, Daniel! This looks fine and I'll merge it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package casper - 1.255

casper (1.255) natty; urgency=low

  [ Evan Dandrea ]
  * Don't disable the free space notifier if using persistent storage.

  [ Daniel Manrique ]
  * scripts/casper-bottom/23networking: Strip quotes from DNSDOMAIN as
    returned by ipconfig, and sanitize the domain entry to ensure the
    generated /etc/resolv.conf is formatted correctly (LP: #709364).
 -- Colin Watson <email address hidden> Tue, 01 Feb 2011 11:05:13 +0000

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

Duplicates of this bug

Other bug subscribers