mirror of https://github.com/fail2ban/fail2ban
Merge remote branch 'upstream-repo/FAIL2BAN-0_8' into upstream
* upstream-repo/FAIL2BAN-0_8: - Patch to make log file descriptors cloexec to stop leaking file descriptors on - Changed to SVN version.debian-upstream
commit
1b8a52fa48
|
@ -24,4 +24,4 @@ __date__ = "$Date: 2009-09-07 21:13:45 +0200 (Mon, 07 Sep 2009) $"
|
||||||
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
|
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
|
||||||
__license__ = "GPL"
|
__license__ = "GPL"
|
||||||
|
|
||||||
version = "0.8.4"
|
version = "0.8.4-SVN"
|
||||||
|
|
|
@ -31,7 +31,7 @@ from datedetector import DateDetector
|
||||||
from mytime import MyTime
|
from mytime import MyTime
|
||||||
from failregex import FailRegex, Regex, RegexException
|
from failregex import FailRegex, Regex, RegexException
|
||||||
|
|
||||||
import logging, re, os
|
import logging, re, os, fcntl
|
||||||
|
|
||||||
# Gets the instance of the logger.
|
# Gets the instance of the logger.
|
||||||
logSys = logging.getLogger("fail2ban.filter")
|
logSys = logging.getLogger("fail2ban.filter")
|
||||||
|
@ -469,6 +469,9 @@ class FileContainer:
|
||||||
|
|
||||||
def open(self):
|
def open(self):
|
||||||
self.__handler = open(self.__filename)
|
self.__handler = open(self.__filename)
|
||||||
|
# Set the file descriptor to be FD_CLOEXEC
|
||||||
|
fd = self.__handler.fileno()
|
||||||
|
fcntl.fcntl(fd, fcntl.F_SETFD, fd | fcntl.FD_CLOEXEC)
|
||||||
firstLine = self.__handler.readline()
|
firstLine = self.__handler.readline()
|
||||||
# Computes the MD5 of the first line.
|
# Computes the MD5 of the first line.
|
||||||
myHash = md5.new(firstLine).digest()
|
myHash = md5.new(firstLine).digest()
|
||||||
|
|
Loading…
Reference in New Issue