diff --git a/check_slapdd_crc32 b/check_slapdd_crc32 index 8187b02..3426b53 100755 --- a/check_slapdd_crc32 +++ b/check_slapdd_crc32 @@ -131,9 +131,12 @@ def fix_crc32(path, crc32, lines): if not options.fix: return True try: + headers_lines = [ + b'# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.\n', + b'# CRC32 ' + crc32.encode() + b'\n', + ] with open(path, 'wb') as fd: - lines = [b'# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.\n', b'# CRC32 %s\n' % crc32.encode()] + lines - for line in lines: + for line in headers_lines + lines: fd.write(line) except IOError as err: logging.error('%s: fail to write new file content (%s)', path, err)