diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-09-11 21:30:19 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-09-11 21:30:19 -0400 |
commit | b3890d78c0d3c2f1f851330bff1fcf68deb4b325 (patch) | |
tree | 94f1ada576d2f2069a32d4c5c9f6e0ad492bb41d | |
parent | 5ba2df7149f33fd33583a8bae35dc2002f1cd4b2 (diff) | |
download | pfsense-b3890d78c0d3c2f1f851330bff1fcf68deb4b325.zip pfsense-b3890d78c0d3c2f1f851330bff1fcf68deb4b325.tar.gz |
Lock around read call
-rwxr-xr-x | usr/local/www/status_captiveportal.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr/local/www/status_captiveportal.php b/usr/local/www/status_captiveportal.php index ab0e20d..7a66011 100755 --- a/usr/local/www/status_captiveportal.php +++ b/usr/local/www/status_captiveportal.php @@ -61,10 +61,13 @@ function clientcmp($a, $b) { } $cpdb = array(); -if (file_exists("{$g['vardb_path']}/captiveportal.db")) - $cpcontents = file("{$g['vardb_path']}/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); -else +if (file_exists("{$g['vardb_path']}/captiveportal.db")) { + $captiveportallck = lock('captiveportal'); + $cpcontents = file("/var/db/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + unlock($captiveportallck); +} else { $cpcontents = array(); +} $concurrent = count($cpcontents); |