aboutsummaryrefslogtreecommitdiffstats
path: root/config/denyhosts/denyhosts.inc
diff options
context:
space:
mode:
Diffstat (limited to 'config/denyhosts/denyhosts.inc')
-rw-r--r--config/denyhosts/denyhosts.inc29
1 files changed, 19 insertions, 10 deletions
diff --git a/config/denyhosts/denyhosts.inc b/config/denyhosts/denyhosts.inc
index 75d6400e..e1bcf877 100644
--- a/config/denyhosts/denyhosts.inc
+++ b/config/denyhosts/denyhosts.inc
@@ -71,6 +71,8 @@ function php_install_command()
unlink_if_exists("/tmp/edit_area.tgz");
}
+ //backup the original hosts.allow file
+ exec ("cp /etc/hosts.allow /etc/hosts.allow.bak");
$hosts_allow = "#\n";
$hosts_allow .= "# hosts.allow access control file for \"tcp wrapped\" applications.\n";
@@ -173,19 +175,26 @@ function deinstall_command()
conf_mount_rw();
config_lock();
-
- $hosts_allow = "#\n";
- $hosts_allow .= "# hosts.allow access control file for \"tcp wrapped\" applications.\n";
- $hosts_allow .= "#\n";
- $hosts_allow .= "ALL : ALL : allow\n";
- $fout = fopen("/etc/hosts.allow","w");
- fwrite($fout, $tmp);
- unset($tmp);
- fclose($fout);
-
+
exec("pkg_delete denyhosts");
exec("rm -R /usr/local/www/packages/denyhosts/");
+ //restore original hosts.allow file
+ if (file_exists('/usr/local/www/exec.php')) {
+ exec ("rm /etc/hosts.allow");
+ exec ("cp /etc/hosts.allow.bak /etc/hosts.allow");
+ }
+
+ //create a new hosts.allow file
+ //$hosts_allow = "#\n";
+ //$hosts_allow .= "# hosts.allow access control file for \"tcp wrapped\" applications.\n";
+ //$hosts_allow .= "#\n";
+ //$hosts_allow .= "ALL : ALL : allow\n";
+ //$fout = fopen("/etc/hosts.allow","w");
+ //fwrite($fout, $tmp);
+ //unset($tmp);
+ //fclose($fout);
+
conf_mount_ro();
config_unlock();
}