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

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 2257
Proposed branch: lp:~jtv/maas/bug-1306335
Merge into: lp:~maas-committers/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) Approve
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.
Revision history for this message
Julian Edwards (julian-edwards) :
review: Approve
Revision history for this message
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...

Revision history for this message
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
=== modified file 'etc/maas/templates/dhcp/dhcpd.conf.template'
--- etc/maas/templates/dhcp/dhcpd.conf.template 2014-03-21 19:01:40 +0000
+++ etc/maas/templates/dhcp/dhcpd.conf.template 2014-04-11 03:23:27 +0000
@@ -9,7 +9,7 @@
9{{for dhcp_subnet in dhcp_subnets}}9{{for dhcp_subnet in dhcp_subnets}}
10subnet {{dhcp_subnet['subnet']}} netmask {{dhcp_subnet['subnet_mask']}} {10subnet {{dhcp_subnet['subnet']}} netmask {{dhcp_subnet['subnet_mask']}} {
11 {{bootloader}}11 {{bootloader}}
12 interface {{dhcp_subnet['interface']}};12 interface "{{dhcp_subnet['interface']}}";
13 ignore-client-uids true;13 ignore-client-uids true;
14 option subnet-mask {{dhcp_subnet['subnet_mask']}};14 option subnet-mask {{dhcp_subnet['subnet_mask']}};
15 option broadcast-address {{dhcp_subnet['broadcast_ip']}};15 option broadcast-address {{dhcp_subnet['broadcast_ip']}};
1616
=== modified file 'src/provisioningserver/dhcp/tests/test_config.py'
--- src/provisioningserver/dhcp/tests/test_config.py 2014-04-01 13:28:39 +0000
+++ src/provisioningserver/dhcp/tests/test_config.py 2014-04-11 03:23:27 +0000
@@ -101,6 +101,15 @@
101 template.substitute(params),101 template.substitute(params),
102 config.get_config(**params))102 config.get_config(**params))
103103
104 def test_quotes_interface(self):
105 # The interface name doesn't normally need to be quoted, but the
106 # template does quote it, in case it contains dots or other weird
107 # but legal characters (bug 1306335).
108 params = make_sample_params()
109 self.assertIn(
110 'interface "%s";' % params['dhcp_subnets'][0]['interface'],
111 config.get_config(**params))
112
104 def test_get_config_with_too_few_parameters(self):113 def test_get_config_with_too_few_parameters(self):
105 template = self.patch_template()114 template = self.patch_template()
106 params = make_sample_params()115 params = make_sample_params()