Revision: 6227
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6227&view=rev
Author:   dotzball
Date:     2012-01-10 07:46:26 +0000 (Tue, 10 Jan 2012)
Log Message:
-----------
Add script for URLfilter blacklist updates.

The script is not called by cron or scheduler yet.

Modified Paths:
--------------
    ipcop/trunk/config/rootfiles/common/misc-progs
    ipcop/trunk/html/cgi-bin/logsystem.cgi
    ipcop/trunk/html/cgi-bin/urlfilter.cgi
    ipcop/trunk/lfs/ipcop
    ipcop/trunk/src/scripts/upgrade.sh
    ipcop/trunk/updates/2.0.3/ROOTFILES.i486-2.0.3
    ipcop/trunk/updates/2.0.3/setup

Added Paths:
-----------
    ipcop/trunk/config/cfgroot/blacklistupdate.urls
    ipcop/trunk/src/scripts/blacklistupdate.pl

Added: ipcop/trunk/config/cfgroot/blacklistupdate.urls
===================================================================
--- ipcop/trunk/config/cfgroot/blacklistupdate.urls                             
(rev 0)
+++ ipcop/trunk/config/cfgroot/blacklistupdate.urls     2012-01-10 07:46:26 UTC 
(rev 6227)
@@ -0,0 +1,3 @@
+Shalla Secure Services,http://www.shallalist.de/Downloads/shallalist.tar.gz
+MESD,http://squidguard.mesd.k12.or.us/blacklists.tgz
+Univ. 
Toulouse,ftp://ftp.univ-tlse1.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz

Modified: ipcop/trunk/config/rootfiles/common/misc-progs
===================================================================
--- ipcop/trunk/config/rootfiles/common/misc-progs      2012-01-10 06:40:11 UTC 
(rev 6226)
+++ ipcop/trunk/config/rootfiles/common/misc-progs      2012-01-10 07:46:26 UTC 
(rev 6227)
@@ -39,6 +39,7 @@
 usr/local/bin/Make
 usr/local/bin/accountingctrl
 usr/local/bin/aggregatetraffic.pl
+usr/local/bin/blacklistupdate.pl
 #usr/local/bin/build-rdepend
 usr/local/bin/cc
 usr/local/bin/compile.help

Modified: ipcop/trunk/html/cgi-bin/logsystem.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/logsystem.cgi      2012-01-10 06:40:11 UTC (rev 
6226)
+++ ipcop/trunk/html/cgi-bin/logsystem.cgi      2012-01-10 07:46:26 UTC (rev 
6227)
@@ -1,12 +1,12 @@
 #!/usr/bin/perl
 #
 # This file is part of the IPCop Firewall.
-# 
+#
 # IPCop is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
-# 
+#
 # IPCop is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -14,9 +14,9 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with IPCop.  If not, see <http://www.gnu.org/licenses/>.
-# 
+#
 # (c) The SmoothWall Team
-# Copyright (c) 2001-2011 The IPCop Team
+# Copyright (c) 2001-2012 The IPCop Team
 #
 # $Id$
 #
@@ -67,7 +67,7 @@
     'ipsec'          => '(vpn|ipsec|ipsec_[\w_]+|pluto\[\d+\]|vpn-watch)',
     'openvpn'        => '(vpn|openvpn|OVPN_.*|openvpnserver\[\d+\])',
     'squid'          => '(squid\[\d+\])',
-    'installpackage' => '(installpackage)',
+    'installpackage' => '(installpackage|installpackage\[urlfilter\])',
     'traffic'        => '(accountingctrl|aggregate|vnstatd\[\d+\])',
 );
 
@@ -131,7 +131,7 @@
     $cgiparams{'DAY'}   = $temp_then[3];
 }
 
-# Date to display 
+# Date to display
 my $date;
 $date = sprintf("%d-%02d-%02d", $year, $cgiparams{'MONTH'}+1, 
$cgiparams{'DAY'});
 

