From be4a5f3215490c634ad1b3f6980e7ee4a308f7a3 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Thu, 9 Oct 2014 15:20:41 -0400 Subject: Check in post-install and only change filesystem to RW if necessary. --- config/snort/snort_post_install.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort_post_install.php b/config/snort/snort_post_install.php index 718d6bce..8d1588d9 100644 --- a/config/snort/snort_post_install.php +++ b/config/snort/snort_post_install.php @@ -73,6 +73,7 @@ $snortlibdir = SNORTLIBDIR; $rcdir = RCFILEPREFIX; $flowbit_rules_file = FLOWBITS_FILENAME; $snort_enforcing_rules_file = SNORT_ENFORCING_RULES_FILENAME; +$mounted_rw = FALSE; /* Hard kill any running Snort processes that may have been started by any */ /* of the pfSense scripts such as check_reload_status() or rc.start_packages */ @@ -93,8 +94,11 @@ if(is_process_running("barnyard")) { /* Set flag for post-install in progress */ $g['snort_postinstall'] = true; -/* Set Snort conf partition to read-write so we can make changes there */ -conf_mount_rw(); +/* If not already, set Snort conf partition to read-write so we can make changes there */ +if (!is_subsystem_dirty('mount')) { + conf_mount_rw(); + $mounted_rw = TRUE; +} /* cleanup default files */ @rename("{$snortdir}/snort.conf-sample", "{$snortdir}/snort.conf"); @@ -255,8 +259,9 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') { } } -/* We're finished with conf partition mods, return to read-only */ -conf_mount_ro(); +/* We're finished with conf partition mods, return to read-only if we changed it */ +if ($mounted_rw == TRUE) + conf_mount_ro(); /* If an existing Snort Dashboard Widget container is not found, */ /* then insert our default Widget Dashboard container. */ -- cgit v1.2.3