Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#48 New fail2ban-client set <JAIL> banip <IP> doesn't work.

open
nobody
None
3
2009-10-10
2009-10-10
Mark Sapiro
No

Support for the banip command is the new addBannedIP method of the Filter class in server/filter.py. This method sets unixTime = time.time() without importing time. It should probably set unixTime = MyTime.time() instead.

Discussion

  • Mark Sapiro
    Mark Sapiro
    2009-10-10

    I made the suggested change above, replacing unixTime = time.time() with unixTime = MyTime.time(), and now the command

    fail2ban-client set <JAIL> banip <IP>

    is accepted and instead of responding "global name 'time' is not defined" as before, it responds with the IP, but the IP is not banned.

     
  • Mark Sapiro
    Mark Sapiro
    2009-10-10

    • priority: 5 --> 3
     
  • LaFong
    LaFong
    2011-12-22

    banip does not work for me in CentOS 5.x (and presumably RHEL5.x). I have updated python to latest, 2.4.3-44. I have tried fail2ban 0.8.4 through 0.8.6, using rpm, tar, github versions. I manually changed filter.py to import the time module in 0.8.4. No errors at all reported, but no IP gets banned using banip. Filters do work, so automatic banning does work.