summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2006-12-27 07:49:18 +0000
committerSeth Mos <seth.mos@xs4all.nl>2006-12-27 07:49:18 +0000
commit06246e5bbe4407b19fc93f40bed3835a7656160a (patch)
tree59be280af289ad44b7bfe6019bdd2b25944275f2
parent5b09780a2671abe002aed5cc1f8be40cc05a0ae2 (diff)
downloadpfsense-06246e5bbe4407b19fc93f40bed3835a7656160a.zip
pfsense-06246e5bbe4407b19fc93f40bed3835a7656160a.tar.gz
Limit NAT description to prevent invalid rules.
Submitted-by: Devon O'Dell <devon.odell@coyotepoint.com>
-rwxr-xr-xusr/local/www/firewall_nat_edit.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 1e7f862..7508768 100755
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -198,12 +198,17 @@ if ($_POST) {
$filterent['destination']['port'] = $dstpfrom . "-" . $dstpto;
$filterent['descr'] = "NAT " . $_POST['descr'];
+ /*
+ * Our firewall filter description may be no longer than
+ * 63 characters, so don't let it be.
+ */
+ $filterent['descr'] = substr("NAT " . $_POST['descr'], 0, 63);
$config['filter']['rule'][] = $filterent;
/* auto add rule to external port 21 as well since we are using
* pftpx to help open up ports automatically
- */
+ */
if($_POST['endport'] == "21") {
$filterent = array();
$filterent['interface'] = $_POST['interface'];
@@ -225,6 +230,8 @@ if ($_POST) {
$filterent['destination']['port'] = $dstpfrom . "-" . $dstpto;
$filterent['descr'] = "NAT " . $_POST['descr'];
+ /* See comment above */
+ $filterent['descr'] = substr("NAT " . $_POST['descr'], 0, 63);
$config['filter']['rule'][] = $filterent;
OpenPOWER on IntegriCloud