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/ (+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:

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.


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 trusty-security InRelease
Hit trusty-security Release.gpg
Ign trusty InRelease
Hit trusty-security Release
Ign trusty-updates InRelease
Hit trusty Release.gpg
Hit trusty-updates Release.gpg
Hit trusty Release
Hit trusty-updates Release
Hit trusty-security/main Sources
Hit trusty-security/universe Sources
Hit trusty-security/main amd64 Packages
Hit trusty-security/universe amd64 Packages
Hit trusty-security/main Translation-en
Hit trusty-security/universe Translation-en
Hit trusty/main Sources
Hit trusty/universe Sources
Hit trusty/main amd64 Packages
Hit trusty/universe amd64 Packages
Hit trusty/main Translation-en
Ign trusty-security/main Translation-en_US
Hit trusty/universe Translation-en
Ign trusty-security/universe Translation-en_US
Hit trusty-updates/main Sources
Hit trusty-updates/universe Sources
Hit trusty-updates/main amd64 Packages
Hit trusty-updates/universe amd64 Packages
Hit trusty-updates/main Translation-en
Hit trusty-updates/universe Translation-en
Ign trusty/main Translation-en_US
Ign trusty/universe Translation-en_US
Ign trusty-updates/main Translation-en_US
Ign 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']}};
14=== modified file 'src/provisioningserver/dhcp/tests/'
15--- src/provisioningserver/dhcp/tests/ 2014-04-01 13:28:39 +0000
16+++ src/provisioningserver/dhcp/tests/ 2014-04-11 03:23:27 +0000
17@@ -101,6 +101,15 @@
18 template.substitute(params),
19 config.get_config(**params))
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))
30 def test_get_config_with_too_few_parameters(self):
31 template = self.patch_template()
32 params = make_sample_params()