From a6deebf1ce520e0918d49543b12903849f8b47da Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 7 Nov 2015 15:36:00 +0100 Subject: Add checks for ramdisks, force disable blacklists usage on nanobsd (Bug #4608) --- config/squidGuard-devel/squidguard.inc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'config/squidGuard-devel') diff --git a/config/squidGuard-devel/squidguard.inc b/config/squidGuard-devel/squidguard.inc index 0be94a6f..fe19fa8d 100644 --- a/config/squidGuard-devel/squidguard.inc +++ b/config/squidGuard-devel/squidguard.inc @@ -103,10 +103,22 @@ sg_init(convert_pfxml_to_sgxml()); # ============================================================================== function squidguard_validate($post, &$input_errors) { + global $config, $g; $submit = isset($_GET['submit']) ? $_GET['submit'] : $_POST['submit']; # check config if 'Apply' - if ($submit === APPLY_BTN) sg_check_config_data($input_errors); + if ($submit === APPLY_BTN) { + // XXX:Bug #4608 + if (($g['platform'] == "pfSense") && isset($config['system']['use_mfs_tmpvar'])) { + $input_errors[] = "Please, disable 'Use RAM Disks' under System: Advanced: Miscellaneous to avoid SquidGuard configuration breakage on reboot."; + } + if ($g['platform'] != "pfSense") { + if ($post['blacklist'] != "" || $post['blacklist_proxy'] != "" || $post['blacklist_url'] != "") { + $input_errors[] = "Blacklists usage is NOT supported on NanoBSD. Disable 'Blacklist' option in 'General settings'."; + } + } + sg_check_config_data($input_errors); + } } # ------------------------------------------------------------------------------ -- cgit v1.2.3