diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-03-02 20:28:11 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-03-02 20:28:11 +0000 |
commit | 038aa597e271ec1938e6490a566d284c4610764e (patch) | |
tree | 8e81fb68fed165ee63f6c343b9e9e4d34a82667c /etc | |
parent | 55be70e6fb45ac5c13e131d1d866a4a176fd64c0 (diff) | |
download | pfsense-038aa597e271ec1938e6490a566d284c4610764e.zip pfsense-038aa597e271ec1938e6490a566d284c4610764e.tar.gz |
Try to output the line # that errors out.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 7 |
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; } } |