aboutsummaryrefslogtreecommitdiffstats
path: root/config/denyhosts
diff options
context:
space:
mode:
Diffstat (limited to 'config/denyhosts')
-rw-r--r--config/denyhosts/denyhosts.inc29
-rw-r--r--config/denyhosts/denyhosts.xml2
2 files changed, 20 insertions, 11 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();
}
diff --git a/config/denyhosts/denyhosts.xml b/config/denyhosts/denyhosts.xml
index 4d0799ee..a3f28bc5 100644
--- a/config/denyhosts/denyhosts.xml
+++ b/config/denyhosts/denyhosts.xml
@@ -41,7 +41,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>DenyHosts</name>
- <version>0.4</version>
+ <version>0.5</version>
<title>Settings</title>
<include_file>/usr/local/pkg/denyhosts.inc</include_file>
<menu>