From c55a0f6a758e7fd13dcee2e3627395fe0a6e3d4f Mon Sep 17 00:00:00 2001 From: dvserg Date: Fri, 11 Feb 2011 07:58:01 +0300 Subject: Blacklist modification and bug fixes --- config/squidGuard/squidguard_configurator.inc | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'config/squidGuard/squidguard_configurator.inc') diff --git a/config/squidGuard/squidguard_configurator.inc b/config/squidGuard/squidguard_configurator.inc index c57728e4..5315d508 100644 --- a/config/squidGuard/squidguard_configurator.inc +++ b/config/squidGuard/squidguard_configurator.inc @@ -1,7 +1,10 @@ {$sglogname} EOD; return $res; } @@ -1989,7 +1993,7 @@ function squidguard_blacklist_update_start($url_filename) } # ----------------------------------------------------------------------------- -# squidguard_blacklist_update_cancel() +# squidguard_blacklist_update_cancel # ----------------------------------------------------------------------------- function squidguard_blacklist_update_cancel() { @@ -2001,6 +2005,15 @@ function squidguard_blacklist_update_cancel() squidguard_update_log("Blacklist update terminated by user.", ""); } +# ----------------------------------------------------------------------------- +# squidguard_blacklist_update_clearlog +# ----------------------------------------------------------------------------- +function squidguard_blacklist_update_clearlog() +{ + # zero file + file_put_contents(SG_UPDATE_STATFILE, ""); +} + # ----------------------------------------------------------------------------- # squidguard_blacklist_update_IsStarted() # ----------------------------------------------------------------------------- @@ -2089,8 +2102,8 @@ function sg_update_blacklist($from_file) if (file_exists($squidguard_config[F_WORKDIR])) $workdir = $squidguard_config[F_WORKDIR]; # delete old tmp dir's - if (file_exists($tmp_unpack_dir)) mwexec("rm -R . $tmp_unpack_dir"); - if (file_exists($arc_db_dir)) mwexec("rm -R . $arc_db_dir"); + if (file_exists($tmp_unpack_dir)) mwexec("rm -R $tmp_unpack_dir"); + if (file_exists($arc_db_dir)) mwexec("rm -R $arc_db_dir"); squidguard_ramdisk(false); # create new tmp/arc dir's, use ramdisk for quick operations @@ -2155,6 +2168,7 @@ function sg_update_blacklist($from_file) squidguard_rebuild_db("blk_", $arc_db_dir, $blk_list); squidguard_update_log("Copy DB to workdir."); + $blklist_file = $arc_db_dir . SQUIDGUARD_BLK_FILELIST; mwexec("cp -R -p $arc_db_dir/ $dbhome"); mwexec("cp -f -p $blklist_file " . SQUIDGUARD_WORKDIR); set_file_access($dbhome, OWNER_NAME, 0755); -- cgit v1.2.3