Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 100043 - app-admin/DenyHosts-0.9.0.ebuild (New Package)
Summary: app-admin/DenyHosts-0.9.0.ebuild (New Package)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Default Assignee for New Packages
URL: http://denyhosts.sourceforge.net/
Whiteboard:
Keywords: EBUILD, REVIEWED
Depends on:
Blocks:
 
Reported: 2005-07-23 10:50 UTC by Mike Kelly
Modified: 2005-10-07 13:55 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
DenyHosts-0.9.0.ebuild (DenyHosts-0.9.0.ebuild,1.72 KB, text/plain)
2005-07-23 10:53 UTC, Mike Kelly
Details
DenyHosts-0.9.0-gentoo.patch (DenyHosts-0.9.0-gentoo.patch,2.03 KB, patch)
2005-07-23 10:53 UTC, Mike Kelly
Details | Diff
denyhosts.rc6 (denyhosts.rc6,556 bytes, text/plain)
2005-07-23 10:54 UTC, Mike Kelly
Details
DenyHosts-0.9.3.ebuild (DenyHosts-0.9.3.ebuild,1.72 KB, text/plain)
2005-07-23 11:09 UTC, Mike Kelly
Details
DenyHosts-0.9.3-gentoo.patch (DenyHosts-0.9.3-gentoo.patch,2.05 KB, text/plain)
2005-07-23 11:10 UTC, Mike Kelly
Details
patch to denyhosts.rc6 to make it more compliant (denyhosts-initd.diff,554 bytes, patch)
2005-07-23 19:17 UTC, Mike Kelly
Details | Diff
denyhosts-1.0.1.ebuild (denyhosts-1.0.1.ebuild,1.76 KB, text/plain)
2005-08-21 23:53 UTC, Rene Zbinden
Details
denyhosts-1.0.1-gentoo.patch (denyhosts-1.0.1-gentoo.patch,2.37 KB, text/plain)
2005-08-21 23:54 UTC, Rene Zbinden
Details
denyhosts.init (denyhosts.init,341 bytes, text/plain)
2005-08-21 23:55 UTC, Rene Zbinden
Details
denyhosts-1.0.1.ebuild (denyhosts-1.0.1.ebuild,1.88 KB, text/plain)
2005-08-28 23:14 UTC, Rene Zbinden
Details
denyhosts.init (denyhosts.init,342 bytes, text/plain)
2005-08-28 23:15 UTC, Rene Zbinden
Details
denyhosts-1.0.1.ebuild (denyhosts-1.0.1.ebuild,1.83 KB, text/plain)
2005-08-28 23:23 UTC, Rene Zbinden
Details
denyhosts-1.0.2.ebuild (denyhosts-1.0.2.ebuild,1.80 KB, text/plain)
2005-09-05 13:45 UTC, Rene Zbinden
Details
denyhosts-gentoo.patch (denyhosts-gentoo.patch,2.37 KB, text/plain)
2005-09-05 13:46 UTC, Rene Zbinden
Details
denyhosts-1.1.2.ebuild (denyhosts-1.1.2.ebuild,1.86 KB, text/plain)
2005-10-06 05:13 UTC, Rene Zbinden
Details
denyhosts-gentoo.patch (denyhosts-gentoo.patch,2.33 KB, text/plain)
2005-10-06 05:14 UTC, Rene Zbinden
Details
denyhosts-1.1.2.ebuild (denyhosts-1.1.2.ebuild,1.86 KB, text/plain)
2005-10-07 05:23 UTC, Rene Zbinden
Details
denyhosts-1.1.2.ebuild (denyhosts-1.1.2.ebuild,1.97 KB, text/plain)
2005-10-07 06:59 UTC, Rene Zbinden
Details
denyhosts-1.1.2.ebuild (denyhosts-1.1.2.ebuild,1.91 KB, text/plain)
2005-10-07 07:15 UTC, Rene Zbinden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kelly 2005-07-23 10:50:04 UTC
DenyHosts is a python script that parses sshd log files and looks for
illegitimate activities.  It can then (if sshd is using tcp-wrappers), block the
source IP addresses by adding them to /etc/hosts.deny, effectively disabling
these attacks.

It can be run as a cron job or a daemon, or just run at the discression of the
admin.

Attached is an ebuild for version 0.9.0, the latest at this time.

Also, I have only tested it on x86, although being python, it should work on
other architectures as well.

