System: High Availability: Settings - escape shell arguments for consistency (https://github.com/opnsense/core/issues/7485)

This commit is contained in:
Ad Schellevis 2024-06-01 16:34:03 +02:00
parent 65ab1fd638
commit c216e560b3

View File

@ -1281,14 +1281,14 @@ function interfaces_carp_setup()
if (!empty($carp_sync_int) && isset($config['hasync']['pfsyncenabled'])) {
if (!empty($config['hasync']['pfsyncpeerip']) && is_ipaddrv4($config['hasync']['pfsyncpeerip'])) {
$syncpeer = "syncpeer {$config['hasync']['pfsyncpeerip']}";
$syncpeer = "syncpeer " . escapeshellarg($config['hasync']['pfsyncpeerip']);
} else {
$syncpeer = "-syncpeer";
}
$version = '';
if (!empty($config['hasync']['version'])) {
$version = 'version ' . $config['hasync']['version'];
$version = 'version ' . escapeshellarg($config['hasync']['version']);
}
$intf_stats = legacy_interfaces_details();
@ -1296,7 +1296,7 @@ function interfaces_carp_setup()
mwexec("/sbin/ifconfig pfsync0 syncdev {$carp_sync_int} {$syncpeer} {$version} up");
if (!empty($intf_stats[$carp_sync_int]['mtu'])) {
mwexec("/sbin/ifconfig pfsync0 mtu {$intf_stats[$carp_sync_int]['mtu']}");
mwexec("/sbin/ifconfig pfsync0 mtu " . escapeshellarg($intf_stats[$carp_sync_int]['mtu']));
}
} else {
mwexec('/sbin/ifconfig pfsync0 -syncdev -syncpeer down');