From f62b0345b272d0e2fac430dffd84cc3967aa4da1 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 7 Jul 2005 03:06:56 +0000 Subject: [PATCH] adjusted for proper help2man functioning. still help2man freeks out a bit and duplicates help output -- that is for later to fix --- Makefile | 12 +++++++++--- config/fail2ban.conf.default | 4 ++-- debian/control | 4 ++-- fail2ban.h2m | 28 ++++++++++++++++++++++++++++ fail2ban.py | 2 +- 5 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 fail2ban.h2m diff --git a/Makefile b/Makefile index 3b542ea8..73379271 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,15 @@ # install target involved only if using autotools DESTDIR=debian/fail2ban -all:: +all:: fail2ban fail2ban.1x + + +fail2ban.1x: fail2ban fail2ban.h2m + help2man --include fail2ban.h2m --section=1x --no-info --output $@ ./fail2ban + +fail2ban: fail2ban.py cp fail2ban.py fail2ban - help2man -N -s 1 ./fail2ban >| fail2ban.1 + install:: all mkdir -p $(DESTDIR)/etc/default @@ -15,4 +21,4 @@ install:: all cp log4py.py $(DESTDIR)/usr/lib/fail2ban/ clean:: - rm -rf changelog.gz fail2ban{,.1} build* `find -iname '*.pyc' ` + rm -rf changelog.gz fail2ban{,.1x} build* `find -iname '*.pyc' ` diff --git a/config/fail2ban.conf.default b/config/fail2ban.conf.default index 18a30ed9..f34e43fe 100644 --- a/config/fail2ban.conf.default +++ b/config/fail2ban.conf.default @@ -85,9 +85,9 @@ enabled = false # Option: logfile # Notes.: logfile to monitor. -# Values: FILE Default: /var/log/apache/access_log +# Values: FILE Default: /var/log/apache/access.log # -logfile = /var/log/apache/access_log +logfile = /var/log/apache/access.log # Option: timeregex # Notes.: regex to match timestamp in Apache logfile. diff --git a/debian/control b/debian/control index 2bb5dcb8..44e64fb0 100644 --- a/debian/control +++ b/debian/control @@ -9,8 +9,8 @@ Package: fail2ban Architecture: all Depends: python, iptables Description: Ban IPs that make too many password failure - Fail2Ban scans log files like /var/log/pwdfail or - /var/log/apache/error_log and bans IP that makes too many password + The Fail2Ban scans log files like /var/log/auth.log or + /var/log/apache/access.log and bans IP that makes too many password failures. It updates firewall rules to reject the IP address. Currently, iptables, ipfwadm and ipfw are supported. . diff --git a/fail2ban.h2m b/fail2ban.h2m new file mode 100644 index 00000000..be48da17 --- /dev/null +++ b/fail2ban.h2m @@ -0,0 +1,28 @@ +Include file for help2man man page +$Id: $ + +[name] +fail2ban \- Ban IPs that make too many password failure + + +[files] +\fI/etc/fail2ban.conf\fR, \fI/etc/default/fail2ban\fR + +[copyright] +Copyright (c) 2004 Cyril Jaquier +.br +Copyright of modifications held by their respective authors. +.PP +Licensed under the GNU General Public License v2 (GPL). + + +[author] +Original fail2ban by Cyril Jaquier . +.br +Modified by +.br + - Yaroslav O. Halchenko . +.br +Sponsored for Debian by +.br + - Barak A. Pearlmutter . diff --git a/fail2ban.py b/fail2ban.py index 56fb03f1..30f5ee60 100755 --- a/fail2ban.py +++ b/fail2ban.py @@ -49,7 +49,7 @@ from confreader.configreader import ConfigReader from version import version def usage(): - print "Usage: fail2ban.py [OPTIONS]" + print "Usage: "+sys.argv[0]+" [OPTIONS]" print print "Fail2Ban v"+version+" reads log file that contains password failure report" print "and bans the corresponding IP address using iptables."