Ticket #38961: patch-fail2ban-client.diff

File patch-fail2ban-client.diff, 1.1 KB (added by fclaire@…, 12 years ago)
  • fail2ban-client

    old new  
    2626import getopt, time, shlex, socket
    2727
    2828# Inserts our own modules path first in the list
    29 # fix for bug #343821
    30 if os.path.abspath(__file__).startswith('/usr/'):
    31         # makes sense to use system-wide library iff -client is also under /usr/
    32         sys.path.insert(1, "/usr/share/fail2ban")
     29# Camusensei issue #112 - https://github.com/fail2ban/fail2ban/issues/112
     30try:
     31        from common.version import version
     32except ImportError, e:
     33        sys.path.insert(1, "@@PREFIX@@/share/fail2ban")
     34        from common.version import version
    3335
    3436# Now we can import our modules
    35 from common.version import version
    3637from common.protocol import printFormatted
    3738from client.csocket import CSocket
    3839from client.configurator import Configurator
     
    5556                self.__stream = None
    5657                self.__configurator = Configurator()
    5758                self.__conf = dict()
    58                 self.__conf["conf"] = "/etc/fail2ban"
     59                self.__conf["conf"] = "@@PREFIX@@/etc/fail2ban"
    5960                self.__conf["dump"] = False
    6061                self.__conf["force"] = False
    6162                self.__conf["verbose"] = 1