* Resolve all "names" which became a part of <HOST>. Previousely only fqdn's

were resolved
pull/3/head
Yaroslav Halchenko 2007-08-13 21:13:59 +00:00
parent c5202ce696
commit 85b75c77fb
3 changed files with 33 additions and 0 deletions

2
debian/changelog vendored
View File

@ -1,6 +1,8 @@
fail2ban (0.8.0-5~pre1) unstable; urgency=low
* Added optional spaces at the end of failregex for vsftpd.
* Resolve all "names" which became a part of <HOST>. Previousely only fqdn's
were resolved
-- Yaroslav Halchenko <debian@onerussian.com> Sun, 05 Aug 2007 21:38:44 -0400

30
debian/patches/00_resolve_all_names.dpatch vendored Executable file
View File

@ -0,0 +1,30 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 00_resolve_all_names.dpatch by Yaroslav Halchenko <debian@onerussian.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad trunk~/server/filter.py trunk/server/filter.py
--- trunk~/server/filter.py 2007-04-18 16:44:07.000000000 -0400
+++ trunk/server/filter.py 2007-08-06 14:20:11.000000000 -0400
@@ -538,11 +538,14 @@
ipList.append(plainIPStr)
if not ipList:
# Try to get IP from possible DNS
- dns = DNSUtils.textToDns(text)
- if not dns == None:
- ip = DNSUtils.dnsToIp(dns.group(0))
- for e in ip:
- ipList.append(e)
+ # yoh: this way would not work for reported
+ # hosts with only top part of the address
+ # Since we have now <HOST> it is safe and
+ # efficient to simply try to resolve it
+ # dns = DNSUtils.textToDns(text)
+ ip = DNSUtils.dnsToIp(text)
+ for e in ip:
+ ipList.append(e)
return ipList
@staticmethod

View File

@ -3,6 +3,7 @@
00_var_run_socket
00_HOST_ignoreregex
00_daemon_pids
00_resolve_all_names
10_dbts_manpages
00_iptables_allports
00_ssh_strong_re