aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2012-07-11 20:24:15 +0000
committerErmal <eri@pfsense.org>2012-07-11 20:24:15 +0000
commitea3027e321580218f2cded644d2b5f514fb0a953 (patch)
tree6d31ea566d7d81750033a4fa82b08cd1bb36b6a8
parentabcfebde7aac2b711a198abe94ca9255465eb35f (diff)
downloadpfsense-packages-ea3027e321580218f2cded644d2b5f514fb0a953.tar.gz
pfsense-packages-ea3027e321580218f2cded644d2b5f514fb0a953.tar.bz2
pfsense-packages-ea3027e321580218f2cded644d2b5f514fb0a953.zip
Just use php functionality rather than forking to logger
-rw-r--r--config/snort/snort.inc4
-rw-r--r--config/snort/snort_interfaces.php8
2 files changed, 6 insertions, 6 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc
index ba996bac..b481b8a5 100644
--- a/config/snort/snort.inc
+++ b/config/snort/snort.inc
@@ -228,7 +228,7 @@ function snort_stop($snortcfg, $if_real) {
}
/* Log Iface stop */
- exec("/usr/bin/logger -p daemon.info -i -t SnortStartup 'Interface Rule STOP for {$snortcfg['descr']}({$snort_uuid}_{$if_real})...'");
+ log_error("Interface Rule STOP for {$snortcfg['descr']}({$snort_uuid}_{$if_real})...");
sleep(2); // Give time so GUI displays correctly
}
@@ -249,7 +249,7 @@ function snort_start($snortcfg, $if_real) {
exec("/usr/local/bin/barnyard2 -r {$snort_uuid} -f \"snort_{$snort_uuid}_{$if_real}.u2\" --pid-path {$g['varrun_path']} --nolock-pidfile -c {$snortdir}/snort_{$snort_uuid}_{$if_real}/barnyard2.conf -d /var/log/snort/snort_{$if_real}{$snort_uuid} -D -q");
/* Log Iface stop */
- exec("/usr/bin/logger -p daemon.info -i -t SnortStartup 'Interface Rule START for {$snortcfg['descr']}({$snort_uuid}_{$if_real})...'");
+ log_error("Interface Rule START for {$snortcfg['descr']}({$snort_uuid}_{$if_real})...");
sleep(2); // Give time so GUI displays correctly
}
diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php
index fe9df2ec..529ef338 100644
--- a/config/snort/snort_interfaces.php
+++ b/config/snort/snort_interfaces.php
@@ -92,15 +92,14 @@ if (isset($_POST['del_x'])) {
/* start/stop snort */
if ($_GET['act'] == 'toggle' && is_numeric($id)) {
- $if_real = snort_get_real_interface($config['installedpackages']['snortglobal']['rule'][$id]['interface']);
$snortcfg = $config['installedpackages']['snortglobal']['rule'][$id];
-
- /* Log Iface stop */
- exec("/usr/bin/logger -p daemon.info -i -t SnortStartup 'Toggle for {$snort_uuid}_{$if_real}...'");
+ $if_real = snort_get_real_interface($snortcfg['interface']);
+ $if_friendly = snort_get_friendly_interface($snortcfg['interface']);
sync_snort_package_config();
if (snort_is_running($snortcfg['uuid'], $if_real) == 'yes') {
+ log_error("Toggle(stopping) for {$if_friendly}({$snortcfg['descr']}}...");
snort_stop($snortcfg, $if_real);
header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );
@@ -110,6 +109,7 @@ if ($_GET['act'] == 'toggle' && is_numeric($id)) {
header( 'Pragma: no-cache' );
} else {
+ log_error("Toggle(starting) for {$if_friendly}({$snortcfg['descr']}}...");
snort_start($snortcfg, $if_real);
header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );