aboutsummaryrefslogtreecommitdiffstats
path: root/config/spamd/spamd_db_ext.php
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-11 08:23:43 -0300
committerRenato Botelho <renato@netgate.com>2015-08-11 08:23:43 -0300
commitac41b35988091a163b5a4e55dc358becdae3de7a (patch)
tree6a41d7b0aeba59113a0393dcb3d5bf7dfc717445 /config/spamd/spamd_db_ext.php
parentc6e18d38e9ad1e0919bbdfc659f4b6b7ace1a87f (diff)
parent9b36d6b6c1f95574b15dff4e9e8ba794d4502a73 (diff)
downloadpfsense-packages-ac41b35988091a163b5a4e55dc358becdae3de7a.tar.gz
pfsense-packages-ac41b35988091a163b5a4e55dc358becdae3de7a.tar.bz2
pfsense-packages-ac41b35988091a163b5a4e55dc358becdae3de7a.zip
Merge pull request #984 from doktornotor/patch-26
Diffstat (limited to 'config/spamd/spamd_db_ext.php')
-rw-r--r--config/spamd/spamd_db_ext.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/config/spamd/spamd_db_ext.php b/config/spamd/spamd_db_ext.php
index 61a90141..010027e3 100644
--- a/config/spamd/spamd_db_ext.php
+++ b/config/spamd/spamd_db_ext.php
@@ -165,7 +165,6 @@ if($_GET['whitelist'] <> "") {
}
function delete_from_spamd_db($srcip) {
- config_lock();
$fd = fopen("/tmp/execcmds", "w");
fwrite($fd, "#!/bin/sh\n");
fwrite($fd, "/usr/local/sbin/spamdb -d {$srcip}\n");
@@ -178,7 +177,6 @@ function delete_from_spamd_db($srcip) {
system("/bin/sh /tmp/execcmds");
mwexec("/usr/bin/killall -HUP spamlogd");
mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt");
- config_unlock();
}
function basic_auth_prompt(){
@@ -189,17 +187,14 @@ function basic_auth_prompt(){
}
function add_to_blacklist($srcip) {
- config_lock();
$fd = fopen("/var/db/blacklist.txt", "a");
fwrite($fd, "{$srcip}\n");
fclose($fd);
mwexec("/sbin/pfctl -q -t spamd -T add -f /var/db/blacklist.txt");
mwexec("/sbin/pfctl -q -t blacklist -T add -f /var/db/blacklist.txt");
- config_unlock();
}
function delete_from_blacklist($srcip) {
- config_lock();
$blacklist = split("\n", file_get_contents("/var/db/blacklist.txt"));
$fd = fopen("/var/db/blacklist.txt", "w");
foreach($blacklist as $bl) {
@@ -210,11 +205,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 = split("\n", file_get_contents("/var/db/whitelist.txt"));
$fd = fopen("/var/db/whitelist.txt", "w");
foreach($whitelist as $wl) {
@@ -225,7 +218,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();
}
function hup_spamd() {
@@ -234,4 +226,4 @@ function hup_spamd() {
exit;
-?> \ No newline at end of file
+?>