diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2013-05-21 22:02:49 -0400 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2013-05-21 22:02:49 -0400 |
commit | 00dc251878e6fc23402ba8030758e9efa215bb09 (patch) | |
tree | 6996bef8e153a3b7c1e8b1d5113c23633a83b4d8 /config/snort/snort.inc | |
parent | f169f0b0724a39ac3dd35c46b90515751c2955ed (diff) | |
download | pfsense-packages-00dc251878e6fc23402ba8030758e9efa215bb09.tar.gz pfsense-packages-00dc251878e6fc23402ba8030758e9efa215bb09.tar.bz2 pfsense-packages-00dc251878e6fc23402ba8030758e9efa215bb09.zip |
More fixes for new XMLRPC pkg sync routines.
Diffstat (limited to 'config/snort/snort.inc')
-rwxr-xr-x | config/snort/snort.inc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 46c66128..fe390a41 100755 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -857,7 +857,7 @@ function sync_snort_package_config() { /* do not start config build if rules is empty or there are no Snort settings */ if (!is_array($config['installedpackages']['snortglobal']) || !is_array($config['installedpackages']['snortglobal']['rule'])) { - exec('/bin/rm /usr/local/etc/rc.d/snort.sh'); + exec("/bin/rm /usr/local/etc/rc.d/snort.sh"); conf_mount_ro(); return; } @@ -3053,7 +3053,7 @@ function snort_sync_on_changes() { global $config, $g, $is_postinstall; /* Do not attempt a package sync while booting up or installing package */ - if ($g['booting'] || $is_postinstall == true) + if ($g['booting'] || $is_postinstall) return; if (is_array($config['installedpackages']['snortsync']['config'])){ @@ -3118,7 +3118,7 @@ function snort_do_xmlrpc_sync($syncdownloadrules, $sync_to_ip, $username, $passw global $config, $g, $is_postinstall; /* Do not attempt a package sync while booting up or installing package */ - if ($g['booting'] || $is_postinstall == true) + if ($g['booting'] || $is_postinstall) return; if(!$username || !$password || !$sync_to_ip) { @@ -3161,8 +3161,7 @@ function snort_do_xmlrpc_sync($syncdownloadrules, $sync_to_ip, $username, $passw $msg = new XML_RPC_Message($method, $params); $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port); $cli->setCredentials($username, $password); - if($g['debug']) - $cli->setDebug(1); + /* send our XMLRPC message and timeout after defined sync timeout value*/ $resp = $cli->send($msg, $synctimeout); if(!$resp) { @@ -3170,8 +3169,6 @@ function snort_do_xmlrpc_sync($syncdownloadrules, $sync_to_ip, $username, $passw log_error($error); file_notice("sync_settings", $error, "snort Settings Sync", ""); } elseif($resp->faultCode()) { - $cli->setDebug(1); - $resp = $cli->send($msg, $synctimeout); $error = "An error code was received while attempting snort XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString(); log_error($error); file_notice("sync_settings", $error, "snort Settings Sync", ""); @@ -3181,14 +3178,16 @@ function snort_do_xmlrpc_sync($syncdownloadrules, $sync_to_ip, $username, $passw $downloadrulescmd = ""; if ($syncdownloadrules == "yes") { - $downloadrulescmd = "log_error(gettext(\"[snort] XMLRPC pkg sync: Requested update of downloaded rules files...\"));\n"; + $downloadrulescmd = "log_error(gettext(\"[snort] XMLRPC pkg sync: Update of downloaded rule sets requested...\"));\n"; $downloadrulescmd .= "include_once(\"/usr/local/pkg/snort/snort_check_for_rule_updates.php\");\n"; } $snortstart = ""; if ($syncstartsnort == "ON") { - $snortstart = "log_error(gettext(\"[snort] XMLRPC pkg sync: Requested restart of Snort...\"));\n"; + $snortstart = "log_error(gettext(\"[snort] XMLRPC pkg sync: Checking Snort status...\"));\n"; $snortstart .= "if (!is_process_running(\"snort\")) {\n"; + $snortstart .= "log_error(gettext(\"[snort] XMLRPC pkg sync: Snort not running. Sending a start command...\"));\n"; $snortstart .= "exec(\"/usr/local/etc/rc.d/snort.sh start 2>&1 &\");\n}\n"; + $snortstart .= "else {log_error(gettext(\"[snort] XMLRPC pkg sync: Snort is running...\"));\n}\n"; } /* Build a series of commands for the secondary host to execute that will load the new settings. */ @@ -3224,7 +3223,6 @@ EOD; $msg = new XML_RPC_Message($method, $params); $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port); $cli->setCredentials($username, $password); - $cli->setDebug("1"); $resp = $cli->send($msg, $synctimeout); if(!$resp) { $error = "A communications error occurred while attempting snort XMLRPC sync with {$url}:{$port} (pfsense.exec_php)."; |