"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ntfsprogs/ntfsdump_logfile.c" between
ntfs-3g_ntfsprogs-2016.2.22.tgz and ntfs-3g_ntfsprogs-2017.3.23.tgz

About: NTFS-3G is a read-write NTFS driver for Linux and other operating systems. It provides safe handling of the Windows XP, Windows Server 2003, Windows 2000, Windows Vista, Windows Server 2008, Windows 7 and Windows 8 NTFS file systems.

ntfsdump_logfile.c  (ntfs-3g_ntfsprogs-2016.2.22.tgz):ntfsdump_logfile.c  (ntfs-3g_ntfsprogs-2017.3.23.tgz)
skipping to change at line 322 skipping to change at line 322
"how to handle version 1.1.\n", "how to handle version 1.1.\n",
sle16_to_cpu(rstr->major_ver), sle16_to_cpu(rstr->major_ver),
sle16_to_cpu(rstr->minor_ver)); sle16_to_cpu(rstr->minor_ver));
/* Verify the location and size of the update sequence array. */ /* Verify the location and size of the update sequence array. */
usa_end_ofs = le16_to_cpu(rstr->usa_ofs) + usa_end_ofs = le16_to_cpu(rstr->usa_ofs) +
le16_to_cpu(rstr->usa_count) * sizeof(u16); le16_to_cpu(rstr->usa_count) * sizeof(u16);
if (page_size / NTFS_BLOCK_SIZE + 1 != le16_to_cpu(rstr->usa_count)) if (page_size / NTFS_BLOCK_SIZE + 1 != le16_to_cpu(rstr->usa_count))
log_err_exit(buf, "Restart page header in $LogFile is " log_err_exit(buf, "Restart page header in $LogFile is "
"corrupt: Update sequence array size is " "corrupt: Update sequence array size is "
"wrong. Cannot handle this yet.\n"); "wrong. Cannot handle this yet.\n");
if (le16_to_cpu(rstr->usa_ofs) < sizeof(RESTART_PAGE_HEADER)) if (le16_to_cpu(rstr->usa_ofs) < offsetof(RESTART_PAGE_HEADER, usn))
log_err_exit(buf, "Restart page header in $LogFile is " log_err_exit(buf, "Restart page header in $LogFile is "
"corrupt: Update sequence array overlaps " "corrupt: Update sequence array overlaps "
"restart page header. Cannot handle this " "restart page header. Cannot handle this "
"yet.\n"); "yet.\n");
if (usa_end_ofs > NTFS_BLOCK_SIZE - sizeof(u16)) if (usa_end_ofs > NTFS_BLOCK_SIZE - sizeof(u16))
log_err_exit(buf, "Restart page header in $LogFile is " log_err_exit(buf, "Restart page header in $LogFile is "
"corrupt: Update sequence array overlaps or " "corrupt: Update sequence array overlaps or "
"is behind first protected sequence number. " "is behind first protected sequence number. "
"Cannot handle this yet.\n"); "Cannot handle this yet.\n");
if (usa_end_ofs > le16_to_cpu(rstr->restart_area_offset)) if (usa_end_ofs > le16_to_cpu(rstr->restart_area_offset))
skipping to change at line 560 skipping to change at line 560
ntfs_log_info("client data length = 0x%x\n", ntfs_log_info("client data length = 0x%x\n",
(unsigned int)le32_to_cpu(lr->client_data_length)); (unsigned int)le32_to_cpu(lr->client_data_length));
ntfs_log_info("client_id.seq_number = 0x%x\n", ntfs_log_info("client_id.seq_number = 0x%x\n",
le16_to_cpu(lr->client_id.seq_number)); le16_to_cpu(lr->client_id.seq_number));
ntfs_log_info("client_id.client_index = 0x%x\n", ntfs_log_info("client_id.client_index = 0x%x\n",
le16_to_cpu(lr->client_id.client_index)); le16_to_cpu(lr->client_id.client_index));
ntfs_log_info("record type = 0x%x\n", ntfs_log_info("record type = 0x%x\n",
(unsigned int)le32_to_cpu(lr->record_type)); (unsigned int)le32_to_cpu(lr->record_type));
ntfs_log_info("transaction_id = 0x%x\n", ntfs_log_info("transaction_id = 0x%x\n",
(unsigned int)le32_to_cpu(lr->transaction_id)); (unsigned int)le32_to_cpu(lr->transaction_id));
ntfs_log_info("flags = 0x%x:", le16_to_cpu(lr->flags)); ntfs_log_info("flags = 0x%x:", le16_to_cpu(lr->log_record_flags));
if (!lr->flags) if (!lr->log_record_flags)
ntfs_log_info(" NONE\n"); ntfs_log_info(" NONE\n");
else { else {
int _b = 0; int _b = 0;
if (lr->flags & LOG_RECORD_MULTI_PAGE) { if (lr->log_record_flags & LOG_RECORD_MULTI_PAGE) {
ntfs_log_info(" LOG_RECORD_MULTI_PAGE"); ntfs_log_info(" LOG_RECORD_MULTI_PAGE");
_b = 1; _b = 1;
} }
if (lr->flags & ~LOG_RECORD_MULTI_PAGE) { if (lr->log_record_flags & ~LOG_RECORD_MULTI_PAGE) {
if (_b) if (_b)
ntfs_log_info(" |"); ntfs_log_info(" |");
ntfs_log_info(" Unknown flags"); ntfs_log_info(" Unknown flags");
} }
ntfs_log_info("\n"); ntfs_log_info("\n");
} }
ntfs_log_info("redo_operation = 0x%x\n", le16_to_cpu(lr->redo_operation)) ; ntfs_log_info("redo_operation = 0x%x\n", le16_to_cpu(lr->redo_operation)) ;
ntfs_log_info("undo_operation = 0x%x\n", le16_to_cpu(lr->undo_operation)) ; ntfs_log_info("undo_operation = 0x%x\n", le16_to_cpu(lr->undo_operation)) ;
ntfs_log_info("redo_offset = 0x%x\n", le16_to_cpu(lr->redo_offset)); ntfs_log_info("redo_offset = 0x%x\n", le16_to_cpu(lr->redo_offset));
ntfs_log_info("redo_length = 0x%x\n", le16_to_cpu(lr->redo_length)); ntfs_log_info("redo_length = 0x%x\n", le16_to_cpu(lr->redo_length));
skipping to change at line 592 skipping to change at line 592
ntfs_log_info("undo_length = 0x%x\n", le16_to_cpu(lr->undo_length)); ntfs_log_info("undo_length = 0x%x\n", le16_to_cpu(lr->undo_length));
ntfs_log_info("target_attribute = 0x%x\n", le16_to_cpu(lr->target_attribu te)); ntfs_log_info("target_attribute = 0x%x\n", le16_to_cpu(lr->target_attribu te));
ntfs_log_info("lcns_to_follow = 0x%x\n", le16_to_cpu(lr->lcns_to_follow)) ; ntfs_log_info("lcns_to_follow = 0x%x\n", le16_to_cpu(lr->lcns_to_follow)) ;
ntfs_log_info("record_offset = 0x%x\n", le16_to_cpu(lr->record_offset)); ntfs_log_info("record_offset = 0x%x\n", le16_to_cpu(lr->record_offset));
ntfs_log_info("attribute_offset = 0x%x\n", le16_to_cpu(lr->attribute_offs et)); ntfs_log_info("attribute_offset = 0x%x\n", le16_to_cpu(lr->attribute_offs et));
ntfs_log_info("target_vcn = 0x%llx\n", ntfs_log_info("target_vcn = 0x%llx\n",
(unsigned long long)sle64_to_cpu(lr->target_vcn)); (unsigned long long)sle64_to_cpu(lr->target_vcn));
if (le16_to_cpu(lr->lcns_to_follow) > 0) if (le16_to_cpu(lr->lcns_to_follow) > 0)
ntfs_log_info("Array of lcns:\n"); ntfs_log_info("Array of lcns:\n");
for (i = 0; i < le16_to_cpu(lr->lcns_to_follow); i++) for (i = 0; i < le16_to_cpu(lr->lcns_to_follow); i++)
ntfs_log_info("lcn_list[%u].lcn = 0x%llx\n", i, (unsigned long lo ntfs_log_info("lcn_list[%u].lcn = 0x%llx\n", i,
ng) (unsigned long long)sle64_to_cpu(lr->lcn_list[i]));
sle64_to_cpu(lr->lcn_list[i].lcn));
} }
/** /**
* dump_log_records() * dump_log_records()
*/ */
static void dump_log_records(RECORD_PAGE_HEADER *rcrd, u8 *buf, static void dump_log_records(RECORD_PAGE_HEADER *rcrd, u8 *buf,
int buf_size, unsigned int page_size) int buf_size, unsigned int page_size)
{ {
LOG_RECORD *lr; LOG_RECORD *lr;
int pass = 0; int pass = 0;
skipping to change at line 636 skipping to change at line 636
/* Dump log record page */ /* Dump log record page */
ntfs_log_info("magic = %s\n", ntfs_is_rcrd_record(rcrd->magic) ? "RCRD" : ntfs_log_info("magic = %s\n", ntfs_is_rcrd_record(rcrd->magic) ? "RCRD" :
"CHKD"); "CHKD");
// TODO: I am here... (AIA) // TODO: I am here... (AIA)
ntfs_log_info("copy.last_lsn/file_offset = 0x%llx\n", (unsigned long long ) ntfs_log_info("copy.last_lsn/file_offset = 0x%llx\n", (unsigned long long )
sle64_to_cpu(rcrd->copy.last_lsn)); sle64_to_cpu(rcrd->copy.last_lsn));
ntfs_log_info("flags = 0x%x\n", (unsigned int)le32_to_cpu(rcrd->flags)); ntfs_log_info("flags = 0x%x\n", (unsigned int)le32_to_cpu(rcrd->flags));
ntfs_log_info("page count = %i\n", le16_to_cpu(rcrd->page_count)); ntfs_log_info("page count = %i\n", le16_to_cpu(rcrd->page_count));
ntfs_log_info("page position = %i\n", le16_to_cpu(rcrd->page_position)); ntfs_log_info("page position = %i\n", le16_to_cpu(rcrd->page_position));
ntfs_log_info("header.next_record_offset = 0x%llx\n", (unsigned long long ) ntfs_log_info("header.next_record_offset = 0x%llx\n", (unsigned long long )
le16_to_cpu(rcrd->header.packed.next_record_offset)); le16_to_cpu(rcrd->next_record_offset));
ntfs_log_info("header.last_end_lsn = 0x%llx\n", (unsigned long long) ntfs_log_info("header.last_end_lsn = 0x%llx\n", (unsigned long long)
sle64_to_cpu(rcrd->header.packed.last_end_lsn)); sle64_to_cpu(rcrd->last_end_lsn));
/* /*
* Where does the 0x40 come from? Is it just usa_offset + * Where does the 0x40 come from? Is it just usa_offset +
* usa_client * 2 + 7 & ~7 or is it derived from somewhere? * usa_client * 2 + 7 & ~7 or is it derived from somewhere?
*/ */
lr = (LOG_RECORD*)((u8*)rcrd + 0x40); lr = (LOG_RECORD*)((u8*)rcrd + 0x40);
client = 0; client = 0;
do { do {
ntfs_log_info("\nLog record %i:\n", client); ntfs_log_info("\nLog record %i:\n", client);
dump_log_record(lr); dump_log_record(lr);
client++; client++;
lr = (LOG_RECORD*)((u8*)lr + 0x70); lr = (LOG_RECORD*)((u8*)lr + 0x70);
} while (((u8*)lr + 0x70 <= (u8*)rcrd + } while (((u8*)lr + 0x70 <= (u8*)rcrd +
le16_to_cpu(rcrd->header.packed.next_record_offset))); le16_to_cpu(rcrd->next_record_offset)));
pass++; pass++;
goto rcrd_pass_loc; goto rcrd_pass_loc;
} }
/** /**
* main - * main -
*/ */
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
 End of changes. 8 change blocks. 
11 lines changed or deleted 10 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS