Merge lp:~jtv/maas/bug-1306335 into lp:maas/trunk

Proposed by Jeroen T. Vermeulen on 2014-04-11
Status: Merged
Approved by: Jeroen T. Vermeulen on 2014-04-11
Approved revision: 2255
Merged at revision: 2257
Proposed branch: lp:~jtv/maas/bug-1306335
Merge into: lp:maas/trunk
Diff against target: 32 lines (+10/-1)
2 files modified
etc/maas/templates/dhcp/dhcpd.conf.template (+1/-1)
src/provisioningserver/dhcp/tests/test_config.py (+9/-0)
To merge this branch: bzr merge lp:~jtv/maas/bug-1306335
Reviewer Review Type Date Requested Status
Julian Edwards (community) 2014-04-11 Approve on 2014-04-11
Review via email: mp+215338@code.launchpad.net

Commit message

Quote interface name in dhcpd.conf; required when the interface name contains dots (or perhaps other strange characters).

Description of the change

The unquoted version is treacherously accepted without complaints for “normal” names. To install, we can only assume, a false sense of security.

Jeroen

To post a comment you must log in.
review: Approve
MAAS Lander (maas-lander) wrote :
Download full text (28.2 KiB)

The attempt to merge lp:~jtv/maas/bug-1306335 into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security Release.gpg
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Hit http://security.ubuntu.com trusty-security Release
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Hit http://nova.clouds.archive.ubuntu.com trusty-updates Release
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Ign http://security.ubuntu.com trusty-security/main Translation-en_US
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Ign http://security.ubuntu.com trusty-security/universe Translation-en_US
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en_US
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make postgresql python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-formencode python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-netaddr python-netifaces python-oauth python-oops python-oops-amqp python-oops-datedir-repo python-oops-twisted python-oops-wsgi python-pip p...

Jeroen T. Vermeulen (jtv) wrote :

That failure looks like an unlucky choice of port for rabbit. Trying again.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'etc/maas/templates/dhcp/dhcpd.conf.template'
2--- etc/maas/templates/dhcp/dhcpd.conf.template 2014-03-21 19:01:40 +0000
3+++ etc/maas/templates/dhcp/dhcpd.conf.template 2014-04-11 03:23:27 +0000
4@@ -9,7 +9,7 @@
5 {{for dhcp_subnet in dhcp_subnets}}
6 subnet {{dhcp_subnet['subnet']}} netmask {{dhcp_subnet['subnet_mask']}} {
7 {{bootloader}}
8- interface {{dhcp_subnet['interface']}};
9+ interface "{{dhcp_subnet['interface']}}";
10 ignore-client-uids true;
11 option subnet-mask {{dhcp_subnet['subnet_mask']}};
12 option broadcast-address {{dhcp_subnet['broadcast_ip']}};
13
14=== modified file 'src/provisioningserver/dhcp/tests/test_config.py'
15--- src/provisioningserver/dhcp/tests/test_config.py 2014-04-01 13:28:39 +0000
16+++ src/provisioningserver/dhcp/tests/test_config.py 2014-04-11 03:23:27 +0000
17@@ -101,6 +101,15 @@
18 template.substitute(params),
19 config.get_config(**params))
20
21+ def test_quotes_interface(self):
22+ # The interface name doesn't normally need to be quoted, but the
23+ # template does quote it, in case it contains dots or other weird
24+ # but legal characters (bug 1306335).
25+ params = make_sample_params()
26+ self.assertIn(
27+ 'interface "%s";' % params['dhcp_subnets'][0]['interface'],
28+ config.get_config(**params))
29+
30 def test_get_config_with_too_few_parameters(self):
31 template = self.patch_template()
32 params = make_sample_params()