diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-11 11:53:10 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-11 11:53:10 -0300 |
commit | 3faf4d8c63981742cf7d6a99c41c9e39d815db0d (patch) | |
tree | 655166f28159c9630a5c13e078f7aa54411cd6c7 /config | |
parent | c0ab8887bdfff3064351e598840bdce35a174fbd (diff) | |
parent | 0767305b6d3ba9725d138d6cd8d65fe610e85201 (diff) | |
download | pfsense-packages-3faf4d8c63981742cf7d6a99c41c9e39d815db0d.tar.gz pfsense-packages-3faf4d8c63981742cf7d6a99c41c9e39d815db0d.tar.bz2 pfsense-packages-3faf4d8c63981742cf7d6a99c41c9e39d815db0d.zip |
Merge pull request #989 from doktornotor/patch-2
Diffstat (limited to 'config')
-rw-r--r-- | config/cron/cron.inc | 2 | ||||
-rw-r--r-- | config/filemgr/filemgr.inc | 4 | ||||
-rwxr-xr-x | config/haproxy-legacy/haproxy_global.php | 2 | ||||
-rwxr-xr-x | config/haproxy/haproxy_global.php | 2 | ||||
-rw-r--r-- | config/phpservice/phpservice.inc | 11 | ||||
-rw-r--r-- | config/phpsysinfo/phpsysinfo.inc | 4 | ||||
-rw-r--r-- | config/shellcmd/shellcmd.inc | 23 | ||||
-rw-r--r-- | config/spamd/spamd.inc | 5 | ||||
-rw-r--r-- | config/spamd/spamd_db.php | 4 | ||||
-rw-r--r-- | config/tinc/tinc.inc | 6 | ||||
-rw-r--r-- | config/vhosts/vhosts.inc | 7 |
11 files changed, 7 insertions, 63 deletions
diff --git a/config/cron/cron.inc b/config/cron/cron.inc index 0c7c6769..a457cf58 100644 --- a/config/cron/cron.inc +++ b/config/cron/cron.inc @@ -61,7 +61,6 @@ function cron_install_command() { global $config; conf_mount_rw(); - config_lock(); //write_config(); @@ -79,7 +78,6 @@ function cron_install_command() { //} conf_mount_ro(); - config_unlock(); } diff --git a/config/filemgr/filemgr.inc b/config/filemgr/filemgr.inc index 56d34a60..64186637 100644 --- a/config/filemgr/filemgr.inc +++ b/config/filemgr/filemgr.inc @@ -35,7 +35,6 @@ function php_install_command_fm() global $config; conf_mount_rw(); - config_lock(); if (!is_dir('/usr/local/www/packages/')) { exec("mkdir /usr/local/www/packages/"); @@ -132,7 +131,6 @@ function php_install_command_fm() conf_mount_ro(); - config_unlock(); } @@ -151,4 +149,4 @@ function deinstall_command_fm() conf_mount_ro(); } -?>
\ No newline at end of file +?> diff --git a/config/haproxy-legacy/haproxy_global.php b/config/haproxy-legacy/haproxy_global.php index 4ea03c75..59d26503 100755 --- a/config/haproxy-legacy/haproxy_global.php +++ b/config/haproxy-legacy/haproxy_global.php @@ -46,9 +46,7 @@ if ($_POST) { if ($_POST['apply']) { $retval = 0; - config_lock(); $retval = haproxy_configure(); - config_unlock(); $savemsg = get_std_save_message($retval); unlink_if_exists($d_haproxyconfdirty_path); } else { diff --git a/config/haproxy/haproxy_global.php b/config/haproxy/haproxy_global.php index 40b5cd90..5ea4010c 100755 --- a/config/haproxy/haproxy_global.php +++ b/config/haproxy/haproxy_global.php @@ -45,9 +45,7 @@ if ($_POST) { if ($_POST['apply']) { $retval = 0; - config_lock(); $retval = haproxy_configure(); - config_unlock(); $savemsg = get_std_save_message($retval); unlink_if_exists($d_haproxyconfdirty_path); } else { diff --git a/config/phpservice/phpservice.inc b/config/phpservice/phpservice.inc index 6236d0b6..ec2b9bef 100644 --- a/config/phpservice/phpservice.inc +++ b/config/phpservice/phpservice.inc @@ -67,8 +67,7 @@ function phpservice_sync_package_php() if($config['installedpackages']['phpservice']['config'] != "") { conf_mount_rw(); - config_unlock(); - + $tmp = "<?php\n"; $tmp .= "\n"; $tmp .= "// Set time limit to indefinite execution\n"; @@ -169,7 +168,6 @@ function phpservice_install_command() global $config; conf_mount_rw(); - config_lock(); if (!is_dir('/usr/local/www/packages/')) { exec("mkdir /usr/local/www/packages/"); @@ -205,8 +203,7 @@ function phpservice_install_command() //} conf_mount_ro(); - config_unlock(); - + } @@ -214,15 +211,13 @@ function phpservice_deinstall_command() { conf_mount_rw(); - config_lock(); $handle = popen("/usr/local/etc/rc.d/phpservice.sh stop", "r"); unlink_if_exists("/usr/local/pkg/phpservice.xml"); unlink_if_exists("/usr/local/pkg/phpservice.inc"); unlink_if_exists("/usr/local/www/phpservice.inc"); unlink_if_exists("/usr/local/etc/rc.d/phpservice.sh"); conf_mount_ro(); - config_unlock(); - + } ?> diff --git a/config/phpsysinfo/phpsysinfo.inc b/config/phpsysinfo/phpsysinfo.inc index f6b8d264..54ece241 100644 --- a/config/phpsysinfo/phpsysinfo.inc +++ b/config/phpsysinfo/phpsysinfo.inc @@ -1,17 +1,14 @@ <?php function phpsysinfo_install_deinstall() { conf_mount_rw(); - config_lock(); exec("cd /var/db/pkg/ && pkg_delete `ls | grep mbmon`"); exec("rm -d -R /usr/local/www/phpsysinfo"); conf_mount_ro(); - config_unlock(); } function phpsysinfo_install_config() { global $config, $g; conf_mount_rw(); - config_lock(); exec("cd .."); exec("tar -zxovf /usr/local/pkg/phpsysinfo-2.5.4.tar.gz"); exec("mv phpsysinfo /usr/local/www/phpsysinfo"); @@ -155,6 +152,5 @@ fwrite($hf, '?>'); fwrite($hf, "\n"); fclose($hf); conf_mount_ro(); - config_unlock(); } ?> diff --git a/config/shellcmd/shellcmd.inc b/config/shellcmd/shellcmd.inc index c5020d5f..04cbf3d6 100644 --- a/config/shellcmd/shellcmd.inc +++ b/config/shellcmd/shellcmd.inc @@ -69,26 +69,9 @@ function shellcmd_install_command() global $config; conf_mount_rw(); - config_lock(); - - //write_config(); - - //write_rcfile(array( - // "file" => "shellcmd.sh", - // "start" => "/usr/sbin/shellcmd -s &", - // "stop" => "kill -9 `cat /var/run/shellcmd.pid`" - // ) - //); - shellcmd_sync_package(); - - //if (pkg_is_service_running('shellcmd')) { - //documentation purposes - //} - conf_mount_ro(); - config_unlock(); - + } @@ -96,12 +79,10 @@ function shellcmd_deinstall_command() { conf_mount_rw(); - config_lock(); $handle = popen("/usr/local/etc/rc.d/shellcmd.sh stop", "r"); //unlink_if_exists("/usr/local/etc/rc.d/shellcmd.sh"); conf_mount_ro(); - config_unlock(); - + } ?> diff --git a/config/spamd/spamd.inc b/config/spamd/spamd.inc index 71f20106..bbfae23e 100644 --- a/config/spamd/spamd.inc +++ b/config/spamd/spamd.inc @@ -43,7 +43,6 @@ function sync_package_spamd() { } conf_mount_rw(); - config_lock(); $fd = fopen("/etc/spamd.conf","w"); /* all header */ fwrite($fd, "all:\\\n\t:whitelist:blacklist"); @@ -155,8 +154,6 @@ function sync_package_spamd() { spamd_install_cron(true); log_error("Mounting RO"); conf_mount_ro(); - log_error("Unlocking config"); - config_unlock(); log_error("Restart cron"); mwexec("killall -HUP cron"); log_error("Setting up spamd.conf symlink"); @@ -176,7 +173,6 @@ function sync_package_spamd() { function sync_package_spamd_whitelist() { global $config; conf_mount_rw(); - config_lock(); /* write out ip to the whitelist db */ $fd = fopen("/var/db/whitelist.txt","w"); if($config['installedpackages']['spamdwhitelist']['config'] != "") { @@ -189,7 +185,6 @@ function sync_package_spamd_whitelist() { mwexec("/usr/bin/killall -HUP spamlogd"); mwexec("/sbin/pfctl -t spamd-white -T add {$spamd['ip']}"); conf_mount_ro(); - config_unlock(); } function spamd_generate_rules($type) { diff --git a/config/spamd/spamd_db.php b/config/spamd/spamd_db.php index e1d004f7..83601805 100644 --- a/config/spamd/spamd_db.php +++ b/config/spamd/spamd_db.php @@ -145,7 +145,6 @@ if($_GET['whitelist'] <> "") { } function delete_from_blacklist($srcip) { - config_lock(); $blacklist = explode("\n", file_get_contents("/var/db/blacklist.txt")); $fd = fopen("/var/db/blacklist.txt", "w"); foreach($blacklist as $bl) { @@ -156,11 +155,9 @@ function delete_from_blacklist($srcip) { fclose($fd); mwexec("/sbin/pfctl -q -t spamd -T delete {$srcip}"); mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); - config_unlock(); } function delete_from_whitelist($srcip) { - config_lock(); $whitelist = explode("\n", file_get_contents("/var/db/whitelist.txt")); $fd = fopen("/var/db/whitelist.txt", "w"); foreach($whitelist as $wl) { @@ -171,7 +168,6 @@ function delete_from_whitelist($srcip) { fclose($fd); mwexec("/sbin/pfctl -q -t spamd -T delete $srcip"); mwexec("/sbin/pfctl -q -t whitelist -T replace -f /var/db/whitelist.txt"); - config_unlock(); } $pgtitle = "SpamD: Database"; diff --git a/config/tinc/tinc.inc b/config/tinc/tinc.inc index 717ce967..82d5b453 100644 --- a/config/tinc/tinc.inc +++ b/config/tinc/tinc.inc @@ -26,7 +26,6 @@ if (!function_exists('clear_log_file')) { function tinc_save() { global $config; conf_mount_rw(); - config_lock(); exec("/bin/mv -f /usr/local/etc/tinc /usr/local/etc/tinc.old"); safe_mkdir("/usr/local/etc/tinc"); safe_mkdir("/usr/local/etc/tinc/hosts"); @@ -127,7 +126,6 @@ function tinc_save() { rmdir_recursive("/usr/local/etc/tinc.old"); conf_mount_ro(); - config_unlock(); } function tinc_install() { @@ -142,7 +140,6 @@ function tinc_install() { clear_log_file("/var/log/tinc.log"); conf_mount_rw(); - config_lock(); /* Create Interface Group */ if (!is_array($config['ifgroups']['ifgroupentry'])) @@ -161,14 +158,12 @@ function tinc_install() { write_config(); conf_mount_ro(); - config_unlock(); } function tinc_deinstall() { global $config; /* Remove Interface Group */ conf_mount_rw(); - config_lock(); if (!is_array($config['ifgroups']['ifgroupentry'])) $config['ifgroups']['ifgroupentry'] = array(); @@ -200,7 +195,6 @@ function tinc_deinstall() { write_config(); } conf_mount_ro(); - config_unlock(); rmdir_recursive("/var/tmp/tinc"); rmdir_recursive("/usr/local/etc/tinc*"); diff --git a/config/vhosts/vhosts.inc b/config/vhosts/vhosts.inc index 1958632e..4cbbb61d 100644 --- a/config/vhosts/vhosts.inc +++ b/config/vhosts/vhosts.inc @@ -106,7 +106,6 @@ function vhosts_sync_package_php() if($config['installedpackages']['vhosts']['config'] != "") { conf_mount_rw(); - config_unlock(); //sort the vhosts array $vhostarray = $config['installedpackages']['vhosts']['config']; @@ -718,7 +717,6 @@ function vhosts_install_command() { global $config; conf_mount_rw(); - config_lock(); if (!is_dir('/usr/local/www/packages/')) { exec("mkdir /usr/local/www/packages/"); @@ -794,15 +792,13 @@ function vhosts_install_command() { //} conf_mount_ro(); - config_unlock(); - + } function vhosts_deinstall_command() { conf_mount_rw(); - config_lock(); $handle = popen("/usr/local/etc/rc.d/vhosts.sh stop", "r"); unlink_if_exists("/usr/local/pkg/vhosts.xml"); unlink_if_exists("/usr/local/pkg/vhosts.inc"); @@ -813,7 +809,6 @@ function vhosts_deinstall_command() exec("rm -R /usr/local/www/packages/vhosts"); exec("rm -R /usr/local/php5"); conf_mount_ro(); - config_unlock(); } ?> |