Attached as well is a patch which should configure it to be more compliant with
a gentoo layout, as well as a gentoo initd script.
Comment 1 Mike Kelly 2005-07-23 10:53:13 UTC
Created attachment 64139 [details]
DenyHosts-0.9.0.ebuild
Comment 2 Mike Kelly 2005-07-23 10:53:48 UTC
Created attachment 64140 [details, diff]
DenyHosts-0.9.0-gentoo.patch
Comment 3 Mike Kelly 2005-07-23 10:54:08 UTC
Created attachment 64141 [details]
denyhosts.rc6
Comment 4 Mike Kelly 2005-07-23 11:09:02 UTC
Wow... this guy develops fast... just today, it's jumped from 0.9.0 to 0.9.3...
attaching new ebuild and patch files.
Comment 5 Mike Kelly 2005-07-23 11:09:40 UTC
Created attachment 64143 [details]
DenyHosts-0.9.3.ebuild
Comment 6 Mike Kelly 2005-07-23 11:10:11 UTC
Created attachment 64144 [details]
DenyHosts-0.9.3-gentoo.patch
Comment 7 Mike Kelly 2005-07-23 18:57:04 UTC
The version is now up to 0.9.5, and the patch and ebuild for 0.9.3 will work
when renamed.
Comment 8 Mike Kelly 2005-07-23 19:17:44 UTC
Created attachment 64170 [details, diff]
patch to denyhosts.rc6 to make it more compliant
Comment 9 Mike Kelly 2005-07-24 00:31:59 UTC
Same ebuild/patch work for 0.9.6.
Comment 10 Avuton Olrich 2005-07-26 01:08:58 UTC
The patch no longer works with 0.9.7, also, if I remember right there's a GLEP 
that says the ebuild filenames shall be all lowercased. 
Comment 11 Mike Kelly 2005-07-26 05:55:11 UTC
Uhh... are you sure about that?

I just copied DenyHosts-0.9.6.ebuild to DenyHosts-0.9.7.ebuild, and
files/DenyHosts-0.9.6-gentoo.patch to files/DenyHosts-0.9.7-gentoo.patch and it
installed fine...  

And the reasoning for the capital letters in the ebuild name is because as I
understood it it was highly encouraged that your SRC_URI field look like this:

SRC_URI="http://download.sourceforge.net/denyhosts/${P}.tar.gz"

The package maintainer has been naming his distributed source files
DenyHosts-x.y.z.tar.gz, so the naming seemed natural.
Comment 12 Vince Castellano 2005-08-15 16:58:03 UTC
It worked for 0.9.9, the website says the current version is 1.0.0, but it is no
where to be found at this time. Either way, I'd love to see this into the tree.
Comment 13 Rene Zbinden 2005-08-21 23:53:40 UTC
Created attachment 66525 [details]
denyhosts-1.0.1.ebuild
Comment 14 Rene Zbinden 2005-08-21 23:54:41 UTC
Created attachment 66526 [details]
denyhosts-1.0.1-gentoo.patch
Comment 15 Rene Zbinden 2005-08-21 23:55:26 UTC
Created attachment 66527 [details]
denyhosts.init
Comment 16 Rene Zbinden 2005-08-22 00:06:58 UTC
I modified DenyHosts-0.9.3.ebuild ebuild and created denyhosts-1.0.1.ebuild.
Changes:
1. Removed capital letters in the ebuild
2. Changed the init script
    I) fixed the dependency. the script needs sshd and logger in order it works
properly
    II) I used start-stop-daemon to start the service (this is the gentoo way) 
This changes to the init script made the start script "daemon-control-dist"
obsolete, so it will not be included anymore.
3. Made changes in the patch to comment out scripts=['denyhosts.py'] in the
setup.py file. With that change only the python modules get installed with
distutils. The executable is installed with newexe and will be renamed from
denyhost.py to denyhosts
4. With the new patch I also changed the default ssh logfile in
denyhosts.cfg-dist from /var/log/secure to /var/log/messages
5. I also changed the lock file from /var/lock/subsys/denyhosts to
/var/run/denyhosts (this is the gentoo way)

Comments welcome.
Comment 17 Ciaran McCreesh 2005-08-24 09:59:58 UTC
Please fix the following and reopen:

* You can drop the KEYWORDS comment.
* ${S}, ${FILESDIR} should be quoted.
* No need to dodoc licences.
Comment 18 Rene Zbinden 2005-08-28 23:14:34 UTC
Created attachment 67135 [details]
denyhosts-1.0.1.ebuild
Comment 19 Rene Zbinden 2005-08-28 23:15:19 UTC
Created attachment 67136 [details]
denyhosts.init
Comment 20 Rene Zbinden 2005-08-28 23:23:35 UTC
Created attachment 67137 [details]
denyhosts-1.0.1.ebuild
Comment 21 Rene Zbinden 2005-08-28 23:25:47 UTC
I made the proposed changes.

