This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, master has been updated via 30736cd3fc24cae4487a0cdb39f2763538900ae9 (commit) via a4883c68c14fbf73474cbcf050d3d99acf5b2cfb (commit) from 7d83243a1ac89b23e95566f34335b5f189e3f57b (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 30736cd3fc24cae4487a0cdb39f2763538900ae9 Merge: a4883c68c14fbf73474cbcf050d3d99acf5b2cfb 7d83243a1ac89b23e95566f34335b5f189e3f57b Author: Christian Schmidt christian.schmidt@ipfire.org Date: Tue Jul 13 11:36:35 2010 +0200
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
commit a4883c68c14fbf73474cbcf050d3d99acf5b2cfb Author: Christian Schmidt christian.schmidt@ipfire.org Date: Tue Jul 13 11:35:00 2010 +0200
Fixed redirector schedules - This fixes bug #0000685
-----------------------------------------------------------------------
Summary of changes: html/cgi-bin/updatexlrator.cgi | 23 +++++------------------ html/cgi-bin/urlfilter.cgi | 20 ++++---------------- src/misc-progs/Makefile | 2 +- src/misc-progs/updxlratorctrl.c | 33 +++++++++++++++++++++++++++++++++ src/misc-progs/urlfilterctrl.c | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+), 35 deletions(-) create mode 100644 src/misc-progs/updxlratorctrl.c create mode 100644 src/misc-progs/urlfilterctrl.c
Difference in files: diff --git a/html/cgi-bin/updatexlrator.cgi b/html/cgi-bin/updatexlrator.cgi index 147be8e..04b7b8e 100644 --- a/html/cgi-bin/updatexlrator.cgi +++ b/html/cgi-bin/updatexlrator.cgi @@ -94,10 +94,6 @@ my @downloadfiles=();
my @metadata=();
-my $chk_cron_dly = "${General::swroot}/updatexlrator/autocheck/cron.daily"; -my $chk_cron_wly = "${General::swroot}/updatexlrator/autocheck/cron.weekly"; -my $chk_cron_mly = "${General::swroot}/updatexlrator/autocheck/cron.monthly"; - &General::readhash("${General::swroot}/ethernet/settings", %netsettings); &General::readhash("${General::swroot}/main/settings", %mainsettings); &General::readhash("${General::swroot}/proxy/settings", %proxysettings); @@ -1495,27 +1491,18 @@ END
sub savesettings { - if (-e $chk_cron_dly) { unlink($chk_cron_dly); } - if (-e $chk_cron_wly) { unlink($chk_cron_wly); } - if (-e $chk_cron_mly) { unlink($chk_cron_mly); }
if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily')) { - symlink("../bin/checkup",$chk_cron_dly) - } else { - symlink("/bin/false",$chk_cron_dly) + system('/usr/local/bin/updxlratorctrl cron daily >/dev/null 2>&1'); } - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly')) + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly')) { - symlink("../bin/checkup",$chk_cron_wly) - } else { - symlink("/bin/false",$chk_cron_wly) + system('/usr/local/bin/updxlratorctrl cron weekly >/dev/null 2>&1'); } - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly')) + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly')) { - symlink("../bin/checkup",$chk_cron_mly) - } else { - symlink("/bin/false",$chk_cron_mly) + system('/usr/local/bin/updxlratorctrl cron monthly >/dev/null 2>&1'); }
# don't save those variable to the settings file, diff --git a/html/cgi-bin/urlfilter.cgi b/html/cgi-bin/urlfilter.cgi index 6e99397..eea32bf 100644 --- a/html/cgi-bin/urlfilter.cgi +++ b/html/cgi-bin/urlfilter.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2010 Michael Tremer & Christian Schmidt # +# Copyright (C) 2005-2010 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -65,9 +65,6 @@ my $hintcolour = '#FFFFCC'; my $sourceurlfile = "${General::swroot}/urlfilter/autoupdate/autoupdate.urls"; my $updconffile = "${General::swroot}/urlfilter/autoupdate/autoupdate.conf"; my $updflagfile = "${General::swroot}/urlfilter/blacklists/.autoupdate.last"; -my $upd_cron_dly = "${General::swroot}/urlfilter/autoupdate/cron.daily"; -my $upd_cron_wly = "${General::swroot}/urlfilter/autoupdate/cron.weekly"; -my $upd_cron_mly = "${General::swroot}/urlfilter/autoupdate/cron.monthly";
my $errormessage=''; my $updatemessage=''; @@ -965,29 +962,20 @@ if ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter save schedule'}) print FILE "CUSTOM_UPDATE_URL=$filtersettings{'CUSTOM_UPDATE_URL'}\n"; close FILE;
- 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) + system('/usr/local/bin/urlfilterctrl cron daily >/dev/null 2>&1'); }
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) + system('/usr/local/bin/urlfilterctrl cron weekly >/dev/null 2>&1'); }
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) + system('/usr/local/bin/urlfilterctrl cron monthly >/dev/null 2>&1'); } } } diff --git a/src/misc-progs/Makefile b/src/misc-progs/Makefile index d4114a0..7b1e457 100644 --- a/src/misc-progs/Makefile +++ b/src/misc-progs/Makefile @@ -32,7 +32,7 @@ SUID_PROGS = setdmzholes setportfw setxtaccess \ wirelessctrl getipstat getiptstate qosctrl launch-ether-wake \ redctrl syslogdctrl extrahdctrl sambactrl upnpctrl tripwirectrl \ smartctrl clamavctrl addonctrl pakfire mpfirectrl wlanapctrl \ - setaliases + setaliases urlfilterctrl updxlratorctrl SUID_UPDX = updxsetperms
install : all diff --git a/src/misc-progs/updxlratorctrl.c b/src/misc-progs/updxlratorctrl.c new file mode 100644 index 0000000..cf58b5e --- /dev/null +++ b/src/misc-progs/updxlratorctrl.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <fcntl.h> +#include "setuid.h" + +int main(int argc, char *argv[]){ + if ( argc < 2 ){ + printf("invalid parameter(s)\n"); + return(1); + } + + if (!(initsetuid())) + exit(1); + + if (strcmp(argv[1], "cron") == 0){ + safe_system("rm /etc/fcron.*/updxlrator 2&>/dev/null"); + + if (strcmp(argv[2], "daily") == 0){ + safe_system("ln -s /var/ipfire/updatexlrator/bin/checkup /etc/fcron.daily/updxlrator"); + } else if (strcmp(argv[2], "weekly") == 0){ + safe_system("ln -s /var/ipfire/updatexlrator/bin/checkup /etc/fcron.weekly/updxlrator"); + } else if (strcmp(argv[2], "monthly") == 0){ + safe_system("ln -s /var/ipfire/updatexlrator/bin/checkup /etc/fcron.monthly/updxlrator"); + }else{ + printf("invalid parameter(s)\n"); + return(1); + } + } + return 0; +} diff --git a/src/misc-progs/urlfilterctrl.c b/src/misc-progs/urlfilterctrl.c new file mode 100644 index 0000000..6e2b306 --- /dev/null +++ b/src/misc-progs/urlfilterctrl.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <fcntl.h> +#include "setuid.h" + +int main(int argc, char *argv[]){ + if ( argc < 2 ){ + printf("invalid parameter(s)\n"); + return(1); + } + + if (!(initsetuid())) + exit(1); + + if (strcmp(argv[1], "cron") == 0){ + safe_system("rm /etc/fcron.*/urlfilter 2&>/dev/null"); + + if (strcmp(argv[2], "daily") == 0){ + safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.daily/urlfilter"); + } else if (strcmp(argv[2], "weekly") == 0){ + safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.weekly/urlfilter"); + } else if (strcmp(argv[2], "monthly") == 0){ + safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.monthly/urlfilter"); + }else{ + printf("invalid parameter(s)\n"); + return(1); + } + } + return 0; +}
hooks/post-receive -- IPFire 2.x development tree