Modified: ipcop/trunk/html/cgi-bin/urlfilter.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/urlfilter.cgi      2012-01-10 06:40:11 UTC (rev 
6226)
+++ ipcop/trunk/html/cgi-bin/urlfilter.cgi      2012-01-10 07:46:26 UTC (rev 
6227)
@@ -16,7 +16,7 @@
 # along with IPCop.  If not, see <http://www.gnu.org/licenses/>.
 #
 # (c) 2004-2008 marco.s - http://www.urlfilter.net
-# (c) 2011 The IPCop Team
+# (c) 2011-2012 The IPCop Team
 #
 # $Id$
 #
@@ -69,12 +69,12 @@
 my $repository = "/home/httpd/vhost81/html/repository";
 my $hintcolour = '#FFFFCC';
 
-my $sourceurlfile = "/var/ipcop/proxy/autoupdate/autoupdate.urls";
-my $updconffile   = "/var/ipcop/proxy/autoupdate/autoupdate.conf";
-my $updflagfile   = "/var/ipcop/proxy/blacklists/.autoupdate.last";
-my $upd_cron_dly  = "/var/ipcop/proxy/autoupdate/cron.daily";
-my $upd_cron_wly  = "/var/ipcop/proxy/autoupdate/cron.weekly";
-my $upd_cron_mly  = "/var/ipcop/proxy/autoupdate/cron.monthly";
+my $sourceurlfile = "/var/ipcop/proxy/blacklistupdate/blacklistupdate.urls";
+my $updconffile   = "/var/ipcop/proxy/blacklistupdate/blacklistupdate.conf";
+my $updflagfile   = "/var/ipcop/proxy/blacklists/.blacklistupdate.last";
+#~ my $upd_cron_dly  = "/var/ipcop/proxy/blacklistupdate/cron.daily";
+#~ my $upd_cron_wly  = "/var/ipcop/proxy/blacklistupdate/cron.weekly";
+#~ my $upd_cron_mly  = "/var/ipcop/proxy/blacklistupdate/cron.monthly";
 
 my $errormessage   = '';
 my $updatemessage  = '';
