diff options
Diffstat (limited to 'config/spamd')
-rw-r--r-- | config/spamd/spamd.inc | 5 | ||||
-rw-r--r-- | config/spamd/spamd_db.php | 4 | ||||
-rw-r--r-- | config/spamd/spamd_db_ext.php | 10 | ||||
-rw-r--r-- | config/spamd/spamd_verify_to_address.php | 4 |
4 files changed, 2 insertions, 21 deletions
diff --git a/config/spamd/spamd.inc b/config/spamd/spamd.inc index 7dc1ecdc..a7be4587 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 dab599b8..3fe439ef 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/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 +?> diff --git a/config/spamd/spamd_verify_to_address.php b/config/spamd/spamd_verify_to_address.php index 56821370..504107d3 100644 --- a/config/spamd/spamd_verify_to_address.php +++ b/config/spamd/spamd_verify_to_address.php @@ -114,9 +114,7 @@ foreach($grey_hosts as $grey) { if($debug) echo "/usr/local/sbin/spamdb -a \"<$email_to>\" -T\n"; exec("/usr/local/sbin/spamdb -a \"<$email_to>\" -T"); - config_lock(); system("echo $server_ip >> /var/db/blacklist.txt"); - config_unlock(); $result = mwexec("/usr/local/sbin/spamdb -a $server_ip -t"); } else { if($debug) @@ -141,4 +139,4 @@ if($debug) { mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); -?>
\ No newline at end of file +?> |