I also changed the name of the configuration file from denyhosts.cfg to
denyhosts.conf and I described a little more in the ebuild what the patch does.
Comment 22 Rene Zbinden 2005-08-28 23:28:00 UTC
Unfortunatelly I cannot reopen the bug because I am not the owner of this bug.
Can someone else do that for me.
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2005-08-29 02:03:23 UTC
(In reply to comment #22)
> Unfortunatelly I cannot reopen the bug because I am not the owner of this bug.
> Can someone else do that for me.

Done.
Comment 24 Rene Zbinden 2005-08-31 07:43:27 UTC
Unix Review: Tool of the month.
http://www.unixreview.com/documents/s=9846/ur0508g/ur0508g.html
Comment 25 Ira Snyder 2005-09-05 10:12:45 UTC
I've been using this ebuild on stable x86 for a few weeks now, at least. I
rev-bumped it to denyhosts-1.0.2, but other than that I made no changes.

It's working great for me.

irasnyd@ping ~ $ emerge info
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.5-r1, 2.6.11-gentoo-r6 i686)
=================================================================
System uname: 2.6.11-gentoo-r6 i686 AMD Duron(tm) Processor
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon -mmmx -m3dnow -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/alias /var/qmail/control /var/vpopmail/domains
/var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon -mmmx -m3dnow -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.ccccom.com ftp://gentoo.ccccom.com
http://gentoo.gg3.net/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 alsa apache2 berkdb crypt fbcon fbdev gd gdbm gettext gif gpm imap
ipalias ipv6 java javascript jpeg libwww maildir memlimit mmx mysql ncurses nptl
pam pdflib perl png python readline slang spell sse ssl tcpd threads tiff
truetype usb xml xml2 userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 26 Richard Karnesky 2005-09-05 11:05:47 UTC
> I've been using this ebuild on stable x86 for a few weeks now, at least. I
> rev-bumped it to denyhosts-1.0.2, but other than that I made no changes.
Ditto.  Using on both ~x86 and x86 since 8/1.  Have been version bumping the
newest revisions of the ebuilds.

Thanks!
Comment 27 Ciaran McCreesh 2005-09-05 11:19:45 UTC
A few things:

* Is ">dev-lang/python-2.3" really correct? This means that python-2.3 is no
good but python-2.3-r1 is fine...
* I don't think you need the dodir before the keepdir.
* ${FILESDIR} is missing quotes in src_install.
Comment 28 Richard Karnesky 2005-09-05 11:24:14 UTC
> * Is ">dev-lang/python-2.3" really correct? This means that python-2.3 is no
> good but python-2.3-r1 is fine...
Should probably be >=, but 2.3.4-r1 is the earliest version in portage.  I think
it is nitpicking

> * I don't think you need the dodir before the keepdir.
> * ${FILESDIR} is missing quotes in src_install.
Good catches.
Comment 29 Ciaran McCreesh 2005-09-05 11:41:38 UTC
Yup, it's nit picking. That's part of my job. Gotta remove all the nits before
it can be tagged as reviewed, it'll make things easier for whoever takes the bug.

