]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
metadump: handle multi-block directories
authorEric Sandeen <sandeen@sandeen.net>
Wed, 29 Jul 2015 23:17:43 +0000 (09:17 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 29 Jul 2015 23:17:43 +0000 (09:17 +1000)
assembled a buffer from multiple dir blocks, and we can use that in
obfuscate_dir_data_block() to continue past the first filesystem block
and continue obfuscating the entire thing.

Without this, anything after the first block was skipped, and
remained as cleartext.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/metadump.c

index 5cc1ece983e69bf7a53487eef808424f0f3891fb..dd1d7ab9d640cd81745c574ea2363a13f13ca519 100644 (file)
@@ -1152,9 +1152,6 @@ obfuscate_dir_data_block(
 
        datahdr = (struct xfs_dir2_data_hdr *)block;
 
-       if (offset % mp->m_dirblkfsbs != 0)
-               return; /* corrupted, leave it alone */
-
        if (is_block_format) {
                xfs_dir2_leaf_entry_t   *blp;
                xfs_dir2_block_tail_t   *btp;
@@ -1187,7 +1184,7 @@ obfuscate_dir_data_block(
 
        dir_offset = xfs_dir3_data_entry_offset(datahdr);
        ptr = block + dir_offset;
-       endptr = block + mp->m_sb.sb_blocksize;
+       endptr = block + mp->m_dirblksize;
 
        while (ptr < endptr && dir_offset < end_of_data) {
                xfs_dir2_data_entry_t   *dep;