summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-09-11 21:29:31 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-09-11 21:29:31 -0400
commit7c563481da6349d38f93ea5115d2e71312ad8536 (patch)
tree633234e8cbfe2795cec42548cf48f6c095c13551 /usr
parentc126b54875edf36eb53b832863debbc0d1c5b1bc (diff)
downloadpfsense-7c563481da6349d38f93ea5115d2e71312ad8536.zip
pfsense-7c563481da6349d38f93ea5115d2e71312ad8536.tar.gz
Lock around read call
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/status_captiveportal.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/local/www/status_captiveportal.php b/usr/local/www/status_captiveportal.php
index 78151e5..6d73a4d 100755
--- a/usr/local/www/status_captiveportal.php
+++ b/usr/local/www/status_captiveportal.php
@@ -31,7 +31,10 @@
require("guiconfig.inc");
+$captiveportallck = lock('captiveportal');
$concurrent = `cat /var/db/captiveportal.db | wc -l`;
+$cpcontents = file("/var/db/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
+unlock($captiveportallck);
$pgtitle = "Status: Captive portal ({$concurrent})";
@@ -57,7 +60,6 @@ function clientcmp($a, $b) {
}
$cpdb = array();
-$cpcontents = file("/var/db/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($cpcontents as $cpcontent) {
$cpent = explode(",", $cpcontent);
if ($_GET['showact'])
OpenPOWER on IntegriCloud