aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort-dev/snort_new.inc
diff options
context:
space:
mode:
authorrobiscool <robrob2626@yahoo.com>2011-07-22 11:43:29 -0700
committerrobiscool <robrob2626@yahoo.com>2011-07-22 11:43:29 -0700
commite042d18d244832f0c6fa3ce44c175346eb5bef6b (patch)
tree5380ff77629c8d6a8a486c57e23d8ce5aa43971c /config/snort-dev/snort_new.inc
parent34f159bb62fed61fefef59cd89c1a492545c8929 (diff)
downloadpfsense-packages-e042d18d244832f0c6fa3ce44c175346eb5bef6b.tar.gz
pfsense-packages-e042d18d244832f0c6fa3ce44c175346eb5bef6b.tar.bz2
pfsense-packages-e042d18d244832f0c6fa3ce44c175346eb5bef6b.zip
snort-dev, jQuery update call backs, update rule db tab
Diffstat (limited to 'config/snort-dev/snort_new.inc')
-rw-r--r--config/snort-dev/snort_new.inc25
1 files changed, 25 insertions, 0 deletions
diff --git a/config/snort-dev/snort_new.inc b/config/snort-dev/snort_new.inc
index ffc88348..bba9b93d 100644
--- a/config/snort-dev/snort_new.inc
+++ b/config/snort-dev/snort_new.inc
@@ -61,6 +61,31 @@ if (file_exists('/usr/local/pkg/snort/snortDBtemp')) {
exec('/bin/cp /usr/local/pkg/snort/snortDBtemp /var/snort/snortDBtemp');
}
+/*
+* make dir for the new iface, if iface exists or rule dir has changed redo soft link
+*/
+function snortRulesCreateSoftlink()
+{
+ $newSnortDir = 'sn_' . $_POST['uuid'];
+ $pathToSnortDir = '/usr/local/etc/snort';
+
+ // change the rule path
+ if (is_dir("{$pathToSnortDir}/{$newSnortDir}")) {
+
+ $snortCurrentRuleDbName = snortSql_fetchAllSettings('snortDB', 'snortIfaces', 'uuid', $_POST['uuid']);
+
+ if ($_POST['ruledbname'] !== $snortCurrentRuleDbName['ruledbname'] || !file_exists("{$pathToSnortDir}/{$newSnortDir}/rules")) {
+
+ // NOTE: use full paths or link rm will not work, Freebsd love
+ exec("/bin/rm {$pathToSnortDir}/{$newSnortDir}/rules");
+ exec("/bin/ln -s /usr/local/etc/snort/snortDBrules/DB/{$_POST['ruledbname']}/rules {$pathToSnortDir}/{$newSnortDir}/rules");
+
+ }
+
+ }
+}
+
+
// Wites selected sig to file
function snortSidStringRuleEditGUI()
{