pxe: Validate more path parameters

Some parameters are used to determine file path (or name) so should
accept only absolute path (or a non-empty string).

Change-Id: I74a137693c18a187d12cd53462c36759828c5b5b
This commit is contained in:
Takashi Kajinami 2024-03-19 13:50:07 +09:00
parent 224679340d
commit d921c974c6
5 changed files with 25 additions and 25 deletions

View File

@ -215,7 +215,7 @@ class ironic::conductor (
$enabled_hardware_types = $facts['os_service_default'], $enabled_hardware_types = $facts['os_service_default'],
$force_power_state_during_sync = $facts['os_service_default'], $force_power_state_during_sync = $facts['os_service_default'],
$http_url = $facts['os_service_default'], $http_url = $facts['os_service_default'],
$http_root = '/httpboot', Stdlib::Absolutepath $http_root = '/httpboot',
$force_raw_images = $facts['os_service_default'], $force_raw_images = $facts['os_service_default'],
$automated_clean = $facts['os_service_default'], $automated_clean = $facts['os_service_default'],
$cleaning_network = $facts['os_service_default'], $cleaning_network = $facts['os_service_default'],

View File

@ -140,7 +140,7 @@ class ironic::drivers::pxe (
$ipxe_bootfile_name = $facts['os_service_default'], $ipxe_bootfile_name = $facts['os_service_default'],
$ipxe_config_template = $facts['os_service_default'], $ipxe_config_template = $facts['os_service_default'],
$tftp_server = $facts['os_service_default'], $tftp_server = $facts['os_service_default'],
$tftp_root = '/tftpboot', Stdlib::Absolutepath $tftp_root = '/tftpboot',
$images_path = $facts['os_service_default'], $images_path = $facts['os_service_default'],
$tftp_master_path = $facts['os_service_default'], $tftp_master_path = $facts['os_service_default'],
$instance_master_path = $facts['os_service_default'], $instance_master_path = $facts['os_service_default'],

View File

@ -344,8 +344,8 @@ class ironic::inspector (
Integer[0] $ipxe_timeout = 0, Integer[0] $ipxe_timeout = 0,
$http_port = '8088', $http_port = '8088',
$detect_boot_mode = $facts['os_service_default'], $detect_boot_mode = $facts['os_service_default'],
$tftp_root = '/tftpboot', Stdlib::Absolutepath $tftp_root = '/tftpboot',
$http_root = '/httpboot', Stdlib::Absolutepath $http_root = '/httpboot',
$node_not_found_hook = $facts['os_service_default'], $node_not_found_hook = $facts['os_service_default'],
$discovery_default_driver = $facts['os_service_default'], $discovery_default_driver = $facts['os_service_default'],
Boolean $enable_ppc64le = false, Boolean $enable_ppc64le = false,

View File

@ -104,25 +104,25 @@
# Defaults to {} # Defaults to {}
# #
class ironic::pxe ( class ironic::pxe (
$package_ensure = 'present', $package_ensure = 'present',
Boolean $manage_service = true, Boolean $manage_service = true,
Boolean $enabled = true, Boolean $enabled = true,
$tftp_root = '/tftpboot', Stdlib::Absolutepath $tftp_root = '/tftpboot',
$http_root = '/httpboot', Stdlib::Absolutepath $http_root = '/httpboot',
$http_port = 8088, $http_port = 8088,
$pxelinux_path = $::ironic::params::pxelinux_path, Optional[Variant[Stdlib::Absolutepath, Boolean]] $pxelinux_path = $::ironic::params::pxelinux_path,
$syslinux_path = $::ironic::params::syslinux_path, Optional[Variant[Stdlib::Absolutepath, Boolean]] $syslinux_path = $::ironic::params::syslinux_path,
$syslinux_files = $::ironic::params::syslinux_files, Optional[Array[String[1]]] $syslinux_files = $::ironic::params::syslinux_files,
$tftp_bind_host = undef, $tftp_bind_host = undef,
String[1] $ipxe_name_base = $::ironic::params::ipxe_name_base, String[1] $ipxe_name_base = $::ironic::params::ipxe_name_base,
String[1] $uefi_ipxe_bootfile_name = $::ironic::params::uefi_ipxe_bootfile_name, String[1] $uefi_ipxe_bootfile_name = $::ironic::params::uefi_ipxe_bootfile_name,
String[1] $uefi_pxe_bootfile_name = $::ironic::params::uefi_pxe_bootfile_name, String[1] $uefi_pxe_bootfile_name = $::ironic::params::uefi_pxe_bootfile_name,
Boolean $tftp_use_xinetd = $::ironic::params::xinetd_available, Boolean $tftp_use_xinetd = $::ironic::params::xinetd_available,
$dnsmasq_log_facility = undef, $dnsmasq_log_facility = undef,
Boolean $manage_http_server = true, Boolean $manage_http_server = true,
$vhost_priority = 10, $vhost_priority = 10,
Array[String] $vhost_options = ['-Indexes', '+FollowSymLinks'], Array[String] $vhost_options = ['-Indexes', '+FollowSymLinks'],
Hash $vhost_config = {}, Hash $vhost_config = {},
) inherits ironic::params { ) inherits ironic::params {
include ironic::deps include ironic::deps

View File

@ -46,8 +46,8 @@
# Defaults to undef. # Defaults to undef.
# #
class ironic::pxe::common ( class ironic::pxe::common (
$tftp_root = undef, Optional[Stdlib::Absolutepath] $tftp_root = undef,
$http_root = undef, Optional[Stdlib::Absolutepath] $http_root = undef,
$http_port = undef, $http_port = undef,
Optional[Integer[0]] $ipxe_timeout = undef, Optional[Integer[0]] $ipxe_timeout = undef,
Optional[String[1]] $uefi_ipxe_bootfile_name = undef, Optional[String[1]] $uefi_ipxe_bootfile_name = undef,