From ca34f8ee173d3a76ad7f3af85dea6d6ae97c49db Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 28 Aug 2013 10:26:48 -0400 Subject: Switch to rw before doing disk write operations when syncing sudoers file. --- config/sudo/sudo.inc | 3 +++ config/sudo/sudo.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'config/sudo') diff --git a/config/sudo/sudo.inc b/config/sudo/sudo.inc index a65753a1..5ffa14c3 100644 --- a/config/sudo/sudo.inc +++ b/config/sudo/sudo.inc @@ -26,6 +26,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +require_once("config.inc"); $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); switch ($pfs_version) { @@ -71,6 +72,7 @@ function sudo_install() { function sudo_write_config() { global $config; $sudoers = ""; + conf_mount_rw(); if (!is_array($config['installedpackages']['sudo']['config'][0]['row'])) { /* No config, wipe sudoers file and bail. */ unlink(SUDO_SUDOERS); @@ -104,6 +106,7 @@ function sudo_write_config() { log_error("Sudoers file invalid: {$result}"); unlink($tmpsudoers); } + conf_mount_ro(); } /* Get a list of users and groups in a format we can use to make proper sudoers entries. diff --git a/config/sudo/sudo.xml b/config/sudo/sudo.xml index 56163abf..defca988 100644 --- a/config/sudo/sudo.xml +++ b/config/sudo/sudo.xml @@ -3,7 +3,7 @@ Sudo Command Control None sudo - 0.1 + 0.2 Sudo - Shell Command Privilege Delegation Utility /usr/local/pkg/sudo.inc -- cgit v1.2.3