aboutsummaryrefslogtreecommitdiffstats
path: root/config/squidGuard/squidguard_configurator.inc
diff options
context:
space:
mode:
authordvserg <dv_serg@mail.ru>2011-02-11 07:58:01 +0300
committerdvserg <dv_serg@mail.ru>2011-02-11 07:58:01 +0300
commitc55a0f6a758e7fd13dcee2e3627395fe0a6e3d4f (patch)
tree80172223e17fbc046e74f9586be32be8851b8f02 /config/squidGuard/squidguard_configurator.inc
parent339ebaee41cbd13e14d5f02c3adfb30229031ff4 (diff)
downloadpfsense-packages-c55a0f6a758e7fd13dcee2e3627395fe0a6e3d4f.tar.gz
pfsense-packages-c55a0f6a758e7fd13dcee2e3627395fe0a6e3d4f.tar.bz2
pfsense-packages-c55a0f6a758e7fd13dcee2e3627395fe0a6e3d4f.zip
Blacklist modification and bug fixes
Diffstat (limited to 'config/squidGuard/squidguard_configurator.inc')
-rw-r--r--config/squidGuard/squidguard_configurator.inc24
1 files changed, 19 insertions, 5 deletions
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 @@
<?php
# ------------------------------------------------------------------------------
/* squidguard_configurator.inc
- (C)2006-2011 Serg Dvoriancev
+ 2006-2011 Serg Dvoriancev
+
+ part of pfSense (www.pfSense.com)
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -1857,7 +1860,8 @@ function sg_script_logrotate()
#
# This file generated automaticly with SquidGuard configurator
rm -f {$sglogname}.0
-mv -f {$sglogname} {$sglogname}.0
+cp -f {$sglogname} {$sglogname}.0
+echo '' > {$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()
{
@@ -2002,6 +2006,15 @@ function squidguard_blacklist_update_cancel()
}
# -----------------------------------------------------------------------------
+# squidguard_blacklist_update_clearlog
+# -----------------------------------------------------------------------------
+function squidguard_blacklist_update_clearlog()
+{
+ # zero file
+ file_put_contents(SG_UPDATE_STATFILE, "");
+}
+
+# -----------------------------------------------------------------------------
# squidguard_blacklist_update_IsStarted()
# -----------------------------------------------------------------------------
function 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);