aboutsummaryrefslogtreecommitdiffstats
path: root/config/sudo/sudo.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-08-28 10:26:48 -0400
committerjim-p <jimp@pfsense.org>2013-08-28 10:26:48 -0400
commitca34f8ee173d3a76ad7f3af85dea6d6ae97c49db (patch)
treea06e4213adbadaea21e359c16709f0dd7ee55d33 /config/sudo/sudo.inc
parentda4fcbcca56077414bcd2927508d4c65d5faa896 (diff)
downloadpfsense-packages-ca34f8ee173d3a76ad7f3af85dea6d6ae97c49db.tar.gz
pfsense-packages-ca34f8ee173d3a76ad7f3af85dea6d6ae97c49db.tar.bz2
pfsense-packages-ca34f8ee173d3a76ad7f3af85dea6d6ae97c49db.zip
Switch to rw before doing disk write operations when syncing sudoers file.
Diffstat (limited to 'config/sudo/sudo.inc')
-rw-r--r--config/sudo/sudo.inc3
1 files changed, 3 insertions, 0 deletions
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.