From e0660de17552d5a859b6215d1b8fa3132119bc8c Mon Sep 17 00:00:00 2001
From: mcrane
Date: Sat, 1 Aug 2009 04:29:33 -0600
Subject: DenyHosts syntax improvements, editarea loaded if not available
---
config/denyhosts/denyhosts.inc | 28 +++++++++++++++++++++++-----
config/denyhosts/denyhosts.xml | 4 ++--
config/denyhosts/denyhosts_log.tmp | 29 ++++++++++++++++++++---------
3 files changed, 45 insertions(+), 16 deletions(-)
(limited to 'config')
diff --git a/config/denyhosts/denyhosts.inc b/config/denyhosts/denyhosts.inc
index d83f2878..1efb250a 100644
--- a/config/denyhosts/denyhosts.inc
+++ b/config/denyhosts/denyhosts.inc
@@ -60,11 +60,19 @@ function php_install_command()
exec("pkg_delete denyhosts");
+ //misc files
+ if (!is_dir('/usr/local/www/edit_area/')) {
+ chdir('/tmp/');
+ exec("cd /tmp/;fetch ".$download_path."edit_area.tgz");
+ chdir('/usr/local/www');
+ system('tar xvpfz /tmp/edit_area.tgz edit_area');
+ unlink_if_exists("/tmp/edit_area.tgz");
+ }
$hosts_allow = "#\n";
$hosts_allow .= "# hosts.allow access control file for \"tcp wrapped\" applications.\n";
- $hosts_allow .= "#\n;
+ $hosts_allow .= "#\n";
$hosts_allow .= "sshd : /etc/hosts.deniedssh : deny\n";
$hosts_allow .= "sshd : ALL : allow\n";
$hosts_allow .= "ALL : ALL : allow\n";
@@ -73,8 +81,14 @@ function php_install_command()
unset($hosts_allow);
fclose($fout);
- exec("touch /etc/hosts.deniedssh");
- exec("chmod 755 /etc/hosts.deniedssh");
+ if(!is_file("/etc/hosts.deniedssh")) {
+ exec("touch /etc/hosts.deniedssh");
+ exec("chmod 755 /etc/hosts.deniedssh");
+ }
+
+ if(!is_file("/var/log/denyhosts")) {
+ exec ('touch /var/log/denyhosts');
+ }
$download_path = 'http://www.pfsense.com/packages/config/denyhosts/';
@@ -104,7 +118,7 @@ function php_install_command()
unset($denyhosts_sh);
fclose($fout);
-
+
$filename = "/usr/local/etc/denyhosts.conf";
$handle = fopen($filename,"rb");
$denyhosts_conf = fread($handle, filesize($filename));
@@ -117,6 +131,7 @@ function php_install_command()
unset($filename);
fclose($fout);
+
$filename = "/usr/local/etc/denyhosts.conf-dist";
$fout = fopen($filename,"w");
fwrite($fout, $denyhosts_conf);
@@ -124,6 +139,7 @@ function php_install_command()
unset($denyhosts_conf);
fclose($fout);
+
//Error reading file: denyhosts.cfg
//write_rcfile(array(
// "file" => "denyhosts.sh",
@@ -135,9 +151,11 @@ function php_install_command()
php_sync_package();
+
//start denyhosts
exec("/usr/local/etc/rc.d/denyhosts.sh start");
+
//if (pkg_is_service_running('notes')) {
//documentation purposes
//}
@@ -152,7 +170,7 @@ function deinstall_command()
$hosts_allow = "#\n";
$hosts_allow .= "# hosts.allow access control file for \"tcp wrapped\" applications.\n";
- $hosts_allow .= "#\n;
+ $hosts_allow .= "#\n";
$hosts_allow .= "ALL : ALL : allow\n";
$fout = fopen("/etc/hosts.allow","w");
fwrite($fout, $tmp);
diff --git a/config/denyhosts/denyhosts.xml b/config/denyhosts/denyhosts.xml
index 35878c7a..5a09be94 100644
--- a/config/denyhosts/denyhosts.xml
+++ b/config/denyhosts/denyhosts.xml
@@ -7,7 +7,7 @@
/* $Id$ */
/* ========================================================================== */
/*
- notes.xml
+ denyhosts.xml
Copyright (C) 2008 Mark J Crane
All rights reserved.
*/
@@ -41,7 +41,7 @@
Describe your package requirements here
Currently there are no FAQ items provided.
DenyHosts
- 0.1
+ 0.2
Settings
/usr/local/pkg/denyhosts.inc
\n";
+echo "Deny Hosts
\n";
?>
@@ -107,36 +116,38 @@ echo "
$v_project_label: Variables
\n";
+
+ Description
-
|
+
|
+ -->
-
+
--
cgit v1.2.3