summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-02 20:28:11 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-02 20:28:11 +0000
commit038aa597e271ec1938e6490a566d284c4610764e (patch)
tree8e81fb68fed165ee63f6c343b9e9e4d34a82667c /etc
parent55be70e6fb45ac5c13e131d1d866a4a176fd64c0 (diff)
downloadpfsense-038aa597e271ec1938e6490a566d284c4610764e.zip
pfsense-038aa597e271ec1938e6490a566d284c4610764e.tar.gz
Try to output the line # that errors out.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 9c01e9b..fe014e7 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -143,7 +143,11 @@ function filter_configure() {
if($rules_loading <> 0) {
$rules_error = exec_command("/sbin/pfctl -f {$g['tmp_path']}/rules.debug");
- return "There was an error loading the rules.<p><pre>" . $rules_error . "</pre>";
+ $line_error = split("\:", $rules_error);
+ $line_number = $line_error[1];
+ $line_split = split("\n", `cat /tmp/rules.debug`);
+ $line_error = "The line in question reads: " . $line_split($line_number);
+ return "There was an error loading the rules.<p><pre>" . $rules_error . "\n" . $line_error . "</pre>";
} else {
/* process packager manager custom rules */
$files = return_dir_as_array("/usr/local/pkg/pf/");
@@ -156,7 +160,6 @@ function filter_configure() {
}
}
}
-
return 0;
}
}
OpenPOWER on IntegriCloud