aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-07-26 17:40:56 -0400
committerjim-p <jimp@pfsense.org>2010-07-26 17:41:35 -0400
commit51a26b70e32f92b3600aa51cbbca5d4a06d63b70 (patch)
tree3873da8484d2a616a53e627e638ed325368aa49d
parent8bd03e07aa0c54eb3f1334a82e2699d7958d2891 (diff)
downloadpfsense-packages-51a26b70e32f92b3600aa51cbbca5d4a06d63b70.tar.gz
pfsense-packages-51a26b70e32f92b3600aa51cbbca5d4a06d63b70.tar.bz2
pfsense-packages-51a26b70e32f92b3600aa51cbbca5d4a06d63b70.zip
Fix snort rule downloads. Version bump of Snort package.
-rw-r--r--config/snort/snort.xml4
-rw-r--r--config/snort/snort_download_rules.php38
-rwxr-xr-xpkg_config.7.xml2
-rwxr-xr-xpkg_config.8.xml2
4 files changed, 38 insertions, 8 deletions
diff --git a/config/snort/snort.xml b/config/snort/snort.xml
index a63cc8f2..276fc3d4 100644
--- a/config/snort/snort.xml
+++ b/config/snort/snort.xml
@@ -46,8 +46,8 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>Snort</name>
- <version>2.8.5.3</version>
- <title>Services: Snort 2.8.5.2 pkg v. 1.19</title>
+ <version>2.8.6</version>
+ <title>Services:2.8.6 pkg v. 1.30</title>
<include_file>/usr/local/pkg/snort/snort.inc</include_file>
<menu>
<name>Snort</name>
diff --git a/config/snort/snort_download_rules.php b/config/snort/snort_download_rules.php
index 78334f8e..b299bed8 100644
--- a/config/snort/snort_download_rules.php
+++ b/config/snort/snort_download_rules.php
@@ -391,7 +391,7 @@ if ($snortdownload == "basic" || $snortdownload == "premium")
} else {
update_status(gettext("Downloading snort.org md5 file..."));
ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 6.0)');
- $image = @file_get_contents("http://dl.snort.org/{$premium_url}/snortrules-snapshot-2860{$premium_subscriber}.tar.gz.md5?oink_code={$oinkid}");
+ $image = @file_get_contents("http://www.snort.org/{$premium_url}/snortrules-snapshot-2860.tar.gz.md5/{$oinkid}");
// $image = @file_get_contents("http://www.mtest.local/pub-bin/oinkmaster.cgi/{$oinkid}/snortrules-snapshot-2.8{$premium_subscriber}.tar.gz.md5");
$f = fopen("{$tmpfname}/snortrules-snapshot-2.8.tar.gz.md5", 'w');
fwrite($f, $image);
@@ -613,7 +613,7 @@ if ($snortdownload != "off")
update_status(gettext("There is a new set of Snort.org rules posted. Downloading..."));
update_output_window(gettext("May take 4 to 10 min..."));
// download_file_with_progress_bar("http://www.mtest.local/pub-bin/oinkmaster.cgi/{$oinkid}/snortrules-snapshot-2.8{$premium_subscriber}.tar.gz", $tmpfname . "/{$snort_filename}", "read_body_firmware");
- download_file_with_progress_bar("http://dl.snort.org/{$premium_url}/snortrules-snapshot-2860{$premium_subscriber}.tar.gz?oink_code={$oinkid}", $tmpfname . "/{$snort_filename}", "read_body_firmware");
+ snort_download_file_with_progress_bar("http://www.snort.org/{$premium_url}/snortrules-snapshot-2860.tar.gz/{$oinkid}", $tmpfname . "/{$snort_filename}", "read_body_firmware");
update_all_status($static_output);
update_status(gettext("Done downloading rules file."));
if (150000 > filesize("{$tmpfname}/$snort_filename")){
@@ -646,7 +646,7 @@ if ($emergingthreats == "on")
update_status(gettext("There is a new set of Emergingthreats rules posted. Downloading..."));
update_output_window(gettext("May take 4 to 10 min..."));
// download_file_with_progress_bar("http://www.mtest.local/pub-bin/oinkmaster.cgi/{$oinkid}/emerging.rules.tar.gz", $tmpfname . "/{$emergingthreats_filename}", "read_body_firmware");
- download_file_with_progress_bar("http://www.emergingthreats.net/rules/emerging.rules.tar.gz", $tmpfname . "/{$emergingthreats_filename}", "read_body_firmware");
+ snort_download_file_with_progress_bar("http://www.emergingthreats.net/rules/emerging.rules.tar.gz", $tmpfname . "/{$emergingthreats_filename}", "read_body_firmware");
update_all_status($static_output);
update_status(gettext("Done downloading Emergingthreats rules file."));
}
@@ -662,7 +662,7 @@ if (file_exists("{$tmpfname}/{$pfsense_rules_filename}")) {
update_status(gettext("There is a new set of Pfsense rules posted. Downloading..."));
update_output_window(gettext("May take 4 to 10 min..."));
// download_file_with_progress_bar("http://www.mtest.local/pub-bin/oinkmaster.cgi/{$oinkid}/pfsense_rules.tar.gz", $tmpfname . "/{$pfsense_rules_filename}", "read_body_firmware");
- download_file_with_progress_bar("http://www.pfsense.com/packages/config/snort/pfsense_rules/pfsense_rules.tar.gz", $tmpfname . "/{$pfsense_rules_filename}", "read_body_firmware");
+ snort_download_file_with_progress_bar("http://www.pfsense.com/packages/config/snort/pfsense_rules/pfsense_rules.tar.gz", $tmpfname . "/{$pfsense_rules_filename}", "read_body_firmware");
update_all_status($static_output);
update_status(gettext("Done downloading rules file."));
}
@@ -1149,6 +1149,36 @@ function read_body_firmware($ch, $string) {
return $length;
}
+function snort_download_file_with_progress_bar($url_file, $destination_file, $readbody = 'read_body') {
+ global $ch, $fout, $file_size, $downloaded;
+ $file_size = 1;
+ $downloaded = 1;
+ /* open destination file */
+ $fout = fopen($destination_file, "wb");
+
+ /*
+ * Originally by Author: Keyvan Minoukadeh
+ * Modified by Scott Ullrich to return Content-Length size
+ */
+
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url_file);
+ curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'read_header');
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($ch, CURLOPT_WRITEFUNCTION, $readbody);
+ curl_setopt($ch, CURLOPT_NOPROGRESS, '1');
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, '5');
+ curl_setopt($ch, CURLOPT_TIMEOUT, 0);
+
+ curl_exec($ch);
+ $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ if($fout)
+ fclose($fout);
+ curl_close($ch);
+ return ($http_code == 200) ? true : $http_code;
+}
+
?>
</body>
diff --git a/pkg_config.7.xml b/pkg_config.7.xml
index fbb64d66..ab70e1b8 100755
--- a/pkg_config.7.xml
+++ b/pkg_config.7.xml
@@ -410,7 +410,7 @@
<depends_on_package>mysql-client-5.1.44_1.tbz</depends_on_package>
<depends_on_package>snort-2.8.6_1.tbz</depends_on_package>
<config_file>http://www.pfsense.com/packages/config/snort/snort.xml</config_file>
- <version>2.8.6 pkg v. 1.27</version>
+ <version>2.8.6 pkg v. 1.30</version>
<required_version>1.2.3</required_version>
<status>Stable</status>
<configurationfile>/snort.xml</configurationfile>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 93fd79a8..b5bc7b31 100755
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -306,7 +306,7 @@
<build_port_path>/usr/ports/databases/mysql51-client</build_port_path>
<build_port_path>/usr/ports/security/snort</build_port_path>
<config_file>http://www.pfsense.com/packages/config/snort/snort.xml</config_file>
- <version>2.8.6 pkg v. 1.27</version>
+ <version>2.8.6 pkg v. 1.30</version>
<required_version>2.0</required_version>
<status>Stable</status>
<configurationfile>/snort.xml</configurationfile>