diff options
-rw-r--r-- | config/bind/bind.inc | 23 | ||||
-rw-r--r-- | config/checkmk-agent/checkmk.inc | 4 | ||||
-rw-r--r-- | config/lightsquid/sqstat.class.php | 4 | ||||
-rw-r--r-- | config/phpservice/phpservice.xml | 5 | ||||
-rw-r--r-- | config/spamd/spamd.inc | 16 | ||||
-rw-r--r-- | config/spamd/spamd_db.php | 72 | ||||
-rw-r--r-- | config/spamd/spamd_settings.xml | 2 | ||||
-rw-r--r-- | pkg_config.10.xml | 8 | ||||
-rw-r--r-- | pkg_config.8.xml | 6 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 6 |
10 files changed, 76 insertions, 70 deletions
diff --git a/config/bind/bind.inc b/config/bind/bind.inc index dc4a9de9..66b16464 100644 --- a/config/bind/bind.inc +++ b/config/bind/bind.inc @@ -117,11 +117,14 @@ function bind_sync() $rndc_confgen = "/usr/local/sbin/rndc-confgen"; if (!file_exists(BIND_LOCALBASE."/etc/rndc-confgen.pfsense") && file_exists($rndc_confgen)) { exec("$rndc_confgen ", $rndc_conf); + $confgen_file = ""; foreach ($rndc_conf as $line) { $confgen_file .= "$line\n"; } file_put_contents(BIND_LOCALBASE."/etc/rndc-confgen.pfsense", $confgen_file); } + $rndc_bindconf = ""; + $rndc_file = ""; if (file_exists(BIND_LOCALBASE."/etc/rndc-confgen.pfsense")) { $rndc_conf = file(BIND_LOCALBASE."/etc/rndc-confgen.pfsense"); $confgen = "rndc.conf"; @@ -328,6 +331,7 @@ EOD; // Add Zones in View $write_config = 0; + $custom_root_zone = false; for ($x = 0; $x < sizeof($bindzone); $x++) { $zone = $bindzone[$x]; if ($zone['disabled'] == "on") { @@ -335,7 +339,7 @@ EOD; } $zonename = $zone['name']; if ($zonename == ".") { - $custom_root_zone[$i] = true; + $custom_root_zone = true; } $zonetype = $zone['type']; $zoneview = $zone['view']; @@ -436,21 +440,6 @@ EOD; $zonenameserver = $zone['nameserver']; $zoneipns = $zone['ipns']; $zonereverso = $zone['reverso']; - if ($zone['allowupdate'] == '') { - $zoneallowupdate = "none"; - } else { - $zoneallowupdate = str_replace(',', '; ', $zone['allowupdate']); - } - if ($zone['allowquery'] == '') { - $zoneallowquery = "none"; - } else { - $zoneallowquery = str_replace(',', '; ', $zone['allowquery']); - } - if ($zone['allowtransfer'] == '') { - $zoneallowtransfer = "none"; - } else { - $zoneallowtransfer = str_replace(',', '; ', $zone['allowtransfer']); - } $zone_conf = "\$TTL {$zonetll}\n;\n"; if ($zonereverso == "on") { @@ -639,7 +628,7 @@ EOD; } } } - if (!$custom_root_zone[$i]) { + if (!$custom_root_zone) { $bind_conf .= "\tzone \".\" {\n"; $bind_conf .= "\t\ttype hint;\n"; $bind_conf .= "\t\tfile \"/etc/namedb/named.root\";\n"; diff --git a/config/checkmk-agent/checkmk.inc b/config/checkmk-agent/checkmk.inc index 056a39eb..def0ae2d 100644 --- a/config/checkmk-agent/checkmk.inc +++ b/config/checkmk-agent/checkmk.inc @@ -39,7 +39,7 @@ define('ETC_RC_CONF','/etc/rc.conf.local'); function checkmk_install() { // Download latest check_mk version from head repo $checkmk_bin="/usr/local/bin/check_mk_agent"; - mwexec("fetch -o {$checkmk_bin} 'http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob_plain;f=agents/check_mk_agent.freebsd;hb=HEAD'"); + mwexec("fetch -o {$checkmk_bin} 'http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob_plain;f=agents/check_mk_agent.freebsd;hb=refs/heads/1.2.6'"); chmod($checkmk_bin,0755); sync_package_checkmk(); } @@ -69,7 +69,7 @@ function sync_package_checkmk() { $checkmk_bin="/usr/local/bin/check_mk_agent"; if (!file_exists($checkmk_bin) && $mk_config['checkmkenable']=="on"){ $error = "Check_mk-agent Binary file not found"; - log_error($error." You can manually download it using this cmd: fetch -o {$checkmk_bin} 'http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob_plain;f=agents/check_mk_agent.freebsd;hb=HEAD'"); + log_error($error." You can manually download it using this cmd: fetch -o {$checkmk_bin} 'http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob_plain;f=agents/check_mk_agent.freebsd;hb=refs/heads/1.2.6'"); file_notice("Check_mk-agent", $error, "checkmk save config", ""); return; } diff --git a/config/lightsquid/sqstat.class.php b/config/lightsquid/sqstat.class.php index 5707e051..88a5cfce 100644 --- a/config/lightsquid/sqstat.class.php +++ b/config/lightsquid/sqstat.class.php @@ -202,8 +202,12 @@ class squidstat{ } if ($connection) { # username field is avaible in Squid 2.6 stable + # peer changed to remote in Squid 3.2 or later + # me changed to local in Squid 3.2 or later if(substr($v,0,9) == "username ") $parsed["con"][$connection]["username"] = substr($v, 9); + if(substr($v,0,7) == "remote:") $parsed["con"][$connection]["peer"] = substr($v, 8); if(substr($v,0,5) == "peer:") $parsed["con"][$connection]["peer"] = substr($v, 6); + if(substr($v,0,6) == "local:") $parsed["con"][$connection]["me"] = substr($v, 7); if(substr($v,0,3) == "me:") $parsed["con"][$connection]["me"] = substr($v, 4); if(substr($v,0,4) == "uri ") $parsed["con"][$connection]["uri"] = substr($v, 4); if(substr($v,0,10) == "delay_pool") $parsed["con"][$connection]["delay_pool"] = substr($v, 11); diff --git a/config/phpservice/phpservice.xml b/config/phpservice/phpservice.xml index 44999496..eb7e670e 100644 --- a/config/phpservice/phpservice.xml +++ b/config/phpservice/phpservice.xml @@ -56,6 +56,9 @@ <rcfile>phpservice.sh</rcfile> <executable>phpservice</executable> <description>PHP run from a command line as a service.</description> + <custom_php_service_status_command> + exec("/bin/pgrep -f phpservice"); + </custom_php_service_status_command> </service> <tabs> <tab> @@ -118,4 +121,4 @@ <custom_php_deinstall_command> phpservice_deinstall_command(); </custom_php_deinstall_command> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/spamd/spamd.inc b/config/spamd/spamd.inc index 0bd29bd8..e09b2b7f 100644 --- a/config/spamd/spamd.inc +++ b/config/spamd/spamd.inc @@ -34,6 +34,13 @@ if(!function_exists("filter_configure")) function sync_package_spamd() { global $config, $g; + $pf_version = substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version < 2.2) { + $localpath = "/usr/local"; + } else { + $ARCH = php_uname("m"); + $localpath = "/usr/pbi/spamd-$ARCH/local"; + } conf_mount_rw(); config_lock(); @@ -130,8 +137,8 @@ function sync_package_spamd() { "fi\n" . "/usr/local/sbin/spamd-setup -d &\n" . "/sbin/pflogd &\n" . - "/usr/local/libexec/spamd {$greyparms}{$identifier}{$greylisting}{$maxcon}{$maxblack}{$window}{$replysmtperror} 127.0.0.1 &\n" . - "/usr/local/libexec/spamlogd\n"; + "$localpath/libexec/spamd {$greyparms}{$identifier}{$greylisting}{$maxcon}{$maxblack}{$window}{$replysmtperror} 127.0.0.1 &\n" . + "$localpath/libexec/spamlogd\n"; $stop = "/usr/bin/killall spamd-setup\n" . "/usr/bin/killall spamlogd\n" . "/usr/bin/killall spamd\n" . @@ -153,8 +160,9 @@ function sync_package_spamd() { log_error("Restart cron"); mwexec("killall -HUP cron"); log_error("Setting up spamd.conf symlink"); - mwexec("rm -f /usr/local/etc/spamd/spamd.conf"); - mwexec("ln -s /etc/spamd.conf /usr/local/etc/spamd/spamd.conf"); + unlink_if_exists("$localpath/etc/spamd/spamd.conf"); + symlink("/etc/spamd.conf", "$localpath/etc/spamd/spamd.conf"); + log_error("Stopping spamd"); mwexec("/usr/local/etc/rc.d/spamd.sh stop"); sleep(1); diff --git a/config/spamd/spamd_db.php b/config/spamd/spamd_db.php index c2df25d1..e1d004f7 100644 --- a/config/spamd/spamd_db.php +++ b/config/spamd/spamd_db.php @@ -30,6 +30,10 @@ require("guiconfig.inc"); +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) + $one_two = true; + if($_POST['filter']) $filter = $_POST['filter']; if($_POST['not']) @@ -39,6 +43,13 @@ if($_POST['limit']) else $limit = "25"; +if($_GET['spamtrapemail']) + $spamtrapemail = $_GET['spamtrapemail']; +if($_POST['spamtrapemail']) + $spamtrapemail = $_POST['spamtrapemail']; +if ($spamtrapemail) + $spamtrapemailarg = escapeshellarg($spamtrapemail); + /* handle AJAX operations */ if($_GET['action'] or $_POST['action']) { /* echo back buttonid so it can be turned @@ -46,60 +57,52 @@ if($_GET['action'] or $_POST['action']) { */ echo $_GET['buttonid'] . "|"; if($_GET['action']) - $action = escapeshellarg($_GET['action']); + $action = $_GET['action']; if($_POST['action']) - $action = escapeshellarg($_POST['action']); + $action = $_POST['action']; if($_GET['srcip']) $srcip = $_GET['srcip']; if($_POST['srcip']) $srcip = $_POST['srcip']; - if($_POST['toaddress']) - $toaddress = escapeshellarg($_POST['toaddress']); $srcip = str_replace("<","",$srcip); $srcip = str_replace(">","",$srcip); $srcip = str_replace(" ","",$srcip); // Make input safe $srcip = escapeshellarg($srcip); /* execute spamdb command */ - if($action == "'whitelist'") { - exec("/usr/local/sbin/spamdb -d {$srcip}"); + if($action == "whitelist") { exec("/usr/local/sbin/spamdb -d {$srcip} -T"); exec("/usr/local/sbin/spamdb -d {$srcip} -t"); delete_from_blacklist($srcip); mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); exec("echo spamdb -a {$srcip} > /tmp/tmp"); exec("/usr/local/sbin/spamdb -a {$srcip}"); - } else if($action == "'delete'") { + } else if($action == "delete") { exec("/usr/local/sbin/spamdb -d {$srcip}"); exec("/usr/local/sbin/spamdb -d {$srcip} -T"); exec("/usr/local/sbin/spamdb -d {$srcip} -t"); delete_from_blacklist($srcip); mwexec("/sbin/pfctl -q -t spamd -T delete $srcip"); mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); - } else if($action == "'spamtrap'") { + } else if($action == "trapped") { exec("/usr/local/sbin/spamdb -d {$srcip}"); - exec("/usr/local/sbin/spamdb -d {$srcip} -T"); - exec("/usr/local/sbin/spamdb -d {$srcip} -t"); - exec("/usr/local/sbin/spamdb -a {$srcip} -T"); - } else if($action == "'trapped'") { - exec("/usr/local/sbin/spamdb -T -d {$toaddress}"); - exec("/usr/local/sbin/spamdb -T -a '{$toaddress}'"); + exec("/usr/local/sbin/spamdb -d {$srcip}"); + exec("/usr/local/sbin/spamdb -d -t {$srcip}"); + exec("/usr/local/sbin/spamdb -a -t {$srcip}"); + } else if($action == "spamtrap") { + exec("/usr/local/sbin/spamdb -a -T {$spamtrapemailarg}"); } /* signal a reload for real time effect. */ mwexec("killall -HUP spamlogd"); exit; } -/* spam trap e-mail address */ -if($_POST['spamtrapemail'] <> "") { - $spamtrapemail = escapeshellarg($_POST['spamtrapemail']); - exec("/usr/local/sbin/spamdb -d {$spamtrapemail}"); - exec("/usr/local/sbin/spamdb -d -T {$spamtrapemail}"); - exec("/usr/local/sbin/spamdb -d -t {$spamtrapemail}"); - exec("/usr/local/sbin/spamdb -T -a '{$toaddress}'"); +/* spam trap e-mail address */ +if($spamtrapemail <> "") { + exec("spamdb -T -a {$spamtrapemailarg}"); mwexec("killall -HUP spamlogd"); - $savemsg = htmlentities($_POST['spamtrapemail']) . " added to spam trap database."; + $savemsg = htmlentities($spamtrapemail) . " added to spam trap database."; } if($_GET['getstatus'] <> "") { @@ -120,8 +123,7 @@ if($_GET['getstatus'] <> "") { /* spam trap e-mail address */ if($_GET['spamtrapemail'] <> "") { - $spamtrapemail = escapeshellarg($_GET['spamtrapemail']); - $status = exec("spamdb -T -a {$spamtrapemail}"); + $status = exec("spamdb -T -a {$spamtrapemailarg}"); mwexec("killall -HUP spamlogd"); if($status) echo $status; @@ -144,7 +146,7 @@ if($_GET['whitelist'] <> "") { function delete_from_blacklist($srcip) { config_lock(); - $blacklist = split("\n", file_get_contents("/var/db/blacklist.txt")); + $blacklist = explode("\n", file_get_contents("/var/db/blacklist.txt")); $fd = fopen("/var/db/blacklist.txt", "w"); foreach($blacklist as $bl) { if($bl <> "") @@ -159,7 +161,7 @@ function delete_from_blacklist($srcip) { function delete_from_whitelist($srcip) { config_lock(); - $whitelist = split("\n", file_get_contents("/var/db/whitelist.txt")); + $whitelist = explode("\n", file_get_contents("/var/db/whitelist.txt")); $fd = fopen("/var/db/whitelist.txt", "w"); foreach($whitelist as $wl) { if($wl <> "") @@ -200,7 +202,9 @@ $blacklist_items = $blacklist_items + $spamdb_black; ?> <body link="#000000" vlink="#000000" alink="#000000"> <?php include("fbegin.inc"); ?> +<?php if($one_two): ?> <p class="pgtitle"><?=$pgtitle?></font></p> +<?php endif; ?> <form action="spamd_db.php" method="post" name="iform"> <script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script> <script src="/javascript/scriptaculous/scriptaculous.js" type="text/javascript"></script> @@ -323,25 +327,23 @@ if (typeof getURL == 'undefined') { if($filter) { if($not) { $fd = fopen("/tmp/spamdb", "w"); - $cmd = "/usr/local/sbin/spamdb | grep -v \"" . escapeshellarg($filter) . "\" | tail -n {$limit}"; + $cmd = "/usr/local/sbin/spamdb | grep -v " . escapeshellarg($filter) . " | tail -n {$limit}"; fwrite($fd, $cmd); fclose($fd); - $pkgdb = split("\n", `$cmd`); + exec($cmd, $pkgdb); if(file_exists("/var/db/blacklist.txt")) { $cmd = "cat /var/db/blacklist.txt | grep -v \"" . escapeshellarg($filter) . "\" "; - $pkgdba = split("\n", `$cmd`); + exec($cmd, $pkgdba); foreach($pkgdba as $pkg) { $pkgdb[] = "TRAPPED|{$pkg}|1149324397"; } } } else { - $cmd = "/usr/local/sbin/spamdb | grep " . escapeshellarg($filter) . " | tail -n {$limit}"; - - $pkgdb = split("\n", `$cmd`); + exec($cmd, $pkgdb); if(file_exists("/var/db/blacklist.txt")) { $cmd = "cat /var/db/blacklist.txt | grep " . escapeshellarg($filter); - $pkgdba = split("\n", `$cmd`); + exec($cmd, $pkgdba); foreach($pkgdba as $pkg) { $pkgdb[] = "TRAPPED|{$pkg}|1149324397"; } @@ -349,7 +351,7 @@ if (typeof getURL == 'undefined') { } } } else { - $pkgdb = split("\n", `/usr/local/sbin/spamdb | tail -n {$limit}`); + exec("/usr/local/sbin/spamdb | tail -n {$limit}", $pkgdb); } $rows = 0; $lastseenip = ""; @@ -361,7 +363,7 @@ if (typeof getURL == 'undefined') { $dontdisplay = false; if(!$pkgdb_row) continue; - $pkgdb_split = split("\|", $pkgdb_row); + $pkgdb_split = explode("|", $pkgdb_row); /* diff --git a/config/spamd/spamd_settings.xml b/config/spamd/spamd_settings.xml index 7ed4c572..3fdab415 100644 --- a/config/spamd/spamd_settings.xml +++ b/config/spamd/spamd_settings.xml @@ -43,7 +43,7 @@ <faq>Currently there are no FAQ items provided.</faq> <name>spamdsettings</name> <version>1.1.1</version> - <title>SpamD Settings</title> + <title>SpamD: Settings</title> <aftersaveredirect>pkg_edit.php?xml=spamd_settings.xml&id=0</aftersaveredirect> <include_file>/usr/local/pkg/spamd.inc</include_file> <!-- Menu is where this packages menu will appear --> diff --git a/pkg_config.10.xml b/pkg_config.10.xml index b4579854..6e35c82a 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -302,7 +302,7 @@ <category>Services</category> <pkginfolink>https://doc.pfsense.org/index.php/PHPService</pkginfolink> <config_file>https://packages.pfsense.org/packages/config/phpservice/phpservice.xml</config_file> - <version>0.4.1</version> + <version>0.4.2</version> <status>Beta</status> <required_version>2.2</required_version> <maintainer>markjcrane@gmail.com</maintainer> @@ -399,7 +399,7 @@ <category>Services</category> <config_file>https://packages.pfsense.org/packages/config/spamd/spamd.xml</config_file> <depends_on_package_pbi>spamd-4.9.1_2-##ARCH##.pbi</depends_on_package_pbi> - <version>4.9.1_2 v1.1.1</version> + <version>4.9.1_2 v1.1.2</version> <status>Beta</status> <required_version>2.2</required_version> <configurationfile>spamd.xml</configurationfile> @@ -511,7 +511,7 @@ <descr>High performance web proxy report (LightSquid). Proxy realtime stat (SQStat). Requires squid HTTP proxy.</descr> <website>http://lightsquid.sf.net/</website> <category>Network Report</category> - <version>1.8.2 pkg v.2.35</version> + <version>1.8.2 pkg v.2.36</version> <maintainer>dv_serg@mail.ru</maintainer> <depends_on_package_pbi>lightsquid-1.8_2-##ARCH##.pbi</depends_on_package_pbi> <build_pbi> @@ -1156,7 +1156,7 @@ </build_pbi> <build_options></build_options> <config_file>https://packages.pfsense.org/packages/config/checkmk-agent/checkmk.xml</config_file> - <version>v0.1.1</version> + <version>v0.1.2</version> <status>RC1</status> <required_version>2.2</required_version> <maintainer>marcellocoutinho@gmail.com</maintainer> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index d6c93c05..5251bb19 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -431,7 +431,7 @@ <pkginfolink>https://doc.pfsense.org/index.php/PHPService</pkginfolink> <config_file>https://packages.pfsense.org/packages/config/phpservice/phpservice.xml</config_file> <depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url> - <version>0.4.1</version> + <version>0.4.2</version> <status>Beta</status> <required_version>1.2.1</required_version> <maintainer>markjcrane@gmail.com</maintainer> @@ -534,7 +534,7 @@ <depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url> <depends_on_package>spamd-4.9.1.tbz</depends_on_package> <depends_on_package_pbi>spamd-4.9.1-i386.pbi</depends_on_package_pbi> - <version>4.9.1 v1.1.1</version> + <version>4.9.1 v1.1.2</version> <status>Beta</status> <required_version>1.2.1</required_version> <configurationfile>spamd.xml</configurationfile> @@ -1588,7 +1588,7 @@ </build_pbi> <build_options></build_options> <config_file>https://packages.pfsense.org/packages/config/checkmk-agent/checkmk.xml</config_file> - <version>v0.1.1</version> + <version>v0.1.2</version> <status>RC1</status> <required_version>2.0</required_version> <maintainer>marcellocoutinho@gmail.com</maintainer> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 3b728b0f..ac0df460 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -418,7 +418,7 @@ <pkginfolink>https://doc.pfsense.org/index.php/PHPService</pkginfolink> <config_file>https://packages.pfsense.org/packages/config/phpservice/phpservice.xml</config_file> <depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url> - <version>0.4.1</version> + <version>0.4.2</version> <status>Beta</status> <required_version>1.2.1</required_version> <maintainer>markjcrane@gmail.com</maintainer> @@ -521,7 +521,7 @@ <depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url> <depends_on_package>spamd-4.9.1.tbz</depends_on_package> <depends_on_package_pbi>spamd-4.9.1-amd64.pbi</depends_on_package_pbi> - <version>4.9.1 v1.1.1</version> + <version>4.9.1 v1.1.2</version> <status>Beta</status> <required_version>1.2.1</required_version> <configurationfile>spamd.xml</configurationfile> @@ -1575,7 +1575,7 @@ </build_pbi> <build_options></build_options> <config_file>https://packages.pfsense.org/packages/config/checkmk-agent/checkmk.xml</config_file> - <version>v0.1.1</version> + <version>v0.1.2</version> <status>RC1</status> <required_version>2.0</required_version> <maintainer>marcellocoutinho@gmail.com</maintainer> |