Ticket #38961: patch-fail2ban-server.diff

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

    old new  
    2525import getopt, sys, logging, os
    2626
    2727# Inserts our own modules path first in the list
    28 # fix for bug #343821
    29 if os.path.abspath(__file__).startswith('/usr/'):
    30         # makes sense to use system-wide library iff -server is also under /usr/
    31         sys.path.insert(1, "/usr/share/fail2ban")
     28# Camusensei issue #112 - https://github.com/fail2ban/fail2ban/issues/112
     29try:
     30        from common.version import version
     31except ImportError, e:
     32        sys.path.insert(1, "/opt/local/share/fail2ban")
     33        from common.version import version
    3234
    33 from common.version import version
    3435from server.server import Server
    3536
    3637# Gets the instance of the logger.
     
    5253                self.__conf = dict()
    5354                self.__conf["background"] = True
    5455                self.__conf["force"] = False
    55                 self.__conf["socket"] = "/var/run/fail2ban/fail2ban.sock"
     56                self.__conf["socket"] = "@@PREFIX@@/var/run/fail2ban/fail2ban.sock"
    5657       
    5758        def dispVersion(self):
    5859                print "Fail2Ban v" + version