Merge "Remove dhcp_extra_opt value after first newline character" into stable/rocky
This commit is contained in:
commit
b33df61e00
|
@ -1155,10 +1155,11 @@ class Dnsmasq(DhcpLocalProcess):
|
|||
else:
|
||||
option = 'option6:%s' % option
|
||||
if extra_tag:
|
||||
tags = ('tag:' + tag, extra_tag[:-1], '%s' % option)
|
||||
tags = ['tag:' + tag, extra_tag[:-1], '%s' % option]
|
||||
else:
|
||||
tags = ('tag:' + tag, '%s' % option)
|
||||
return ','.join(tags + args)
|
||||
tags = ['tag:' + tag, '%s' % option]
|
||||
|
||||
return ','.join(tags + [v.split("\n", 1)[0] for v in args])
|
||||
|
||||
@staticmethod
|
||||
def _convert_to_literal_addrs(ip_version, ips):
|
||||
|
|
|
@ -225,6 +225,9 @@ class FakeV6PortExtraOpt(object):
|
|||
self.extra_dhcp_opts = [
|
||||
DhcpOpt(opt_name='dns-server',
|
||||
opt_value='ffea:3ba5:a17a:4ba3::100',
|
||||
ip_version=6),
|
||||
DhcpOpt(opt_name='malicious-option',
|
||||
opt_value='aaa\nbbb.ccc\n',
|
||||
ip_version=6)]
|
||||
|
||||
|
||||
|
@ -2715,7 +2718,9 @@ class TestDnsmasq(TestBase):
|
|||
exp_opt_data = ('tag:subnet-eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee,'
|
||||
'option6:domain-search,openstacklocal\n'
|
||||
'tag:port-hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh,'
|
||||
'option6:dns-server,ffea:3ba5:a17a:4ba3::100').lstrip()
|
||||
'option6:dns-server,ffea:3ba5:a17a:4ba3::100\n'
|
||||
'tag:port-hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh,'
|
||||
'option6:malicious-option,aaa').lstrip()
|
||||
dm = self._get_dnsmasq(FakeV6NetworkStatelessDHCP())
|
||||
dm._output_hosts_file()
|
||||
dm._output_opts_file()
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
security:
|
||||
- |
|
||||
Fix `bug 1939733 <https://bugs.launchpad.net/neutron/+bug/1939733>`_ by
|
||||
dropping from the dhcp extra option values everything what is after first
|
||||
newline (``\n``) character before passing them to the dnsmasq.
|
Loading…
Reference in New Issue