Menu

#42 libext2fs: BIG ENDIAN byte wap

open
nobody
None
5
2012-11-28
2010-06-12
Robi
No

Hi,

I noticed, currently the byteswap functions skipped some inode fields.
__u16 i_pad1;
__u32 i_ctime_extra; /* extra Change time (nsec << 2 | epoch) */
__u32 i_mtime_extra; /* extra Modification time (nsec << 2 | epoch) */
__u32 i_atime_extra; /* extra Access time (nsec << 2 | epoch) */
__u32 i_crtime; /* File creation time */
__u32 i_crtime_extra; /* extra File creation time (nsec << 2 | epoch)*/
__u32 i_version_hi; /* high 32 bits for 64-bit version */

also skipped deleted entrys in ext2fs_read_dir_block2()

--- e2fsprogs-1.41.12/lib/ext2fs/dirblock.c 2010-05-18 05:04:39.000000000 +0200
+++ e2fsprogs-1.41.12-new/lib/ext2fs/dirblock.c 2010-06-12 16:19:16.000000000 +0200
@@ -53,7 +53,7 @@
retval = EXT2_ET_DIR_CORRUPTED;
} else if (((name_len & 0xFF) + 8) > rec_len)
retval = EXT2_ET_DIR_CORRUPTED;
- p += rec_len;
+ p += ((name_len & 0xFF) + 11) & ~3;
}
return retval;
}

In a program that uses the library and processed on these entries, it is difficult to correct this afterwards. Is it possible to integrate this into the library?

Thanks, Robi

Discussion