Problem with BlockHosts under Ubuntu

When I do:

blockhosts.py -- verbose

I get this:

blockhosts 1.0.4 started: 2006-08-18 23:18:36
... will discard all host entries older than 2006-08-18 11:18
... load blockfile: /etc/hosts.allow
... found both markers, count of hosts being watched: 0
Warning: no offset found, will read from beginning in logfile: /var/log/auth.log
... securelog, loading: /var/log/auth.log 0
... updates: counts: hosts to block: 2; hosts being watched: 3
Traceback (most recent call last):
File "/usr/bin/blockhosts.py", line 949, in ?
main()
File "/usr/bin/blockhosts.py", line 943, in main
dh.update_hosts_blockfile(options.blockcount, prune_date, new_logoffsets, options.dry_run)
File "/usr/bin/blockhosts.py", line 694, in update_hosts_blockfile
if fp:
UnboundLocalError: local variable 'fp' referenced before assignment

No data is written to hosts.allow

hmm.... run with debug?

Can you post the output from:

blockhosts.py --debug

Looks like the blockfile (/etc/hosts.allow) does not exist, or is not readable? But I just tested that on Fedora, it returns an error, does not crash.

I get the same error when I

I get the same error when I use Ubuntu 6.10

found issue

I think I have reproduced this issue - if blockfile is not update-able by the user running the script, this error will be seen. If anyone can confirm this, please post a comment.

This issue (when blockfile is not readable and writeable) has been fixed in the 1.0.5 release - the correct error message is printed out.