@@ -278,6 +278,9 @@
                 $errormessage = $Lang::tr{'urlfilter invalid content'};
             }
             else {
+                # remove old blacklists (except custom lists)
+                system("rm -rf `find $dbdir/* -maxdepth 0 -type d | grep -v 
$dbdir/custom` ");
+
                 system("cp -r /var/ipcop/proxy/update/blacklists/* $dbdir");
 
                 &readblockcategories;
@@ -286,7 +289,7 @@
                 &writeconfigfile;
 
                 $updatemessage = $Lang::tr{'urlfilter upload success'};
-                system("/var/ipcop/proxy/bin/prebuild.pl &");
+                system("/usr/local/bin/blacklistupdate.pl --perm &");
                 system(
 "logger -t installpackage[urlfilter] \"URL filter blacklist - Blacklist update 
from local source completed\""
                 );
@@ -301,7 +304,7 @@
         $blistbackup = ($filtersettings{'ENABLE_FULLBACKUP'} eq 'on') ? 
"blacklists" : "blacklists/custom";
         if (
             system(
-"/bin/tar -C /var/ipcop/proxy -czf /var/ipcop/proxy/backup.tar.gz settings 
timeconst userquota autoupdate $blistbackup"
+"/bin/tar -C /var/ipcop/proxy -czf /var/ipcop/proxy/backup.tar.gz settings 
timeconst userquota blacklistupdate $blistbackup"
             )
             )
         {
@@ -381,8 +384,6 @@
         $filtersettings{'VALID'} = 'yes';
         &savesettings;
 
-        system("chown -R nobody.nobody $dbdir");
-
         if (-e "$dbdir/custom/allowed/domains.db") { 
unlink("$dbdir/custom/allowed/domains.db"); }
         if (-e "$dbdir/custom/allowed/urls.db")    { 
unlink("$dbdir/custom/allowed/urls.db"); }
         if (-e "$dbdir/custom/blocked/domains.db") { 
unlink("$dbdir/custom/blocked/domains.db"); }
@@ -996,55 +997,28 @@
         $errormessage = $Lang::tr{'urlfilter custom url required'};
     }
     else {
-        open(FILE, ">$updconffile");
-        print FILE "ENABLE_AUTOUPDATE=$filtersettings{'ENABLE_AUTOUPDATE'}\n";
-        print FILE "UPDATE_SCHEDULE=$filtersettings{'UPDATE_SCHEDULE'}\n";
-        print FILE "UPDATE_SOURCE=$filtersettings{'UPDATE_SOURCE'}\n";
-        print FILE "CUSTOM_UPDATE_URL=$filtersettings{'CUSTOM_UPDATE_URL'}\n";
-        close FILE;
+        my %updateConf = ();
+        $updateConf{'ENABLE_AUTOUPDATE'} = 
$filtersettings{'ENABLE_AUTOUPDATE'};
+        $updateConf{'UPDATE_SCHEDULE'} = $filtersettings{'UPDATE_SCHEDULE'};
+        $updateConf{'UPDATE_SOURCE'} = $filtersettings{'UPDATE_SOURCE'};
+        $updateConf{'CUSTOM_UPDATE_URL'} = 
$filtersettings{'CUSTOM_UPDATE_URL'};
 
-        if (-e $upd_cron_dly) { unlink($upd_cron_dly); }
-        if (-e $upd_cron_wly) { unlink($upd_cron_wly); }
-        if (-e $upd_cron_mly) { unlink($upd_cron_mly); }
-
-        if (($filtersettings{'ENABLE_AUTOUPDATE'} eq 'on') && 
($filtersettings{'UPDATE_SCHEDULE'} eq 'daily')) {
-            symlink("../bin/autoupdate.pl", $upd_cron_dly);
-        }
-        else {
-            symlink("/bin/false", $upd_cron_dly);
-        }
-
-        if (($filtersettings{'ENABLE_AUTOUPDATE'} eq 'on') && 
($filtersettings{'UPDATE_SCHEDULE'} eq 'weekly')) {
-            symlink("../bin/autoupdate.pl", $upd_cron_wly);
-        }
-        else {
-            symlink("/bin/false", $upd_cron_wly);
-        }
-
-        if (($filtersettings{'ENABLE_AUTOUPDATE'} eq 'on') && 
($filtersettings{'UPDATE_SCHEDULE'} eq 'monthly')) {
-            symlink("../bin/autoupdate.pl", $upd_cron_mly);
-        }
-        else {
-            symlink("/bin/false", $upd_cron_mly);
-        }
+        &General::writehash("$updconffile", \%updateConf);
     }
 }
 
 if ($filtersettings{'ACTION'} eq $Lang::tr{'instant update'}) {
-    if ($filtersettings{'UPDATE_SOURCE'} eq 'custom') {
-        if ($filtersettings{'CUSTOM_UPDATE_URL'} eq '') {
-            $errormessage = $Lang::tr{'urlfilter custom url required'};
-        }
-        else {
-            system("/var/ipcop/proxy/bin/autoupdate.pl 
$filtersettings{'CUSTOM_UPDATE_URL'} &");
-        }
+    if ($filtersettings{'UPDATE_SOURCE'} eq 'custom' && 
$filtersettings{'CUSTOM_UPDATE_URL'} eq '') {
+        $errormessage = $Lang::tr{'urlfilter custom url required'};
     }
     else {
-        system("/var/ipcop/proxy/bin/autoupdate.pl 
$filtersettings{'UPDATE_SOURCE'} &");
+        system("/usr/local/bin/blacklistupdate.pl --force &");
     }
 }
 
-if (-e "/var/ipcop/proxy/filtersettings") { 
&General::readhash("/var/ipcop/proxy/filtersettings", \%filtersettings); }
+if (-e "/var/ipcop/proxy/filtersettings") {
+    &General::readhash("/var/ipcop/proxy/filtersettings", \%filtersettings);
+}
 
 &readcustomlists;
 
@@ -1263,9 +1237,9 @@
             for ($i = 0; $i <= 3; $i++) {
                 if ($i eq 0) { print "<tr>\n"; }
                 if (($n + $i) < @categories) {
-                    print "<td width='15%'>@categories[$n+$i]:<\/td>\n";
+                    print "<td width='15%'>$categories[$n+$i]:<\/td>\n";
                     print
-"<td width='10%'><input type='checkbox' name=@filtergroups[$n+$i] 
$checked{@filtergroups[$n+$i]}{'on'} /></td>\n";
+"<td width='10%'><input type='checkbox' name=$filtergroups[$n+$i] 
$checked{$filtergroups[$n+$i]}{'on'} /></td>\n";
                 }
                 if ($i eq 3) { print "<\/tr>\n"; }
             }
@@ -3017,8 +2991,8 @@
             $defaultrule .= "!in-addr ";
         }
         for ($i = 0; $i <= @filtergroups; $i++) {
-            if ($filtersettings{@filtergroups[$i]} eq 'on') {
-                $defaultrule .= "!@categories[$i] ";
+            if ($filtersettings{$filtergroups[$i]} eq 'on') {
+                $defaultrule .= "!$categories[$i] ";
             }
         }
         if ($filtersettings{'ENABLE_CUSTOM_BLACKLIST'} eq 'on') {

Modified: ipcop/trunk/lfs/ipcop
===================================================================
--- ipcop/trunk/lfs/ipcop       2012-01-10 06:40:11 UTC (rev 6226)
+++ ipcop/trunk/lfs/ipcop       2012-01-10 07:46:26 UTC (rev 6227)
@@ -63,7 +63,7 @@
        for i in addons addons/lang alcatelusb auth backup ca certs cnx_pci 
crls ddns dhcp \
                eagle-usb eciadsl email email/templates ethernet firewall 
firmware key logging main modem  \
                ipsec openvpn openvpn/ca openvpn/ccd openvpn/certs openvpn/crls 
openvpn/openssl patches \
-               ppp private proxy proxy/autoupdate proxy/blacklists 
proxy/redirector red remote shaping time \
+               ppp private proxy proxy/blacklists proxy/blacklistupdate 
proxy/redirector red remote shaping time \
                traffic vpn ; do \
                        mkdir -p $(CONFIG_ROOT)/$$i; \
        done
@@ -109,6 +109,7 @@
        cp $(DIR_SRC)/config/cfgroot/modem-settings             
$(CONFIG_ROOT)/modem/settings
        cp $(DIR_SRC)/config/cfgroot/openvpn                    
$(CONFIG_ROOT)/openvpn/settings
        cp $(DIR_SRC)/config/cfgroot/scheduler                  
$(CONFIG_ROOT)/main/scheduler
+       cp $(DIR_SRC)/config/cfgroot/blacklistupdate.urls                       
$(CONFIG_ROOT)/proxy/blacklistupdate/blacklistupdate.urls
        cp $(DIR_SRC)/config/cfgroot/squidGuard.conf                    
$(CONFIG_ROOT)/proxy/squidGuard.conf
        cp $(DIR_SRC)/config/cfgroot/ntp.conf                   
$(CONFIG_ROOT)/time/ntp.conf
        cp $(DIR_SRC)/config/cfgroot/time-settings              
$(CONFIG_ROOT)/time/settings

Added: ipcop/trunk/src/scripts/blacklistupdate.pl
===================================================================
--- ipcop/trunk/src/scripts/blacklistupdate.pl                          (rev 0)
+++ ipcop/trunk/src/scripts/blacklistupdate.pl  2012-01-10 07:46:26 UTC (rev 
6227)
@@ -0,0 +1,310 @@
+#!/usr/bin/perl
+#
+# This file is part of the IPCop Firewall.
+#
+# IPCop is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# IPCop is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with IPCop.  If not, see <http://www.gnu.org/licenses/>.
+#
+# (c) 2004-2007 marco.s - http://www.urlfilter.net
+# (c) 2012 The IPCop Team
+#
+# $Id$
+#
+use strict;
+use warnings;
+
+require '/usr/lib/ipcop/general-functions.pl';
+
+# Debug level:
+#      0 - no print
+#      1 - print
+my $debugLevel = 0;
+
+my $make_clean = 1;
+
+my $target = "/var/ipcop/proxy/download";
+my $tempdb = "$target/blacklists";
+my $dbdir  = "/var/ipcop/proxy/blacklists";
+
+my $sourceurlfile = "/var/ipcop/proxy/blacklistupdate/blacklistupdate.urls";
+my $updconffile = "/var/ipcop/proxy/blacklistupdate/blacklistupdate.conf";
+my $updflagfile = "$dbdir/.blacklistupdate.last";
+
+my %updatesettings;
+$updatesettings{'ENABLE_AUTOUPDATE'} = 'off';
+
+my @categories;
+my $blacklist;
+
+my $exitcode = 1;
+my $doUpdate = 0;
+my $doSetPermissions = 0;
+
+if (-e "$updconffile") {
+    &General::readhash("$updconffile", \%updatesettings);
+}
+
+while (@ARGV) {
+    my $argument = shift;
+
+    print "arg: $argument\n" if ($debugLevel > 0);
+
+    if ($argument eq '--cron' && ($#ARGV >= 0)) {
+        # handle cron/scheduled updates
+        my $type = shift;
+
+        # TODO: not implemented yet
+
+#~         $doUpdate = 1;
+    }
+    elsif ($argument eq '--force') {
+        # force/instant update
+        $doUpdate = 1;
+    }
+    elsif ($argument eq '--perm') {
+        # set permissions on prebuild blacklist
+        $doSetPermissions = 1;
+    }
+    else {
+        # If we are here, a parameter was given to us that we do not know 
about.
+
+        # TODO: error handling ?
+        # rm -rf /
+        # something else ?
+    }
+} # while (@ARGV)
+
+
+if($doUpdate) {
+    if ($debugLevel > 0) {
+        print "Updating...\n";
+        system("logger -t installpackage[urlfilter] \"URL filter blacklist - 
Updating...\"");
+    }
+
+    if (-e '/var/ipcop/red/active') {
+        &updateblacklist();
+    }
+    else {
+        if ($debugLevel > 0) {
+            print "RED connection is down, exit.\n";
+            system("logger -t installpackage[urlfilter] \"URL filter blacklist 
- RED connection is down, exit.\"");
+        }
+
+        # silently exit
+        $exitcode = 0;
+    }
+}
+
+if($doSetPermissions) {
+    &setpermissions ($dbdir);
+    $exitcode = 0;
+}
+
+exit $exitcode;
+
+
+sub updateblacklist
+{
+    if($updatesettings{'ENABLE_AUTOUPDATE'} ne 'on') {
+        if ($debugLevel > 0) {
+            print "Update not enabled, exit.\n";
+            system("logger -t installpackage[urlfilter] \"URL filter blacklist 
- Update not enabled, exit.\"");
+        }
+
+        return;
+    }
+
+    my $blacklist_url = '';
+    my $blacklist_src = '';
+
+    my $source_url = '';
+    my $source_name = '';
+    my @source_urllist = ();
+
+    if (-e "$sourceurlfile") {
+        open(FILE, $sourceurlfile);
+        @source_urllist = <FILE>;
+        close(FILE);
+    }
+
+    if ($updatesettings{'UPDATE_SOURCE'} eq 'custom') {
+        $blacklist_url = $updatesettings{'CUSTOM_UPDATE_URL'};
+    }
+    else {
+        $blacklist_url = $updatesettings{'UPDATE_SOURCE'};
+
+        foreach my $source (@source_urllist)
+        {
+            chomp $source;
+            $source_name = substr($source, 0, rindex($source,","));
+            $source_url = substr($source, index($source,",")+1);
+            if ($blacklist_url eq $source_url) {
+                $blacklist_src = $source_name;
+            }
+        }
+    }
+
+    if ($blacklist_src eq '') {
+        $blacklist_src = "custom source URL";
+    }
+
+    $blacklist_url =~ s/\&/\\\&/;
+
+    my $blacklist = substr($blacklist_url, rindex($blacklist_url,"/")+1);
+
+    if (($blacklist =~ /\?/) || (!($blacklist =~ /\.t(ar\.)?gz$/))) {
+        $blacklist = 'blacklist.tar.gz';
+    }
+    $blacklist = $target.'/'.$blacklist;
+
+    unless ($blacklist_url eq '') {
+        if ($debugLevel > 0) {
+            print "Using $blacklist_src\n";
+            system("logger -t installpackage[urlfilter] \"URL filter blacklist 
- Using $blacklist_src\"");
+        }
+
+        if (-d $target) {
+            system("rm -rf $target");
+        }
+        system("mkdir $target");
+
+        system("/usr/bin/wget -o $target/wget.log -O $blacklist 
$blacklist_url");
+
+        if (-e $blacklist) {
+            system("/bin/tar --no-same-owner -xzf $blacklist -C $target");
+
+            if (-d "$target/BL") {
+                system ("mv $target/BL $target/blacklists");
+            }
+
+            if (-d "$tempdb") {
+                undef(@categories);
+
+                &getblockcategory ($tempdb);
+
+                foreach (@categories) {
+                    $_ = substr($_, length($tempdb)+1);
+                }
+
+                open(FILE, ">$target/update.conf");
+                flock FILE, 2;
+                print FILE "logdir $target\n";
+                print FILE "dbhome $tempdb\n\n";
+
+                foreach my $category (@categories) {
+                    my $category_name = $category;
+                    $category_name =~ s/\//_/g;
+                    print FILE "dest $category_name {\n";
+                    if (-s "$tempdb/$category/domains") {
+                        print FILE "    domainlist     $category\/domains\n";
+                    }
+                    if (-s "$tempdb/$category/urls") {
+                        print FILE "    urllist        $category\/urls\n";
+                    }
+                    print FILE "}\n\n";
+                }
+
+                print FILE "acl {\n";
+                print FILE "    default {\n";
+                print FILE "        pass none\n";
+                print FILE "    }\n";
+                print FILE "}\n";
+                close FILE;
+
+                system("/usr/bin/squidGuard -d -c $target/update.conf -C all");
+
+                # remove old blacklists (except custom lists)
+                system("rm -rf `find $dbdir/* -maxdepth 0 -type d | grep -v 
$dbdir/custom` ");
+                system("cp -r $target/blacklists/* $dbdir");
+
+                &setpermissions ($dbdir);
+
+                system("touch $updflagfile");
+                system("chown nobody.nobody $updflagfile");
+
+                system("/usr/local/bin/restartsquid");
+
+                print "Update from $blacklist_src completed\n" if ($debugLevel 
> 0);
+
+                system("logger -t installpackage[urlfilter] \"URL filter 
blacklist - Update from $blacklist_src completed\"");
+
+                $exitcode = 0;
+
+            }
+            else {
+                print "ERROR: Not a valid URL filter blacklist\n" if 
($debugLevel > 0);
+
+                system("logger -t installpackage[urlfilter] \"URL filter 
blacklist - ERROR: Not a valid URL filter blacklist\"");
+            }
+        }
+        else {
+            print "ERROR: Unable to retrieve blacklist from $blacklist_src\n" 
if ($debugLevel > 0);
+
+            system("logger -t installpackage[urlfilter] \"URL filter blacklist 
- ERROR: Unable to retrieve blacklist from $blacklist_src\"");
+        }
+
+    }
+    else {
+        system("logger -t installpackage[urlfilter] \"URL filter blacklist - 
ERROR: No update source defined\"");
+    }
+
+    if ((-d $target) && ($make_clean)) {
+        system("rm -rf $target");
+    }
+}
+
+
+# -------------------------------------------------------------------
+
+sub getblockcategory
+{
+    foreach my $category (<$_[0]/*>)
+    {
+        if (-d $category)
+        {
+            if ((-s "$category/domains") || (-s "$category/urls"))
+            {
+                unless ($category =~ /\bcustom\b/) {
+                    push(@categories, $category);
+                }
+            }
+            &getblockcategory ($category);
+        }
+    }
+}
+
+# -------------------------------------------------------------------
+
+sub setpermissions
+{
+    my $bldir = $_[0];
+
+    system("chown -R nobody.nobody $bldir");
+
+    foreach my $category (<$bldir/*>)
+    {
+             if (-d $category){
+            system("chmod 755 $category &> /dev/null");
+            foreach my $blacklist (<$category/*>)
+            {
+                    if (-f $blacklist) { system("chmod 644 $blacklist &> 
/dev/null"); }
+                    if (-d $blacklist) { system("chmod 755 $blacklist &> 
/dev/null"); }
+            }
+            system("chmod 666 $category/*.db &> /dev/null");
+
+            &setpermissions ($category);
+        }
+     }
+}
+
+# -------------------------------------------------------------------


Property changes on: ipcop/trunk/src/scripts/blacklistupdate.pl
___________________________________________________________________
Added: svn:keywords
   + Id

Modified: ipcop/trunk/src/scripts/upgrade.sh
===================================================================
--- ipcop/trunk/src/scripts/upgrade.sh  2012-01-10 06:40:11 UTC (rev 6226)
+++ ipcop/trunk/src/scripts/upgrade.sh  2012-01-10 07:46:26 UTC (rev 6227)
@@ -92,3 +92,6 @@
 
 # Detail High for traffic accounting disabled in 2.0.3
 /bin/sed -i -e "s/DETAIL_LEVEL=.*/DETAIL_LEVEL=Low/" 
/var/ipcop/traffic/settings
+
+# Not used directory proxy/autoupdate removed in 2.0.3
+rm -rf /var/ipcop/proxy/autoupdate

Modified: ipcop/trunk/updates/2.0.3/ROOTFILES.i486-2.0.3
===================================================================
--- ipcop/trunk/updates/2.0.3/ROOTFILES.i486-2.0.3      2012-01-10 06:40:11 UTC 
(rev 6226)
+++ ipcop/trunk/updates/2.0.3/ROOTFILES.i486-2.0.3      2012-01-10 07:46:26 UTC 
(rev 6227)
@@ -2,6 +2,7 @@
 /etc/rc.d/rc.isdn
 /etc/rc.d/rc.red
 /home/httpd/cgi-bin/fwrules.cgi
+/home/httpd/cgi-bin/logsystem.cgi
 /home/httpd/cgi-bin/openvpn.cgi
 /home/httpd/cgi-bin/proxy.cgi
 /home/httpd/cgi-bin/servicegrps.cgi
@@ -12,9 +13,11 @@
 /usr/lib/ipcop/general-functions.pl
 /usr/lib/ipcop/header.pl
 /usr/lib/ipcop/library.sh
+/usr/local/bin/blacklistupdate.pl
 /usr/local/bin/makesquidconf
 /usr/local/bin/upgrade.sh
 /usr/share/locale/el_GR/LC_MESSAGES/ipcop.mo
+/var/ipcop/proxy/blacklistupdate/blacklistupdate.urls
 ##
 ## acpid-2.0.13
 /usr/sbin/acpid

Modified: ipcop/trunk/updates/2.0.3/setup
===================================================================
--- ipcop/trunk/updates/2.0.3/setup     2012-01-10 06:40:11 UTC (rev 6226)
+++ ipcop/trunk/updates/2.0.3/setup     2012-01-10 07:46:26 UTC (rev 6227)
@@ -34,8 +34,12 @@
 #
 #####
 
+#  New directory for urlfilter blacklist updates
+if [ ! -e /var/ipcop/proxy/blacklistupdate ]; then
+    mkdir -p /var/ipcop/proxy/blacklistupdate
+    chown -R nobody:nobody /var/ipcop/proxy/blacklistupdate
+fi
 
-
 #####
 #
 # End of version specific handling. Continue with universal stuff.

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to