Public bug reported:

Binary package hint: casper

Ubuntu release: Oneiric Ocelot (LiveCD daily image from 2011-07-13).
Package: this is present in Casper 1.271.
What I expected to happen: valid entries in  /etc/resolv.conf.
What happened instead: all entries in /etc/resolv.conf have single quotes 
around the values, causing problems while installing some other packages.

More details about this problem:

In a testing environment, we do network installs using the daily Oneiric
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, as well as the IPV4DNS{0,1} entries for the DNS servers. It
ignores the rest of the values in the conf file. The ipconfig utility,
which generates /tmp/net-${DEVICE}.conf files based on DHCP information,
adds single quotes around the values. Files look like this:

(actual net-eth0.conf from an Oneiric install)

DEVICE='eth0'
IPV4ADDR='10.153.104.249'
IPV4BROADCAST='10.153.104.255'
IPV4NETMASK='255.255.255.0'
IPV4GATEWAY='10.153.104.1'
IPV4DNS0='10.153.104.60'
IPV4DNS1='0.0.0.0'
HOSTNAME=''
DNSDOMAIN='canonical.com'
NISDOMAIN=''
ROOTSERVER='10.153.104.60'
ROOTPATH=''
filename='/oneiric-desktop-i386/pxelinux.0'


23networking takes the values verbatim, including the quotes, and thus 
generates a resolv.conf that looks like this:

# /etc/resolv.conf
# Autogenerated by casper
search 'canonical.com'
domain 'canonical.com'
nameserver '10.153.104.60'
nameserver '0.0.0.0'

This 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.'domain.com' which are invalid and cause postfix
configuration to fail. Also, although an unlikely use case, trying to
access hosts by name with this invalid resolv.conf also fails.

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.

This bug is very similar in nature to bug 709364. Whereas the change in
ipconfig (from klibc) that caused that bug double-quoted DNSDOMAIN to
allow for multiple dns domains, this change to ipconfig single-quotes
all entries in the generated file, to prevent arbitrary code execution
from scripts which simply source the /tmp/net-${DEVICE}.conf file (not
the case with casper so it can safely strip the quotes). This change was
introduced in klibc in this commit:

commit 46a0f831582629612f0ff9707ad1292887f26bff
Author: Ulrich Dangel <u...@spamt.net>
Date:   Fri Apr 15 18:22:08 2011 +0200

** Affects: casper (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/809885

Title:
  Single-quoted entries are invalid in /etc/resolv.conf on network
  install with NetworkManager disabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/casper/+bug/809885/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to