aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort-dev/snort_new.inc
diff options
context:
space:
mode:
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()
{