summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-05-08 18:42:37 +0000
committerErmal Luçi <eri@pfsense.org>2009-05-08 18:42:37 +0000
commit0027de0a544438f146cfc94f005fd6f4ba9f94d7 (patch)
tree3f97d22951284c2a7b02563ecdbb0fd126b46f15 /usr/local/www
parent89e6e210158ca4ca24d2ddbc02ccab72175875a5 (diff)
downloadpfsense-0027de0a544438f146cfc94f005fd6f4ba9f94d7.zip
pfsense-0027de0a544438f146cfc94f005fd6f4ba9f94d7.tar.gz
* Create two new functions lock($subsystem)/unlock() to have more reliable locking using semaphores.
This function can sleep till the resource is free and can help find not well behaving code. * Remove most of the config_lock/config_unlock logics on the whole scripts/pages it is an abuse of this. If any sybsytem wants to lock can do so with its own lock. * Lock the config when doing a filter reload to avoid parallell recursion on this function, since it is not reentrant. This compenstates for the removal of lock aquiring from the scripts/pages. * config_lock/config_unlock are now compate shims that do nothing. They are preserved since packages 'abuse' them too.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/diag_backup.php4
-rwxr-xr-xusr/local/www/diag_logs_settings.php2
-rwxr-xr-xusr/local/www/firewall_aliases.php2
-rwxr-xr-xusr/local/www/firewall_nat_1to1.php4
-rwxr-xr-xusr/local/www/firewall_nat_out.php3
-rwxr-xr-xusr/local/www/firewall_nat_server.php3
-rwxr-xr-xusr/local/www/firewall_rules.php2
-rwxr-xr-xusr/local/www/firewall_shaper.php10
-rwxr-xr-xusr/local/www/firewall_shaper_layer7.php7
-rwxr-xr-xusr/local/www/firewall_shaper_queues.php9
-rw-r--r--usr/local/www/firewall_shaper_vinterface.php10
-rwxr-xr-xusr/local/www/firewall_shaper_wizards.php5
-rwxr-xr-xusr/local/www/firewall_virtual_ip.php4
-rwxr-xr-xusr/local/www/interfaces.php2
-rwxr-xr-xusr/local/www/interfaces_assign.php5
-rwxr-xr-xusr/local/www/load_balancer_monitor.php3
-rwxr-xr-xusr/local/www/load_balancer_pool.php3
-rwxr-xr-xusr/local/www/load_balancer_relay_action.php3
-rwxr-xr-xusr/local/www/load_balancer_relay_protocol.php3
-rwxr-xr-xusr/local/www/load_balancer_virtual_server.php2
-rwxr-xr-xusr/local/www/services_captiveportal.php3
-rwxr-xr-xusr/local/www/services_captiveportal_ip.php2
-rwxr-xr-xusr/local/www/services_captiveportal_mac.php2
-rwxr-xr-xusr/local/www/services_dhcp.php2
-rwxr-xr-xusr/local/www/services_dhcp_relay.php2
-rwxr-xr-xusr/local/www/services_dnsmasq.php4
-rw-r--r--usr/local/www/services_dyndns_edit.php2
-rwxr-xr-xusr/local/www/services_igmpproxy.php3
-rwxr-xr-xusr/local/www/services_proxyarp.php2
-rw-r--r--usr/local/www/services_rfc2136_edit.php2
-rwxr-xr-xusr/local/www/services_snmp.php4
-rwxr-xr-xusr/local/www/status_rrd_graph_settings.php3
-rwxr-xr-xusr/local/www/system.php5
-rw-r--r--usr/local/www/system_advanced_admin.php4
-rw-r--r--usr/local/www/system_advanced_firewall.php1
-rw-r--r--usr/local/www/system_advanced_misc.php2
-rw-r--r--usr/local/www/system_advanced_network.php2
-rwxr-xr-xusr/local/www/system_gateway_groups.php2
-rwxr-xr-xusr/local/www/system_gateways.php2
-rwxr-xr-xusr/local/www/system_routes.php2
-rwxr-xr-xusr/local/www/vpn_ipsec.php2
-rw-r--r--usr/local/www/vpn_l2tp.php4
-rw-r--r--usr/local/www/vpn_l2tp_users.php2
-rw-r--r--usr/local/www/vpn_l2tp_users_edit.php2
-rwxr-xr-xusr/local/www/vpn_pppoe.php4
-rwxr-xr-xusr/local/www/vpn_pppoe_users.php4
-rwxr-xr-xusr/local/www/vpn_pppoe_users_edit.php2
-rwxr-xr-xusr/local/www/vpn_pptp.php4
-rwxr-xr-xusr/local/www/vpn_pptp_users.php2
49 files changed, 15 insertions, 148 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php
index ef8becd..9b6c484 100755
--- a/usr/local/www/diag_backup.php
+++ b/usr/local/www/diag_backup.php
@@ -130,7 +130,7 @@ if ($_POST) {
if (!$input_errors) {
- config_lock();
+ $lockbckp = lock('config');
$host = "{$config['system']['hostname']}.{$config['system']['domain']}";
$name = "config-{$host}-".date("YmdHis").".xml";
@@ -183,7 +183,7 @@ if ($_POST) {
header("Content-Length: $size");
echo $data;
- config_unlock();
+ unlock($lockbckp);
exit;
}
}
diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php
index 83a5d80..d98bd6f 100755
--- a/usr/local/www/diag_logs_settings.php
+++ b/usr/local/www/diag_logs_settings.php
@@ -89,11 +89,9 @@ if ($_POST) {
write_config();
$retval = 0;
- config_lock();
$retval = system_syslogd_start();
if ($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock']))
$retval |= filter_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
}
diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php
index a6fb78e..c0701f6 100755
--- a/usr/local/www/firewall_aliases.php
+++ b/usr/local/www/firewall_aliases.php
@@ -54,10 +54,8 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
- config_lock();
/* reload all components that use aliases */
$retval = filter_configure();
- config_unlock();
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/firewall_nat_1to1.php b/usr/local/www/firewall_nat_1to1.php
index 0b26ff1..009106a 100755
--- a/usr/local/www/firewall_nat_1to1.php
+++ b/usr/local/www/firewall_nat_1to1.php
@@ -51,11 +51,7 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
-
- config_lock();
$retval |= filter_configure();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php
index 03eb8bd..1a1192c 100755
--- a/usr/local/www/firewall_nat_out.php
+++ b/usr/local/www/firewall_nat_out.php
@@ -51,10 +51,7 @@ if ($_POST['apply']) {
write_config();
$retval = 0;
-
- config_lock();
$retval |= filter_configure();
- config_unlock();
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/firewall_nat_server.php b/usr/local/www/firewall_nat_server.php
index f0a2153..c7f07a7 100755
--- a/usr/local/www/firewall_nat_server.php
+++ b/usr/local/www/firewall_nat_server.php
@@ -51,10 +51,7 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
-
- config_lock();
$retval |= filter_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php
index d5e6d6b..d4b7312 100755
--- a/usr/local/www/firewall_rules.php
+++ b/usr/local/www/firewall_rules.php
@@ -98,9 +98,7 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
- config_lock();
$retval = filter_configure();
- config_unlock();
if (file_exists($d_filterconfdirty_path))
unlink($d_filterconfdirty_path);
diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php
index ec803a1..55ec0f9 100755
--- a/usr/local/www/firewall_shaper.php
+++ b/usr/local/www/firewall_shaper.php
@@ -112,12 +112,9 @@ if ($_GET) {
write_config();
$retval = 0;
+ $retval |= filter_configure();
$savemsg = get_std_save_message($retval);
- config_lock();
- $retval = filter_configure();
- config_unlock();
-
if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
else
@@ -266,11 +263,8 @@ if ($_GET) {
write_config();
$retval = 0;
- $savemsg = get_std_save_message($retval);
-
- config_lock();
$retval = filter_configure();
- config_unlock();
+ $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/firewall_shaper_layer7.php b/usr/local/www/firewall_shaper_layer7.php
index 356e6fb..2dd5acc 100755
--- a/usr/local/www/firewall_shaper_layer7.php
+++ b/usr/local/www/firewall_shaper_layer7.php
@@ -166,12 +166,9 @@ else if ($_POST) {
write_config();
$retval = 0;
- $savemsg = get_std_save_message($retval);
-
- config_lock();
$retval = filter_configure();
- config_unlock();
-
+ $savemsg = get_std_save_message($retval);
+
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
else
diff --git a/usr/local/www/firewall_shaper_queues.php b/usr/local/www/firewall_shaper_queues.php
index 342083e..3495fdf 100755
--- a/usr/local/www/firewall_shaper_queues.php
+++ b/usr/local/www/firewall_shaper_queues.php
@@ -145,13 +145,10 @@ if ($_GET) {
if ($_POST['apply']) {
write_config();
- $retval = 0;
- $savemsg = get_std_save_message($retval);
+ $retval = 0;
/* Setup pf rules since the user may have changed the optimization value */
-
- config_lock();
- $retval = filter_configure();
- config_unlock();
+ $retval = filter_configure();
+ $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
else
diff --git a/usr/local/www/firewall_shaper_vinterface.php b/usr/local/www/firewall_shaper_vinterface.php
index 75b7e6c..7415447 100644
--- a/usr/local/www/firewall_shaper_vinterface.php
+++ b/usr/local/www/firewall_shaper_vinterface.php
@@ -112,11 +112,8 @@ if ($_GET) {
write_config();
$retval = 0;
- $savemsg = get_std_save_message($retval);
-
- config_lock();
$retval = filter_configure();
- config_unlock();
+ $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
@@ -216,11 +213,8 @@ if ($_GET) {
write_config();
$retval = 0;
- $savemsg = get_std_save_message($retval);
-
- config_lock();
$retval = filter_configure();
- config_unlock();
+ $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/firewall_shaper_wizards.php b/usr/local/www/firewall_shaper_wizards.php
index 2290a3f..fb8e9af 100755
--- a/usr/local/www/firewall_shaper_wizards.php
+++ b/usr/local/www/firewall_shaper_wizards.php
@@ -47,12 +47,9 @@ if ($_POST['apply']) {
write_config();
$retval = 0;
- $savemsg = get_std_save_message($retval);
/* Setup pf rules since the user may have changed the optimization value */
-
- config_lock();
$retval = filter_configure();
- config_unlock();
+ $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
else
diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php
index d0e05eb..d24f234 100755
--- a/usr/local/www/firewall_virtual_ip.php
+++ b/usr/local/www/firewall_virtual_ip.php
@@ -57,15 +57,11 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
-
- config_lock();
$retval = services_proxyarp_configure();
/* Bring up any configured CARP interfaces */
reset_carp();
$retval |= filter_configure();
- config_unlock();
interfaces_ipalias_configure();
-
/* reset carp states */
reset_carp();
interfaces_carp_configure();
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index bd9db27..8a8fb8f 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -241,11 +241,9 @@ if ($_POST['apply']) {
if ($if == "lan")
$savemsg = "The changes have been applied. You may need to correct your web browser's IP address.";
/* sync filter configuration */
- config_lock();
setup_gateways_monitor();
if (file_exists($d_staticroutesdirty_path))
unlink($d_staticroutesdirty_path);
- config_unlock();
filter_configure();
/* set up static routes */
system_routing_configure();
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 62efff1..3b84802 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -124,11 +124,8 @@ if ($_POST['apply']) {
write_config();
$retval = 0;
- $savemsg = get_std_save_message($retval);
-
- config_lock();
$retval = filter_configure();
- config_unlock();
+ $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/load_balancer_monitor.php b/usr/local/www/load_balancer_monitor.php
index ef0a1f0..96406a9 100755
--- a/usr/local/www/load_balancer_monitor.php
+++ b/usr/local/www/load_balancer_monitor.php
@@ -48,11 +48,8 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
-
- config_lock();
$retval |= filter_configure();
$retval |= relayd_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
unlink_if_exists($d_vsconfdirty_path);
diff --git a/usr/local/www/load_balancer_pool.php b/usr/local/www/load_balancer_pool.php
index 50a5903..80b6941 100755
--- a/usr/local/www/load_balancer_pool.php
+++ b/usr/local/www/load_balancer_pool.php
@@ -50,11 +50,8 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
-
- config_lock();
$retval |= filter_configure();
$retval |= relayd_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
unlink_if_exists($d_vsconfdirty_path);
diff --git a/usr/local/www/load_balancer_relay_action.php b/usr/local/www/load_balancer_relay_action.php
index 2c95ce4..6653f93 100755
--- a/usr/local/www/load_balancer_relay_action.php
+++ b/usr/local/www/load_balancer_relay_action.php
@@ -50,11 +50,8 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
-
- config_lock();
$retval |= filter_configure();
$retval |= relayd_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
unlink_if_exists($d_vsconfdirty_path);
diff --git a/usr/local/www/load_balancer_relay_protocol.php b/usr/local/www/load_balancer_relay_protocol.php
index 2d982c4..e0007b5 100755
--- a/usr/local/www/load_balancer_relay_protocol.php
+++ b/usr/local/www/load_balancer_relay_protocol.php
@@ -48,11 +48,8 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
-
- config_lock();
$retval |= filter_configure();
$retval |= relayd_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
unlink_if_exists($d_vsconfdirty_path);
diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php
index f7d61a9..ba62613 100755
--- a/usr/local/www/load_balancer_virtual_server.php
+++ b/usr/local/www/load_balancer_virtual_server.php
@@ -50,10 +50,8 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
- config_lock();
$retval |= filter_configure();
$retval |= relayd_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
unlink_if_exists($d_vsconfdirty_path);
}
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index 180840d..7d5a73d 100755
--- a/usr/local/www/services_captiveportal.php
+++ b/usr/local/www/services_captiveportal.php
@@ -191,10 +191,7 @@ if ($_POST) {
write_config();
$retval = 0;
-
- config_lock();
$retval = captiveportal_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
}
diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php
index 19bbccd..70908c7 100755
--- a/usr/local/www/services_captiveportal_ip.php
+++ b/usr/local/www/services_captiveportal_ip.php
@@ -57,9 +57,7 @@ if ($_POST) {
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (file_exists($d_allowedipsdirty_path)) {
- config_lock();
unlink($d_allowedipsdirty_path);
- config_unlock();
}
}
}
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php
index 47940c4..01ef052 100755
--- a/usr/local/www/services_captiveportal_mac.php
+++ b/usr/local/www/services_captiveportal_mac.php
@@ -57,9 +57,7 @@ if ($_POST) {
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (file_exists($d_passthrumacsdirty_path)) {
- config_lock();
unlink($d_passthrumacsdirty_path);
- config_unlock();
}
}
}
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index e7f70f6..99651cb 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -302,7 +302,6 @@ if ($_POST) {
$retval = 0;
$retvaldhcp = 0;
$retvaldns = 0;
- config_lock();
/* Stop DHCP so we can cleanup leases */
killbyname("dhcpd");
dhcp_clean_leases();
@@ -323,7 +322,6 @@ if ($_POST) {
unlink($d_staticmapsdirty_path);
}
}
- config_unlock();
if($retvaldhcp == 1 || $retvaldns == 1)
$retval = 1;
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php
index 1517be2..4d12ee9 100755
--- a/usr/local/www/services_dhcp_relay.php
+++ b/usr/local/www/services_dhcp_relay.php
@@ -141,9 +141,7 @@ if ($_POST) {
write_config();
$retval = 0;
- config_lock();
$retval = services_dhcrelay_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
}
diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php
index e416011..3f6e27b 100755
--- a/usr/local/www/services_dnsmasq.php
+++ b/usr/local/www/services_dnsmasq.php
@@ -65,11 +65,7 @@ if ($_POST) {
write_config();
$retval = 0;
-
- config_lock();
$retval = services_dnsmasq_configure();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
diff --git a/usr/local/www/services_dyndns_edit.php b/usr/local/www/services_dyndns_edit.php
index 8cfafc1..651bf6d 100644
--- a/usr/local/www/services_dyndns_edit.php
+++ b/usr/local/www/services_dyndns_edit.php
@@ -114,9 +114,7 @@ if ($_POST) {
mwexec("rm {$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}.cache");
conf_mount_ro();
- config_lock();
$retval = services_dyndns_configure_client($dyndns);
- config_unlock();
header("Location: services_dyndns.php");
exit;
diff --git a/usr/local/www/services_igmpproxy.php b/usr/local/www/services_igmpproxy.php
index eb28fdd..c69e0a8 100755
--- a/usr/local/www/services_igmpproxy.php
+++ b/usr/local/www/services_igmpproxy.php
@@ -54,11 +54,8 @@ if ($_POST) {
$pconfig = $_POST;
$retval = 0;
-
- config_lock();
/* reload all components that use igmpproxy */
$retval = services_igmpproxy_configure();
- config_unlock();
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/services_proxyarp.php b/usr/local/www/services_proxyarp.php
index e358061..51a29a0 100755
--- a/usr/local/www/services_proxyarp.php
+++ b/usr/local/www/services_proxyarp.php
@@ -51,9 +51,7 @@ if ($_POST) {
$pconfig = $_POST;
$retval = 0;
- config_lock();
$retval = services_proxyarp_configure();
- config_unlock();
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
diff --git a/usr/local/www/services_rfc2136_edit.php b/usr/local/www/services_rfc2136_edit.php
index e4d4e84..4c0a40b 100644
--- a/usr/local/www/services_rfc2136_edit.php
+++ b/usr/local/www/services_rfc2136_edit.php
@@ -96,9 +96,7 @@ if ($_POST) {
write_config("New/Edited RFC2136 dnsupdate entry was posted.");
- config_lock();
$retval = services_dnsupdate_process();
- config_unlock();
header("Location: services_rfc2136.php");
exit;
diff --git a/usr/local/www/services_snmp.php b/usr/local/www/services_snmp.php
index fc948e4..1e8b4c1 100755
--- a/usr/local/www/services_snmp.php
+++ b/usr/local/www/services_snmp.php
@@ -142,11 +142,7 @@ if ($_POST) {
write_config();
$retval = 0;
-
- config_lock();
$retval = services_snmpd_configure();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
}
}
diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php
index f64870b..419050c 100755
--- a/usr/local/www/status_rrd_graph_settings.php
+++ b/usr/local/www/status_rrd_graph_settings.php
@@ -66,10 +66,7 @@ if ($_POST) {
write_config();
$retval = 0;
- config_lock();
$retval = enable_rrd_graphing();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
}
}
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index 57d1e4d..fe983a8 100755
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -198,7 +198,6 @@ if ($_POST) {
write_config($changedesc);
$retval = 0;
- config_lock();
$retval = system_hostname_configure();
$retval |= system_hosts_generate();
$retval |= system_resolvconf_generate();
@@ -211,10 +210,8 @@ if ($_POST) {
$retval |= interface_configure();
// Reload the filter - plugins might need to be run.
- filter_configure();
+ $retval |= filter_configure();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
}
}
diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php
index 9f0002c..cee9221 100644
--- a/usr/local/www/system_advanced_admin.php
+++ b/usr/local/www/system_advanced_admin.php
@@ -147,11 +147,9 @@ if ($_POST) {
write_config();
- config_lock();
$retval = filter_configure();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
+
if ($restart_webgui)
$savemsg .= "<br />One moment...redirecting to {$url} in 20 seconds.";
diff --git a/usr/local/www/system_advanced_firewall.php b/usr/local/www/system_advanced_firewall.php
index 57d5af4..f81a613 100644
--- a/usr/local/www/system_advanced_firewall.php
+++ b/usr/local/www/system_advanced_firewall.php
@@ -126,7 +126,6 @@ if ($_POST) {
filter_load_ipfw();
$retval = 0;
- config_lock();
$retval = filter_configure();
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php
index a190777..82db06a 100644
--- a/usr/local/www/system_advanced_misc.php
+++ b/usr/local/www/system_advanced_misc.php
@@ -75,13 +75,11 @@ if ($_POST) {
write_config();
$retval = 0;
- config_lock();
$retval = filter_configure();
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
else
$savemsg = $retval;
- config_unlock();
activate_powerd();
}
diff --git a/usr/local/www/system_advanced_network.php b/usr/local/www/system_advanced_network.php
index ffb003c..c5db50b 100644
--- a/usr/local/www/system_advanced_network.php
+++ b/usr/local/www/system_advanced_network.php
@@ -106,13 +106,11 @@ if ($_POST) {
write_config();
- config_lock();
$retval = filter_configure();
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
else
$savemsg = $retval;
- config_unlock();
}
}
diff --git a/usr/local/www/system_gateway_groups.php b/usr/local/www/system_gateway_groups.php
index e236f28..3d794a7 100755
--- a/usr/local/www/system_gateway_groups.php
+++ b/usr/local/www/system_gateway_groups.php
@@ -60,9 +60,7 @@ if ($_POST) {
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (file_exists($d_staticroutesdirty_path)) {
- config_lock();
unlink($d_staticroutesdirty_path);
- config_unlock();
}
}
}
diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php
index a2aace9..6522895 100755
--- a/usr/local/www/system_gateways.php
+++ b/usr/local/www/system_gateways.php
@@ -64,9 +64,7 @@ if ($_POST) {
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (file_exists($d_staticroutesdirty_path)) {
- config_lock();
unlink($d_staticroutesdirty_path);
- config_unlock();
}
}
}
diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php
index ecbb552..c563d5e 100755
--- a/usr/local/www/system_routes.php
+++ b/usr/local/www/system_routes.php
@@ -66,9 +66,7 @@ if ($_POST) {
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (file_exists($d_staticroutesdirty_path)) {
- config_lock();
unlink($d_staticroutesdirty_path);
- config_unlock();
}
}
} else {
diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php
index 85094ec..8eb81ce 100755
--- a/usr/local/www/vpn_ipsec.php
+++ b/usr/local/www/vpn_ipsec.php
@@ -56,10 +56,8 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
- config_lock();
$retval = vpn_ipsec_refresh_policies();
$retval = vpn_ipsec_configure();
- config_unlock();
/* reload the filter in the background */
filter_configure();
$savemsg = get_std_save_message($retval);
diff --git a/usr/local/www/vpn_l2tp.php b/usr/local/www/vpn_l2tp.php
index 2e6829a..3c6cdea 100644
--- a/usr/local/www/vpn_l2tp.php
+++ b/usr/local/www/vpn_l2tp.php
@@ -138,11 +138,7 @@ if ($_POST) {
write_config();
$retval = 0;
-
- config_lock();
$retval = vpn_l2tp_configure();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
/* if ajax is calling, give them an update message */
diff --git a/usr/local/www/vpn_l2tp_users.php b/usr/local/www/vpn_l2tp_users.php
index 46cd2eb..b402f18 100644
--- a/usr/local/www/vpn_l2tp_users.php
+++ b/usr/local/www/vpn_l2tp_users.php
@@ -45,9 +45,7 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
- config_lock();
$retval = vpn_l2tp_configure();
- config_unlock();
}
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
diff --git a/usr/local/www/vpn_l2tp_users_edit.php b/usr/local/www/vpn_l2tp_users_edit.php
index ff3e5fe..98d2dc7 100644
--- a/usr/local/www/vpn_l2tp_users_edit.php
+++ b/usr/local/www/vpn_l2tp_users_edit.php
@@ -110,9 +110,7 @@ if ($_POST) {
write_config();
- config_lock();
$retval = vpn_l2tp_configure();
- config_unlock();
pfSenseHeader("vpn_l2tp_users.php");
diff --git a/usr/local/www/vpn_pppoe.php b/usr/local/www/vpn_pppoe.php
index 192bb61..592ba07 100755
--- a/usr/local/www/vpn_pppoe.php
+++ b/usr/local/www/vpn_pppoe.php
@@ -172,11 +172,7 @@ if ($_POST) {
write_config();
$retval = 0;
-
- config_lock();
$retval = vpn_setup();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
}
}
diff --git a/usr/local/www/vpn_pppoe_users.php b/usr/local/www/vpn_pppoe_users.php
index 7cbf0f2..30de917 100755
--- a/usr/local/www/vpn_pppoe_users.php
+++ b/usr/local/www/vpn_pppoe_users.php
@@ -50,11 +50,7 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
-
- config_lock();
$retval = vpn_setup();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (file_exists($d_pppoeuserdirty_path))
diff --git a/usr/local/www/vpn_pppoe_users_edit.php b/usr/local/www/vpn_pppoe_users_edit.php
index b5f6108..816772b 100755
--- a/usr/local/www/vpn_pppoe_users_edit.php
+++ b/usr/local/www/vpn_pppoe_users_edit.php
@@ -110,9 +110,7 @@ if ($_POST) {
write_config();
- config_lock();
$retval = vpn_setup();
- config_unlock();
header("Location: vpn_pppoe_users.php");
exit;
diff --git a/usr/local/www/vpn_pptp.php b/usr/local/www/vpn_pptp.php
index 036a1c6..6f01353 100755
--- a/usr/local/www/vpn_pptp.php
+++ b/usr/local/www/vpn_pptp.php
@@ -188,11 +188,7 @@ if ($_POST) {
write_config();
$retval = 0;
-
- config_lock();
$retval = vpn_setup();
- config_unlock();
-
$savemsg = get_std_save_message($retval);
filter_configure();
diff --git a/usr/local/www/vpn_pptp_users.php b/usr/local/www/vpn_pptp_users.php
index 62533dc..d49dd43 100755
--- a/usr/local/www/vpn_pptp_users.php
+++ b/usr/local/www/vpn_pptp_users.php
@@ -50,9 +50,7 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
- config_lock();
$retval = vpn_setup();
- config_unlock();
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
if (file_exists($d_pptpuserdirty_path))
OpenPOWER on IntegriCloud