diff options
author | jim-p <jimp@pfsense.org> | 2010-08-26 10:41:49 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-08-26 10:41:49 -0400 |
commit | 1bd4b4dcd97c2c77aa8900e3113d5050d44af469 (patch) | |
tree | 9939f852f7c505aa5f45d73a06829f4ba600883c /usr/local/www/wizards/openvpn_wizard.inc | |
parent | 6d80857f47bf5d56a18565e89c1a5017c87f4f7c (diff) | |
download | pfsense-1bd4b4dcd97c2c77aa8900e3113d5050d44af469.zip pfsense-1bd4b4dcd97c2c77aa8900e3113d5050d44af469.tar.gz |
Enforce length of OpenVPN server descr in wizard.
Diffstat (limited to 'usr/local/www/wizards/openvpn_wizard.inc')
-rw-r--r-- | usr/local/www/wizards/openvpn_wizard.inc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr/local/www/wizards/openvpn_wizard.inc b/usr/local/www/wizards/openvpn_wizard.inc index e4a7c8c..ff8175c 100644 --- a/usr/local/www/wizards/openvpn_wizard.inc +++ b/usr/local/www/wizards/openvpn_wizard.inc @@ -512,6 +512,9 @@ function step12_submitphpaction() { $server['interface'] = $pconfig['step10']['interface']; if (isset($pconfig['step10']['localport'])) $server['local_port'] = $pconfig['step10']['localport']; + + if (strlen($pconfig['step10']['descr']) > 30) + $pconfig['step10']['descr'] = substr($pconfig['step10']['descr'], 0, 30); $server['description'] = $pconfig['step10']['descr']; $server['custom_options'] = $pconfig['step10']['advanced']; if (isset($pconfig['step10']['tlsauth'])) { @@ -567,7 +570,10 @@ function step12_submitphpaction() { if (isset($pconfig['step11']['ovpnrule'])) { $rule = array(); - $rule['descr'] = gettext("OpenVPN {$server['description']} wizard rules."); + $rule['descr'] = gettext("OpenVPN {$server['description']} wizard"); + /* Ensure the rule descr is not too long for pf to handle */ + if (strlen($rule['descr']) > 52) + $rule['descr'] = substr($rule['descr'], 0, 52); $rule['direction'] = "in"; $rule['source']['any'] = TRUE; $rule['destination']['network'] = $server['interface'] . "ip"; @@ -580,7 +586,10 @@ function step12_submitphpaction() { } if (isset($pconfig['step11']['ovpnallow'])) { $rule = array(); - $rule['descr'] = gettext("OpenVPN {$server['description']} wizard rules."); + $rule['descr'] = gettext("OpenVPN {$server['description']} wizard"); + /* Ensure the rule descr is not too long for pf to handle */ + if (strlen($rule['descr']) > 52) + $rule['descr'] = substr($rule['descr'], 0, 52); $rule['source']['any'] = TRUE; $rule['destination']['any'] = TRUE; $rule['interface'] = "openvpn"; |