Skip to content

Commit 72979d0

Browse files
committed
Bug#34538065 NDBXFRM1 only write checksum to trailer in append (write_forward) mode.
Fixup 8.0.29: WL#14285 [10] ndbxfrm_file: class for accessing backup and ndbfs files. The crc32 was always written to file trailer even if it was not uptodate or never applicable for the file. The bug has no impact on old versions since the only encrypted files was backup files which always was written in an append mode fashion and a valid crc32 sum was always written to trailer. Also when reading files the checksum was never checked whether it existed in trailer or not. If in future the checksum checks are added when reading file only valid crc32 sums should be stored, to allow for example encrypted redolog files to be read with such future ndbxfrm tool it must not have a crc32 sum stored in trailer now since it is wrong and that will cause future decryption of redolog files with ndbxfrm tool to fail. Change-Id: I4f8c9b5a2ff24fdc3e53e797edb97f9a1a62414b
1 parent c532cf7 commit 72979d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

storage/ndb/src/common/util/ndbxfrm_file.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,10 @@ int ndbxfrm_file::write_trailer(ndbxfrm_output_iterator *out,
12081208
{
12091209
ndb_ndbxfrm1::trailer ndbxfrm1;
12101210
require(ndbxfrm1.set_data_size(m_data_size) == 0);
1211-
require(ndbxfrm1.set_data_crc32(m_crc32) == 0);
1211+
if (m_file_op == OP_WRITE_FORW)
1212+
{
1213+
require(ndbxfrm1.set_data_crc32(m_crc32) == 0);
1214+
}
12121215
require(ndbxfrm1.set_file_pos(file_pos) == 0);
12131216
require(ndbxfrm1.set_file_block_size(m_file_block_size) == 0);
12141217
require(ndbxfrm1.prepare_for_write() == 0);

0 commit comments

Comments
 (0)