Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 203098 Details for
Bug 283629
net-analyzer/fail2ban-0.8.4: Use of deprecated python library md5
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Convert md5 usage to hashlib
hashlib.patch (text/plain), 1009 bytes, created by
Robert Trace
on 2009-09-04 04:40:27 UTC
(
hide
)
Description:
Convert md5 usage to hashlib
Filename:
MIME Type:
Creator:
Robert Trace
Created:
2009-09-04 04:40:27 UTC
Size:
1009 bytes
patch
obsolete
>diff -r 28ccc71919bf server/filter.py >--- a/server/filter.py Thu Sep 03 21:38:15 2009 -0400 >+++ b/server/filter.py Thu Sep 03 21:41:58 2009 -0400 >@@ -427,7 +427,7 @@ > # 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: > >@@ -440,7 +440,7 @@ > 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) >@@ -457,7 +457,7 @@ > 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() > # Compare hash. > if not self.__hash == myHash: > logSys.info("Log rotation detected for %s" % self.__filename)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 283629
: 203098