Another nit: too many blank lines between variables!
Comment 30 Rene Zbinden 2005-09-05 13:45:57 UTC
Created attachment 67695 [details]
denyhosts-1.0.2.ebuild
Comment 31 Rene Zbinden 2005-09-05 13:46:39 UTC
Created attachment 67696 [details]
denyhosts-gentoo.patch
Comment 32 Rene Zbinden 2005-09-05 13:51:17 UTC
(In reply to comment #27)
> A few things:
> 
> * Is ">dev-lang/python-2.3" really correct? This means that python-2.3 is no
> good but python-2.3-r1 is fine...
> * I don't think you need the dodir before the keepdir.
> * ${FILESDIR} is missing quotes in src_install.
OK I made these changes. I also changed the following:
1. I quoted $S in src_unpack
2. I changed the name of the pach since that gentoo-specific patch will work on
all 1.0.* versions of denyhosts

I am happy that you are so nitpicking, that improves my ebuild-writing skills.
Comments are always welcome.
Comment 33 Alin Vaida 2005-09-09 04:46:49 UTC
Latest ebuild does not put anything in /etc/init.d : 
 
--snip-- 
copying build/lib/DenyHosts/regex.py 
-> /var/tmp/portage/denyhosts-1.0.2/image/usr/lib/python2.4/site-packages/DenyHosts 
copying build/lib/DenyHosts/allowedhosts.py 
-> /var/tmp/portage/denyhosts-1.0.2/image/usr/lib/python2.4/site-packages/DenyHosts 
cp: cannot stat `/usr/local/portage/net-misc/denyhosts/files/denyhosts.init': 
No such file or directory 
install: cannot stat `/var/tmp/portage/denyhosts-1.0.2/temp/denyhosts': No such 
file or directory 
--snip-- 
Comment 34 Rene Zbinden 2005-09-09 06:35:52 UTC
(In reply to comment #33)
> Latest ebuild does not put anything in /etc/init.d : 
>  
> --snip-- 
> copying build/lib/DenyHosts/regex.py 
> ->
/var/tmp/portage/denyhosts-1.0.2/image/usr/lib/python2.4/site-packages/DenyHosts 
> copying build/lib/DenyHosts/allowedhosts.py 
> ->
/var/tmp/portage/denyhosts-1.0.2/image/usr/lib/python2.4/site-packages/DenyHosts 
> cp: cannot stat `/usr/local/portage/net-misc/denyhosts/files/denyhosts.init': 
> No such file or directory 
> install: cannot stat `/var/tmp/portage/denyhosts-1.0.2/temp/denyhosts': No such 
> file or directory 
> --snip-- 

did you actually download the denyhost.init file (see attachment above) and put
it into the files directory?
Comment 35 Alin Vaida 2005-09-10 07:14:08 UTC
(In reply to comment #34) 
Sorry, I missed it, hidden among the older attachments.  
My bad 
Comment 36 Aquila 2005-09-22 00:17:52 UTC
Is this ebuild ready for stable now? With the continuous ssh attacks this 
becomes quite necessary...
Comment 37 Rene Zbinden 2005-09-22 01:02:19 UTC
(In reply to comment #36)
> Is this ebuild ready for stable now? With the continuous ssh attacks this 
> becomes quite necessary...
I am running it more than a month stable on a production system. Works flawlessly.
Comment 38 Rene Zbinden 2005-10-06 05:13:51 UTC
Created attachment 69978 [details]
denyhosts-1.1.2.ebuild

New ebuild for new denyhosts version.
Comment 39 Rene Zbinden 2005-10-06 05:14:47 UTC
Created attachment 69979 [details]
denyhosts-gentoo.patch

New patch that works with version 1.1.2.
Comment 40 gentoo 2005-10-06 14:50:01 UTC
Glad to find this ebuild here.

Dumb question: what category would you put this under PORTAGE_OVERLAY ?
Comment 41 Rene Zbinden 2005-10-06 23:41:11 UTC
(In reply to comment #40)
> Glad to find this ebuild here.
> 
> Dumb question: what category would you put this under PORTAGE_OVERLAY ?
> 
In app-admin/denyhosts I suggest.
Comment 42 Mike Kelly 2005-10-07 05:11:54 UTC
As a note, the pkg_postinst() information has a typo:

In the original version I submitted of the ebuild, I had kept the main script's
name as /usr/bin/denyhosts.py.  However, people have subsequently changed that
file's name to /usr/bin/denyhosts.  But, the postinst information still has the
".py" listed in the instructions for cron mode.


Thanks to the people who made that hack I threw together more gentoo-ified.
Comment 43 Rene Zbinden 2005-10-07 05:23:22 UTC
Created attachment 70069 [details]
denyhosts-1.1.2.ebuild

Fixed the typo at the end of the ebuild. Thanks goes to you for the initial
ebuild.
Comment 44 gentoo 2005-10-07 06:09:56 UTC
With the latest ebuild, the init script never returns:

# /etc/init.d/denyhosts start
 * Starting DenyHosts daemon ...

I can manually put it in the background.

Another problem was that I had no hosts.deny file - maybe the ebuild can do "touch /etc/hosts.deny" if 
the file doesn't exist during the install?
Comment 45 gentoo 2005-10-07 06:14:18 UTC
Ignore previous comment about starting - it returns... eventually... just a bit slow.
Comment 46 Rene Zbinden 2005-10-07 06:59:34 UTC
Created attachment 70081 [details]
denyhosts-1.1.2.ebuild

This ebuild creates an empty /etc/hosts.deny file if none exists.
Comment 47 Rene Zbinden 2005-10-07 07:15:03 UTC
Created attachment 70084 [details]
denyhosts-1.1.2.ebuild

This is the newest denyhost ebuild. Please use this one.
Comment 48 gentoo 2005-10-07 07:48:41 UTC
OK, this latest ebuild was a flawless install and the init script is much faster.

Excellent.
Comment 49 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2005-10-07 13:55:07 UTC
I've added this to portage. Thanks for all the contributions.