mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
ipsec: safer mobile banner write
This commit is contained in:
parent
39a95d3c39
commit
0ffa883074
@ -939,8 +939,11 @@ function ipsec_configure_do($verbose = false, $interface = '')
|
||||
$strongswanTree['charon']['plugins']['attr']['# Search domain and default domain'] = '';
|
||||
$strongswanTree['charon']['plugins']['attr']['28674'] = $a_client['dns_domain'];
|
||||
}
|
||||
# 28675 --> UNITY_SPLITDNS_NAME
|
||||
# 25 --> INTERNAL_DNS_DOMAIN
|
||||
|
||||
/*
|
||||
* 28675 --> UNITY_SPLITDNS_NAME
|
||||
* 25 --> INTERNAL_DNS_DOMAIN
|
||||
*/
|
||||
foreach (array("28675", "25") as $attr) {
|
||||
if (!empty($a_client['dns_split'])) {
|
||||
$strongswanTree['charon']['plugins']['attr'][$attr] = $a_client['dns_split'];
|
||||
@ -948,12 +951,14 @@ function ipsec_configure_do($verbose = false, $interface = '')
|
||||
$strongswanTree['charon']['plugins']['attr'][$attr] = $a_client['dns_domain'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($a_client['dns_split'])) {
|
||||
$strongswanTree['charon']['plugins']['attr']['28675'] = $a_client['dns_split'];
|
||||
}
|
||||
|
||||
if (!empty($a_client['login_banner'])) {
|
||||
$strongswanTree['charon']['plugins']['attr']['28672'] = sprintf("\"%s\"", $a_client['login_banner']);
|
||||
/* defang login banner, it may be multiple lines and we should not let it escape */
|
||||
$strongswanTree['charon']['plugins']['attr']['28672'] = '"' . str_replace(['\\', '"'], '', $a_client['login_banner']) . '"';
|
||||
}
|
||||
|
||||
if (isset($a_client['save_passwd'])) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user