From f2d420bb96d14d2b1e2d45d8ca3fa81afa13f871 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 30 Sep 2006 23:14:56 +0000 Subject: Use conf_mount_rw() and conf_mount_ro() --- packages/snort/snort.inc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'packages') diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc index 19660579..8773cac6 100644 --- a/packages/snort/snort.inc +++ b/packages/snort/snort.inc @@ -35,6 +35,7 @@ if($config['installedpackages']['snort']) function sync_package_snort() { global $config, $g, $snort_conf_file; + conf_mount_rw(); exec("/bin/mkdir -p /usr/local/etc/snort"); exec("/bin/mkdir -p /var/log/snort"); exec("/bin/cp /usr/local/etc/snort/unicode.map-sample /usr/local/etc/snort/unicode.map"); @@ -84,6 +85,7 @@ function sync_package_snort() { create_snort_conf(); /* start snort service */ + conf_mount_ro(); start_service("snort"); } @@ -91,6 +93,7 @@ function create_snort_conf() { global $config, $g, $snort_conf_file; /* write out snort.conf */ $snort_conf_text = generate_snort_conf(); + conf_mount_rw(); $conf = fopen($snort_conf_file, "w"); if(!$conf) { log_error("Could not open {$snort_conf_file} for writing."); @@ -98,10 +101,12 @@ function create_snort_conf() { } fwrite($conf, $snort_conf_text); fclose($conf); + conf_mount_ro(); } function generate_snort_conf() { global $config, $g, $snort_conf_file; + conf_mount_rw(); /* obtain external interface */ /* XXX: make multi wan friendly */ $snort_ext_int = $config['installedpackages']['snort']['config'][0]['iface_array'][0]; @@ -197,6 +202,8 @@ function generate_snort_conf() { $selected_rules_sections .= "include \$RULE_PATH/{$enabled_item}\n"; } + conf_mount_ro(); + /* build snort configuration file */ $snort_conf_text = <<