mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
DHCPDv4: hostname validation should include domain. closes https://github.com/opnsense/core/issues/4544
This commit is contained in:
parent
e686331888
commit
51c04e7abf
@ -125,11 +125,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
}
|
||||
|
||||
/* check for overlaps */
|
||||
if (!empty($pconfig['domain'])) {
|
||||
$this_fqdn = $pconfig['hostname'] . "." . $pconfig['domain'];
|
||||
} else {
|
||||
$this_fqdn = $pconfig['hostname'] . "." . $config['system']['domain'];
|
||||
}
|
||||
foreach ($a_maps as $mapent) {
|
||||
if (isset($id) && ($a_maps[$id] === $mapent)) {
|
||||
continue;
|
||||
}
|
||||
if ((($mapent['hostname'] == $pconfig['hostname']) && $mapent['hostname']) ||
|
||||
if (empty($mapent['hostname'])) {
|
||||
$fqdn = "";
|
||||
} elseif (!empty($mapent['domain'])) {
|
||||
$fqdn = $mapent['hostname'] . "." . $mapent['domain'];
|
||||
} else {
|
||||
$fqdn = $mapent['hostname'] . "." . $config['system']['domain'];
|
||||
}
|
||||
|
||||
if (($fqdn == $this_fqdn) ||
|
||||
(($mapent['mac'] == $pconfig['mac']) && $mapent['mac']) ||
|
||||
(($mapent['ipaddr'] == $pconfig['ipaddr']) && $mapent['ipaddr'] ) ||
|
||||
(($mapent['cid'] == $pconfig['cid']) && $mapent['cid'])) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user