Package: denyhosts
Version: 2.6-4
Severity: normal
Tags: patch

If you change the value of HOSTS_DENY in /etc/denyhosts.conf, the
dh_reenable script will not work properly because the default value of
/etc/hosts.deny is hard-coded into the dh_reenable script. 

dh_reenable should parse the /etc/denyhosts.conf for the correct value,
rather than hard-coding it. I am including a patch that does this,
allowing for greater flexibility.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (810, 'unstable'), (600, 'stable'), (550, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages denyhosts depends on:
ii  lsb-base                      3.2-20     Linux Standard Base 3.2 init scrip
ii  python                        2.5.2-2    An interactive high-level object-o
ii  python-central                0.6.8      register and build utility for Pyt

denyhosts recommends no packages.

denyhosts suggests no packages.

-- no debconf information
--- dh_reenable	2008/10/08 08:37:35
+++ dh_reenable	2008/10/08 08:48:34
@@ -18,6 +18,8 @@
 import os
 import sys
 import fileinput
+import re
+from __future__ import with_statement
 
 # file definition:
 
@@ -27,7 +29,17 @@
 HOSTVALIDFILE='/var/lib/denyhosts/hosts-valid'
 HOSTSDENY='/etc/hosts.deny'
 #TEST='/etc/hosts.deny.tmp'
+CONFIGFILE='/etc/denyhosts.conf'
 
+# Parse the configuration file for the location of the HOSTS_DENY file.
+# If it exists, overwrite the hard-coded value for HOSTSDENY from the
+# top of the file.
+if os.path.isfile(CONFIGFILE):
+    with open(CONFIGFILE) as file:
+	for line in file:
+	    result = re.search('^(HOSTS_DENY\s*=\s*)(.*)', line)
+	    if result != None:
+		HOSTSDENY = result.group(2)
 
 def usage():
 	 print "Usage:"

Reply via email to