|
36 |
import time |
36 |
import time |
37 |
import syslog |
37 |
import syslog |
38 |
import re |
38 |
import re |
39 |
import md5 |
39 |
import hashlib |
40 |
import base64 |
40 |
import base64 |
41 |
import grp |
41 |
import grp |
42 |
import subprocess |
42 |
import subprocess |
|
67 |
gidNumber = 0 # fallback |
67 |
gidNumber = 0 # fallback |
68 |
filemode = '0640' |
68 |
filemode = '0640' |
69 |
cleanupDellog = True # remove missed dellog entries (after reporting about them) |
69 |
cleanupDellog = True # remove missed dellog entries (after reporting about them) |
|
|
70 |
digest = listener.configRegistry.get('ldap/logging/hash', 'md5') |
70 |
|
71 |
|
71 |
|
72 |
|
72 |
def needsConversion(char): |
73 |
def needsConversion(char): |
Lines 248-254
def handler(dn, new_copy, old_copy):
|
Link Here
|
---|
|
248 |
logfile.close() |
249 |
logfile.close() |
249 |
# 4. calculate nexthash, omitting the final line break to make validation of the |
250 |
# 4. calculate nexthash, omitting the final line break to make validation of the |
250 |
# record more intituive |
251 |
# record more intituive |
251 |
nexthash = md5.new(record[:-1]).hexdigest() |
252 |
nexthash = hashlib.new(digest, record[:-1]).hexdigest() |
252 |
# 5. cache nexthash (the actual logfile might be logrotated away..) |
253 |
# 5. cache nexthash (the actual logfile might be logrotated away..) |
253 |
cachefile.seek(0) |
254 |
cachefile.seek(0) |
254 |
cachefile.write(nexthash) |
255 |
cachefile.write(nexthash) |
|
318 |
logfile.close() |
319 |
logfile.close() |
319 |
|
320 |
|
320 |
# 4. calculate initial hash |
321 |
# 4. calculate initial hash |
321 |
nexthash = md5.new(record).hexdigest() |
322 |
nexthash = hashlib.new(digest, record).hexdigest() |
322 |
# 5. cache nexthash (the actual logfile might be logrotated away..) |
323 |
# 5. cache nexthash (the actual logfile might be logrotated away..) |
323 |
cachefile.seek(0) |
324 |
cachefile.seek(0) |
324 |
cachefile.write(nexthash) |
325 |
cachefile.write(nexthash) |