summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/fail2ban/files/fail2ban-0.8.4-hashlib.patch')
-rw-r--r--net-analyzer/fail2ban/files/fail2ban-0.8.4-hashlib.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/net-analyzer/fail2ban/files/fail2ban-0.8.4-hashlib.patch b/net-analyzer/fail2ban/files/fail2ban-0.8.4-hashlib.patch
new file mode 100644
index 000000000000..4ab90b85c88f
--- /dev/null
+++ b/net-analyzer/fail2ban/files/fail2ban-0.8.4-hashlib.patch
@@ -0,0 +1,31 @@
+Index: fail2ban-0.8.4/server/filter.py
+===================================================================
+--- fail2ban-0.8.4.orig/server/filter.py
++++ fail2ban-0.8.4/server/filter.py
+@@ -439,7 +439,7 @@ class FileFilter(Filter):
+ # In order to detect log rotation, the hash (MD5) of the first line of the file
+ # is computed and compared to the previous hash of this line.
+
+-import md5
++import hashlib
+
+ class FileContainer:
+
+@@ -454,7 +454,7 @@ class FileContainer:
+ try:
+ firstLine = handler.readline()
+ # Computes the MD5 of the first line.
+- self.__hash = md5.new(firstLine).digest()
++ self.__hash = hashlib.md5(firstLine).digest()
+ # Start at the beginning of file if tail mode is off.
+ if tail:
+ handler.seek(0, 2)
+@@ -471,7 +471,7 @@ class FileContainer:
+ self.__handler = open(self.__filename)
+ firstLine = self.__handler.readline()
+ # Computes the MD5 of the first line.
+- myHash = md5.new(firstLine).digest()
++ myHash = hashlib.md5(firstLine).digest()
+ stats = os.fstat(self.__handler.fileno())
+ # Compare hash and inode
+ if self.__hash != myHash or self.__ino != stats.st_ino: