Bug 450222 - Denyhosts purge command cannot find configuration file
Denyhosts purge command cannot find configuration file
Product: Fedora
Classification: Fedora
Component: denyhosts (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Jason Tibbitts
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-06-05 19:00 EDT by srh
Modified: 2008-07-09 17:49 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-07-05 14:41:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description srh 2008-06-05 19:00:20 EDT
Description of problem:
The denyhosts --purge command removes any blocked IPs in /etc/hosts.deny older
than the PURGE_DENY variable set in /etc/denyhosts.conf. When I stop the
denyhosts service, and run the purge command, an error comes up:

[root@XXXXX XXXX]# /usr/bin/denyhosts.py --purge
Error reading file: denyhosts.cfg
[Errno 2] No such file or directory: 'denyhosts.cfg'
[root@sXXXXX XXXX]#

Should denyhosts be looking for denyhosts.conf, not denyhosts.cfg???

Version-Release number of selected component (if applicable):
denyhosts.noarch 2.6-8.fc9

How reproducible:

Steps to Reproduce:
1. service denyhosts stop
2. denyhosts.py --purge
3. error message produced
Actual results:

Expected results:
successful purge command

Additional info:
Comment 1 Jason Tibbitts 2008-06-05 21:09:48 EDT
Well, the default config file in the denyhosts executable is
/usr/share/denyhosts/denyhosts.cfg; Fedora uses /etc/denyhosts.conf but of
course you're welcome to use whatever config file you like.

I suppose it's theoretically possible to patch the denyhosts executable but
honestly I try to patch the upstream sources as little as I can get away with.

I don't really see this as a bug, but I'll give it some thought.
Comment 2 srh 2008-06-06 00:42:41 EDT
If Fedora has decided to actively change the default config to
/etc/denyhosts.conf (which is a reasonable action for how this distro organises
things), then ALL default aspects of denyhosts should point to this. This
particular config file is where the action happens, not a copy of the config
file pasted elsewhere. That is just confusing.
Comment 3 Jason Tibbitts 2008-06-06 01:01:03 EDT
Well, Fedora hasn't decided to actively change the default config to
/etc/denyhosts.conf.  In fact, the fact that it Fedora doesn't do that is the
reason you've opened this ticket.  The initscripts and crontabs all specify a
config file location and don't rely on the default setting.

You are asking that we introduce a variance from the upstream sources.  If you
installed the Fedora package, tossed the initscript and decided to roll your
own, you wouldn't be able to use existing documentation because Fedora would
have changed the behavior of the program.

I indicated that I would give this some thought, and I will do that.  I will
consult other Fedora packagers and get their input.  I have to balance your
valid concerns against the above valid concerns, and I promise I won't make a
snap judgment.  Just give me some time to consider the options.
Comment 4 srh 2008-06-06 05:34:38 EDT
No rush at all in the decision making. I can work around the problem easily
enough meanwhile. I do not actually mind how the system works in the end, so
long as it is well thought out, logical and consistent. Thats what all software
aspires to. Following upstream closely is also very good in general.

I only started this bug as it appears there is a possibly inconsistency
(previously unnoticed??) as to where different software tools look for the
config file. However, it makes sense to have only one config file, and also for
the --purge command to work, as explained on the denyhosts website.
Comment 5 Jason Tibbitts 2008-07-01 23:40:29 EDT
I did some work on denyhosts today.

Regarding your problem, inspection reveals that what you want to work wouldn't
work even if we hadn't used a different name for the configuration file, because
denyhosts.py only looks for the config file in the current directory.

I just patched it to default to /etc/denyhosts.conf.  Given the mostly useless
default behavior I think there's a low possibility of anyone depending on it, so
I feel confident in pushing this to F9.  Please do test and comment on the
update as  appropriate.
Comment 6 Fedora Update System 2008-07-01 23:41:15 EDT
denyhosts-2.6-10.fc9 has been submitted as an update for Fedora 9
Comment 7 Fedora Update System 2008-07-02 23:13:26 EDT
denyhosts-2.6-10.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update denyhosts'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-6008
Comment 8 srh 2008-07-05 00:51:57 EDT
I have installed and from updates-testing. The command "/usr/bin/denyhosts.py
--purge" now works as expected with the default /etc/denyhosts.conf.

Thanks for fixing this issue for Fedora. Perhaps this issue could be forwarded
upstream, so some easy upstream solution could be implemented.
Comment 9 Jason Tibbitts 2008-07-05 14:41:36 EDT
Thanks for testing; don't forget to make a note in the update system so that
this can be pushed to the stable repository.
Comment 10 Fedora Update System 2008-07-09 17:49:55 EDT
denyhosts-2.6-10.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.