aboutsummaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--config/sudo/sudo.inc3
-rw-r--r--config/sudo/sudo.xml2
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
4 files changed, 6 insertions, 3 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.
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 @@
<description>Sudo Command Control</description>
<requirements>None</requirements>
<name>sudo</name>
- <version>0.1</version>
+ <version>0.2</version>
<title>Sudo - Shell Command Privilege Delegation Utility</title>
<include_file>/usr/local/pkg/sudo.inc</include_file>
<menu>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index a54b0081..497305a2 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -1936,7 +1936,7 @@
<pkginfolink>http://doc.pfsense.org/index.php/Sudo_Package</pkginfolink>
<descr><![CDATA[sudo allows delegation of privileges to users in the shell so commands can be run as other users, such as root.]]></descr>
<category>Security</category>
- <version>0.1</version>
+ <version>0.2</version>
<status>Beta</status>
<required_version>2.0.2</required_version>
<config_file>http://www.pfsense.com/packages/config/sudo/sudo.xml</config_file>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index 12db561d..ff3c9758 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -1923,7 +1923,7 @@
<pkginfolink>http://doc.pfsense.org/index.php/Sudo_Package</pkginfolink>
<descr><![CDATA[sudo allows delegation of privileges to users in the shell so commands can be run as other users, such as root.]]></descr>
<category>Security</category>
- <version>0.1</version>
+ <version>0.2</version>
<status>Beta</status>
<required_version>2.0.2</required_version>
<config_file>http://www.pfsense.com/packages/config/sudo/sudo.xml</config_file>